The shipping update API allows an external system to update bindCommerce on order shipping.
The fields that can be transmitted are the following:
- BindCommerce order id (eg "OrderID": "3470")
- Courier: (eg "TrackingCarrier": "SanMarinoMail")
- Shipment tracking code (eg "TrackingNumber": "00B2NMH8")
- Shipping date and time (e.g. "ShippedTime": "2018: 01: 10 12:36:19")
Call and authentication
The call is made to the URL generated by bindCommerce for the specific connector (to be configured in advance through the bindCommerce interface).
Authentication occurs through tokens assigned for the API node. The parameter is passed into the request header.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://HABCDE.bindcommerce.cloud/integrator-tool/logistic/request_logistic.php?connector=5258",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "[\r\n\t{\r\n \r\n\t \"OrderID\": 191252,\r\n\t \"TrackingCarrier\": \"UPS\",\r\n\t \"TrackingNumber\": \"1ZA103756899507566\",\r\n\t \"ShippedTime\": \"2017:12:13 09:00:00\"\r\n\t},\r\n\t{\r\n\t \r\n\t \"OrderID\": 191252,\r\n\t \"TransactionID\": \"ORDER2365\",\r\n\t \"CarrierID\": 50,\r\n\t \"TrackingCarrier\": \"UPS\",\r\n\t \"TrackingNumber\": \"1ZA103756899507566\",\r\n\t \"ShippedTime\": \"2017:12:13 09:00:00\"\r\n\t}\r\n]",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/json",
"token: 84b670ea63539f5bc0572a260f1f4dfb"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
File Json
[{"OrderID":"3470","TrackingCarrier":"SanMarinoMail","TrackingNumber":"00B2NMH8","ShippedTime":"2018:01:10 12:36:19"}]