Through the shipping account provided by the carrier, you can create a shipping label, and use the local printer to print out the shipping label.
POST
https://app.kd100.com/sendAssistant/order/apiCall
| Key | Value |
| Content-Type | application/json |
| API-Key | Your API-Key, find on API management |
| signature |
How to generate a signature? Use the JSON format of body parameters, concatenate them in the order of Body+API-Key+Secret, and then perform MD5 encryption, converting the encrypted results into string and uppercase. Example: DC0491A58035AB355061F54CB57161E5 |
Content-Type: application/json
API-Key: Enter your API Key here
signature: MD5(json+API-Key+Secret)
| Name | Data Type | Required | Note | |
|---|---|---|---|---|
| account_id | string | true | Monthly statement or payment account | |
| account_name | string | false | The username of your monthly statement | |
| account_secret | string | false | User password | |
| account_key | string | false | Account parameter | |
| code | string | false | Account parameter | |
| carrier_id | string | false | Carrier code, must user lowercase letters | |
| ship_to | ||||
| name | string | true | ||
| mobile_phone | string | true | ||
| address1 | string | true | Receiving address | |
| address2 | string | false | Prefecture | Country: as a supplement to receiving address | |
| state_province | string | true | State | Province: as a supplement to receiving address | |
| company | string | false | Company name | |
| country_code | string | true | Country ISO code. For example, CN stands for China and US stands for United States of America. | |
| city | string | true | ||
| postal_code | string | true | ||
| landline_phone | string | false | Phone number | |
| string | false | Email address | ||
| tax_id | string | false | ||
| tax_type | string | false | Taxpayer type | |
| vat_number | string | false | VAT number; used in European countries, UK included. | |
| eori_number | string | false | EORI number: used for customs clearance in the European Union | |
| ioss_number | string | false | IOSS number | |
| ship_from | ||||
| name | string | true | ||
| mobile_phone | string | true | ||
| address1 | string | true | sending address | |
| address2 | string | false | Prefecture | Country: as a supplement to sending address | |
| state_province | string | true | State | Province: as a supplement to sending address | |
| company | string | false | Company name | |
| country_code | string | true | Country ISO code. For example, CN stands for China and US stands for United States of America. | |
| city | string | true | ||
| postal_code | string | true | ||
| landline_phone | string | false | Phone number | |
| string | false | Email address | ||
| tax_id | string | false | ||
| tax_type | string | false | Taxpayer type | |
| vat_number | string | false | VAT number; used in European countries, UK included. | |
| eori_number | string | false | EORI number: used for customs clearance in the European Union | |
| ioss_number | string | false | IOSS number | |
| contents_explanation | string | false | Description of the goods | |
| shipping_service | string | true | Product type | |
| notes | string | false | ||
| total_customs_value | Double | false | Declared value | |
| unit_of_measurement | string | false | SI is the International System of Units | |
| incoterm | string | true | Trade Terms: CFR, DAP, etc. | |
| currency | string | true | Currency. CNY is the default. | |
| packages | Array[Object] | true | Package info | |
| customs_items | Array[Object] | true | Export info | |
| customs_duties_payment | Object | false | Customs duty payment. The recipient is going to pay customs duty by default. | |
| shipping_cost_payment | Object | false | Shipping cost payment method | |
| customs_clearance | Object | false | Customs Clearance information | |
| invoice | Object | false | ||
| route_id | string | false | Route ID (Reauired for J&T International) | |
| total_actual_weight | Double | true | Weight | |
| packageInfos | height | Double | false | Height. Unit: centimeter |
| width | Double | false | Width. Unit: centimeter | |
| length | Double | false | Length. Unit: centimeter | |
| weight | Double | false | Weight. Unit: kilogram | |
| reference | string | false | Some notes about the package | |
| exportInfos | ||||
| net_weight | Double | false | Net weight. Unit: kilogram | |
| gross_weight | Double | false | Gross weight. Unit: kilogram | |
| country_code | string | true | Manufacturing country | |
| unit_price | Double | true | ||
| quantity | Integer | true | Quantity. 1 is the default. | |
| units | string | false | Counting unit (required). PCS if the default. | |
| contents_explanation | string | false | Description of the goods | |
| export_commodity_code | string | false | Export commodity code. It is recommended to fill in this for faster customs clearance. | |
| import_commodity_code | string | false | Import commodity code. It is recommended to fill in this for faster customs clearance. | |
| dutiesPaymentType | ||||
| paid_by | string | false | Payment method.DDU: the receiver is responsible for paying the duties. DDP: the sender is responsible for paying the duties | |
| account_id | string | false | Account | |
| freightPaymentType | ||||
| paid_by | string | false | Paid by: Shipper or Consignee. Shipper is going to make payment by default. | |
| account_id | string | false | Account | |
| customsClearance | ||||
| purpose | string | false | Export purpose | |
| isDocument | boolean | false | Is document? The default answer is ‘True’. | |
| invoiceInfo | ||||
| invoice_date | string | true | Date of invoice (yyyy-mm-dd) | |
| invoice_number | string | true | Invoice number | |
| invoice_type | string | false | Invoice number. The default is commercial invoice. | |
| title | string | true | Invoice title | |
| signature | string | true | Invoice signature (base64 string) | |
| pltEnable | boolean | false | Start paperless trading? Choose ‘True’ or ‘False’. | |
| Name | Data Type | Required | Note | ||
|---|---|---|---|---|---|
| status | string | true | Return status code | ||
| message | string | true | Return reports | ||
| data | |||||
| tracking_number | string | true | |||
| package_number | string | false | Package number | ||
| invoice | |||||
| base64_string | string | true | The base64 string of an invoice | ||
| type | string | true | File type | ||
| invoice_url | string | true | Short URL (valid in one month) | ||
| label | |||||
| base64_string | string | true | The base64 string of a label | ||
| type | string | true | File type | ||
| label_url | string | true | Short URL (valid in one month) | ||
| sub_numbers | string | false | Sub tracking number | ||
{
"code": 200,
"data": {
"tracking_number": "1254089060",
"label": {
"type": "pdf",
"base64_string": "base64_string==",
"label_url": "https://app.kd100.com/interShip/getFile?fileName=123.pdf"
},
"invoice": {
"type": "PDF",
"base64_string": "base64_string==",
"invoice_url": "https://app.kd100.com/interShip/getFile?fileName=456.pdf"
},
"package_number": "JD011100003656147766",
"sub_numbers": null
},
"message": "success",
}
| carrier Code | carrier | account_id | account_key | account_secret | account_name | code |
|---|---|---|---|---|---|---|
| dhl | DHL | partnerId | partnerSecret | partnerName | ||
| fedex | FEDEX | partnerId | partnerKey | partnerSecret | code | |
| jet | J&T International | Customer identification | Customer key | Customer company number | ||
| chinapost | Chinapost | partnerCode | signKey | |||
| baishiguoji | Best Express | partnerCode | partnerKey | |||
| disifang | 4PX | partnerId | ||||
| jdme | JD International Logistics | GatewayUser | operator | customerCode | ||
| ups | UPS | partnerId | ||||
| naqel | NAQEL | LoadTypeID | ClientID | Password | ||
| imile | iMile | customerId | api key | |||
| auspost | Australia Post | Account number | Key | Password |
| county | countycode |
|---|---|
| China | CN |
| Indonesian | ID |
| Portugal | PT |
| Danmark | DK |
| Luxembourg | LU |
| Croatia | HR |
| Ukraine | UA |
| Hungary | HU |
| The United States | US |
| Uruguay | UY |
| India | IN |
| Mexico | MX |
| Italy | IT |
| Malaysia | MY |
| Spain | ES |
| Argentina | AR |
| Brazil | BR |
| Chile | CL |
| Colombia | CO |
| Peru | PE |
| United Arab Emirates | AE |
| carrier(code) | Shipping_service |
|---|---|
| DHL(dhl) | |
| document-normal | |
| parcel-normal | |
| FEDEX(fedex) | |
| International First | |
| International Priority | |
| International Economy |
'', // Monthly statement or payment account
'account_name' => '', // The username of your monthly statement
'account_secret' => '', // User password
'account_key' => '', // Account parameter
'code' => '', // Account parameter
'carrier_id' => 'dhl', // Carrier code, must user lowercase letters
'ship_to' => array (
'name' => 'Cindy Martinez', //
'mobile_phone' => '(86)13512345678', //
'address1' => 'Apoquindo 4001, of. 501. Las Condes', // Receiving address
'address2' => 'Santiago, Chile', // Prefecture | Country: as a supplement to receiving address
'state_province' => '', // State | Province: as a supplement to receiving address
'company' => 'Lamaignere Chile S.A.', // Company name
'country_code' => 'CL', // Country ISO code. For example, CN stands for China and US stands for United States of America.
'city' => 'Santiago', //
'postal_code' => '7550000', //
'landline_phone' => '+56 (9) 76164365', // Phone number
'email' => '12344699@qq.com', // Email address
'tax_id' => '', //
'tax_type' => '', // Taxpayer type
'vat_number' => 'IOSS23249923', // VAT number; used in European countries, UK included.
'eori_number' => 'IOSS23249923', // EORI number: used for customs clearance in the European Union
'ioss_number' => 'IOSS23249923' // IOSS number
),
'ship_from' => array (
'name' => 'Kaka', //
'mobile_phone' => '13500000000', //
'address1' => 'Kingdee Software Park', // Receiving address
'address2' => 'Hi-tech Park,Nanshang District', // Prefecture | Country: as a supplement to receiving address
'state_province' => '', // State | Province: as a supplement to receiving address
'company' => 'QIAN HAI BAI DI', // Company name
'country_code' => 'CN', // Country ISO code. For example, CN stands for China and US stands for United States of America.
'city' => 'SHEN ZHEN', //
'postal_code' => '518057', //
'landline_phone' => '0755-5890123', // Phone number
'email' => '12344655@qq.com', // Email address
'tax_id' => '', //
'tax_type' => '', // Taxpayer type
'vat_number' => 'IOSS23249923', // VAT number; used in European countries, UK included.
'eori_number' => 'IOSS23249923', // EORI number: used for customs clearance in the European Union
'ioss_number' => 'IOSS23249923' // IOSS number
),
'contents_explanation' => "test don't ship", // Description of the goods
'shipping_service' => 'parcel-normal', // Product type
'notes' => 'just a test demo', //
'total_customs_value' => 10.00, // Declared value
'unit_of_measurement' => 'SI', // Trade Terms: CFR, DAP, etc.
'incoterm' => 'DAP', // The tracking number you want to query
'currency' => 'USD', // Currency. CNY is the default.
'packages' => array ( // Package info
array (
'height' => 11.00, // Height. Unit: centimeter
'width' => 20.00, // Width. Unit: centimeter
'length' => 10.00, // Length. Unit: centimeter
'weight' => 0.10, // Weight. Unit: kilogram
'reference' => 'just a user remark' // Some notes about the package
)
),
'customs_items' => array ( // Export info
array (
'net_weight' => 0.10, // Net weight. Unit: kilogram
'gross_weight' => 0.10, // Gross weight. Unit: kilogram
'country_code' => 'CN', // Manufacturing country
'unit_price' => 10.00, //
'quantity' => 1, // Quantity. 1 is the default.
'units' => 'PCS', // Counting unit (required). PCS if the default.
'contents_explanation' => 'test', // Description of the goods
'import_commodity_code' => '6109100021', // Export commodity code. It is recommended to fill in this for faster customs clearance.
'export_commodity_code' => '6109100021' // Import commodity code. It is recommended to fill in this for faster customs clearance.
)
),
'customs_duties_payment' => array ( // Customs duty payment. The recipient is going to pay customs duty by default.
'paid_by' => 'DDU', // Payment method.DDU: the receiver is responsible for paying the duties. DDP: the sender is responsible for paying the duties
'account_id' => '' // Account
),
'shipping_cost_payment' => array ( // Shipping cost payment method
'paid_by' => 'SHIPPER', // Paid by: Shipper or Consignee. Shipper is going to make payment by default.
'account_id' => '601470543' // Account
),
'customs_clearance' => array ( // Customs Clearance information
'purpose' => '', // Export purpose
'is_document' => false // Is document? The default answer is ��True��.
),
'invoice' => array (
'date' => '2021-08-12', // Date of invoice (yyyy-mm-dd)
'number' => '15462412', // Invoice number
'type' => '', // Invoice number. The default is commercial invoice.
'title' => 'test', // Invoice title
'signature' => 'base64 string or plain', // Invoice signature (base64 string)
'paperless_invoice' => true // Start paperless trading? Choose ��True�� or ��False��.
),
'route_id' => '9926933413', // Route ID (Reauired for J&T International)
'total_actual_weight' => 0.1 // Weight
);
// Request Json
$json = json_encode($param, JSON_UNESCAPED_UNICODE);
$signature = strtoupper(md5($json.$key.$secret));
$url = 'https://app.kd100.com/sendAssistant/order/apiCall'; // Create-a-shipping-label request address
echo 'request headers key: '.$key;
echo '
request headers signature: '.$signature;
echo '
request json: '.$json;
$headers = array (
'Content-Type:application/json',
'API-Key:'.$key,
'signature:'.$signature,
'Content-Length:'.strlen($json)
);
// Send post request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$result = curl_exec($ch);
$data = json_decode($result, true);
echo '
Return data:
';
echo print_r($data);
//echo var_dump($data);
echo '
';
?>