This is an old revision of the document!
Billig Shipping Script
The Billig shipping script, named 'Export_Billig' in the Airtox File, is for sending shipping orders to Billig (BA) for processing. It runs as a MW script and uses CURL to send shipping orders over tcp/http. It is triggered by selecting Sales Invoices and pressing the “Export Billig” button.
Technical documentation
Key features:
- MW Sales Invoice Sending: Sends selected sales invoices to the Billig API.
- Checks Sales Invoices not already processed: Uses Transaction field user_4. Puts a timestamp if already sent. err:err text if error.
- Validates Delivery Addresses: Checks the delivery address meets criteria. More info below
- Validates Country 2 Char representation: Billig API uses 2 Char country digits for addresses. Uses JSON file to verify.
BILLIG API Information:
API is locked down by IPs. The available IPs are Martin's Office IP, Airtox's Server IP
Test Site Enpoints
- Sales Header endpoint: http://bc-test.billig-arbejdstoj.dk:18248/BC18_TEST_INTERNALIP_WINDOWUSER/ODataV4/Company('Airtox')/WS_3PL_Sales_Header
- Sales Line endpoint: http://bc-test.billig-arbejdstoj.dk:18248/BC18_TEST_INTERNALIP_WINDOWUSER/ODataV4/Company('Airtox')/WS_3PL_Sales_Line
- Header duplication check: http://bc-test.billig-arbejdstoj.dk:18248/BC18_TEST_INTERNALIP_WINDOWUSER/ODataV4/Company('Airtox')/WS_3PL_Sales_Line
Live Site Enpoints
- Sales Header endpoint: http://bc.billig-arbejdstoj.dk:18648/BC18_WS/ODataV4/Company('Airtox')/WS_3PL_Sales_Header
- Sales Line endpoint: http://bc.billig-arbejdstoj.dk:18648/BC18_WS/ODataV4/Company('Airtox')/WS_3PL_Sales_Line
- Header duplication check: http://bc.billig-arbejdstoj.dk:18648/BC18_WS/ODataV4/Company('Airtox')/WS_3PL_Sales_Shipment_Lines?%24filter=Order_No%20eq%20
Auth info is hard coded in script. Test Auth info is commented out.
The API is what can be deduced as a Microsoft Dynamics 365 API. The API is very basic and not very ideal, but it has been rock solid for 3 years despite its shortcomings. Some of those short commings are:
- Cannot immediately check for duplicated orders. This is because orders are not available for retrieval until Billig manually processes them!
- Uses HTTP and not HTTPS
- The test site is never updated with data and rules from the “live” site, which makes it impossible to test anything properly. If any new shipping codes are added, just have to add code to live script, and hope you do it correctly.
- Uses antiquated NTLM for authentication. Luckily CURL has a method for this with option. Thanks Craig for finding this
Curl_SetOpt(ch, CURLOPT_HTTPAUTH, 8)
Entry point:
on Before:F_TRANSLIST(windowRef) InstallToolBarIcon(windowRef, "Export_Billig") end
