1. Overview
The following conventions apply to all endpoints.
Method & URL
POST /api/order/<action>
| Parameter |
Description |
| action |
Endpoint name: rate / print / cancel / label / tracking / scan-form |
| Content-Type |
application/x-www-form-urlencoded and application/json are both supported |
Authentication
Request Header: Every request must carry the vendor-token header, whose value is the token field of the vendor (customer) table.
If the token is missing, invalid, or the vendor is disabled, the API returns code = 100 and you need to log in again.
| Header |
Required |
Description |
vendor-token |
Yes |
Vendor login token (the token field of the vendor table) |
Response Structure
{
"success": true, // true=success false=failure
"message": "Success message",
"msg": "Success message", // Same as message
"code": 200, // 200=success 400=failure 100=login required
"data": {} // Business data; empty array on failure
}
Status Codes
| code |
Meaning |
Description |
200 |
Success |
success = true, business data is in data |
400 |
Failure |
success = false, error message is in message / msg |
100 |
Login expired |
Token missing / vendor not found / disabled / session expired; please obtain a new token |
POST rate - Get Rate
URL: /api/order/rate · Description: Query shipping rates from available carriers. No database record is created and no charge is made.
Parameters
Key rules:
①shipping_code and shipping_service are optional — if omitted, rates for ALL available channels of the vendor are returned (multiple channels are quoted in parallel; a failure of one channel does not affect the others); if provided, only that channel is quoted.
â‘¡ When a channel is specified, both shipping_code and shipping_service must be passed together.
| Parameter |
Required |
Type |
Description |
shipping_code |
Optional |
string |
Channel code (e.g. iusps / fdx / ups / dhl / arm); omit to quote all channels |
shipping_service |
Optional |
string |
Channel service code (e.g. zdgj / fdxp / iups); must be passed with shipping_code |
reference |
Optional |
string |
Order reference number (only recorded during rate, uniqueness is not checked) |
ship_date |
Optional |
string |
Ship date in YYYY-MM-DD format; only supported by some channel services, and must be within the next 7 days. When empty the channel uses its default (some channels +2 days) |
is_signature |
Optional |
int |
Signature service 0/1, default 0 |
is_insurances |
Optional |
int |
Insurance 0/1, default 0 |
unit |
Optional |
int |
Unit system, default 1 (metric) |
currency |
Optional |
string |
Currency, default 1 (USD) |
Shipper address (pass the fields directly, or pass only vendor_address_id and the system loads the saved address) |
shipper_name … shipper_zipcode |
Optional |
string |
Shipper fields, see common parameter table |
vendor_address_id |
Optional |
int |
ID of a saved shipper address; takes priority when passed |
vendor_address_label |
Optional |
string |
User address label (address code / label of a saved shipper address); both this and vendor_address_id are optional and may be passed independently or together to specify a saved address, priority id > label |
| Recipient address (the following 4 fields are required) |
recipient_name |
Yes |
string |
Recipient name |
recipient_street1 |
Yes |
string |
Recipient address - street 1 |
recipient_city |
Yes |
string |
Recipient city |
recipient_country |
Yes |
string |
Recipient country (e.g. US) |
Other recipient_* |
Optional |
string |
See common parameter table |
| Package info (packages array format) |
packages |
Yes* |
array |
Array of packages, fields see package parameter table; recommended |
length/width/height/weight |
Yes* |
number |
pass the four dimension/weight fields directly |
weight_unit |
Yes* |
string |
Weight unit: lb / g / kg / oz (invalid value returns an error) |
length_unit |
Yes* |
string |
Length unit: in / cm / m (invalid value returns an error) |
Required constraints: at least one package must be provided (length/width/height/weight all required); the 4 recipient fields are required.
Request Example
{
"shipper_name": "John",
"shipper_street1": "123 Main St",
"shipper_city": "Los Angeles",
"shipper_state": "CA",
"shipper_country": "US",
"shipper_zipcode": "90001",
"recipient_name": "Jane",
"recipient_street1": "456 Oak Ave",
"recipient_city": "New York",
"recipient_state": "NY",
"recipient_country": "US",
"recipient_zipcode": "10001",
"packages": [
{
"name": "dress",
"length": 12,
"width": 10,
"height": 5,
"weight": 3.3,
"weight_unit": "lb",
"length_unit": "in"
}
]
}
Response Example (data is an array of channel quotes)
{
"success": true,
"message": "Price fetched successfully!",
"code": 200,
"data": [
{
"success": true,
"message": "success",
"fee": 15.05,
"zone": "zone8",
"billing_weight": 3.3069,
"weight_g": 1499,
"currency_id": 1,
"shipping_service": "zdgj",
"shipping_code": "iusps",
"carrier_name": "USPS",
"carrier_code": "usps",
"carrier_logo": "https://.../usps.png",
"content": null
},
{
"success": false,
"message": "This channel does not support shipping to the destination area, please choose another channel",
"shipping_service": "fdx",
"shipping_code": "iexp2",
"carrier_name": "FedEx",
"carrier_code": "fedex",
"carrier_logo": "https://.../fedex.png",
"content": null
}
]
}
| data[] field |
Type |
Description |
success |
bool |
Whether this channel quoted successfully; when false, message is the failure reason and the carrier fields are still returned |
message |
string |
success on success / failure reason |
fee |
number |
Final shipping fee (includes markup / surcharges) |
zone |
string |
Zone (e.g. zone8) |
billing_weight |
number |
Billing weight (lb) |
weight_g |
int |
Weight (grams) |
currency_id |
int |
Currency ID, default 1 (USD) |
shipping_service / shipping_code |
string |
Channel service code / Channel code |
carrier_name / carrier_code / carrier_logo |
string |
Carrier name / code / logo |
content |
null |
Order content placeholder (used when a channel combines order creation and rate), currently null |
POST print - Create Order / Print Label
URL: /api/order/print · Description: Validate balance → save order → create order at the channel → get label → deduct fee. Returns the order info and the label URL.
âš Important: print contains ALL parameters of rate (address / package / unit / extra services are identical),
and adds the following required parameters on top of rate: shipping_code, shipping_service.
Parameters (= all rate parameters + the following additions / required)
| Parameter |
Required |
Type |
Description |
shipping_code |
Yes |
string |
Channel code (optional in rate, required in print) |
shipping_service |
Yes |
string |
Channel service code (optional in rate, required in print) |
reference |
Optional |
string |
Order reference; an existing reference cannot be used again (returns "Reference already exists!") |
remark |
Optional |
string |
Order remark |
label_type |
Optional |
string |
Label type; only supported by some channels / interfaces, omitted means the channel default format is returned. Allowed values: PDF / ZPL / ZPL203DPI (any value outside this set returns a parameter error) |
| All other parameters (shipper / recipient / package / ship_date / unit / currency / is_signature / is_insurances /
vendor_address_id / vendor_address_label) are identical to rate with the same required rules. See the rate parameter table and common parameters. |
Order flow notes:
â‘ Before creating the order, the vendor balance + credit must be > 0 (otherwise "Insufficient vendor balance, please top up first!" is returned).
â‘¡ After the channel creates the order successfully: order status is set to printed + paid, balance is deducted, transaction detail and order price info are written (in one transaction).
â‘¢ When the channel does not return a label synchronously, the system polls get_label (up to 1200 seconds); on final failure the order is set to printed + unpaid and the request fails.
â‘£ On channel order failure the error message is recorded into the error-deal table; if an English error text is configured, the English text is returned.
Request Example (includes all rate parameters)
{
"shipping_code": "iusps",
"shipping_service": "zdgj",
"reference": "ORDER-20260921-001",
"remark": "please handle carefully",
"label_type": "PDF",
"ship_date": "2026-09-21",
"is_signature": 0,
"is_insurances": 0,
"shipper_name": "John",
"shipper_company": "Piggyship",
"shipper_telphone": "+1 213 555 0100",
"shipper_street1": "123 Main St",
"shipper_city": "Los Angeles",
"shipper_state": "CA",
"shipper_country": "US",
"shipper_zipcode": "90001",
"recipient_name": "Jane",
"recipient_company": "ABC Inc",
"recipient_telphone": "+1 212 555 0199",
"recipient_street1": "456 Oak Ave",
"recipient_city": "New York",
"recipient_state": "NY",
"recipient_country": "US",
"recipient_zipcode": "10001",
"packages": [
{
"name": "dress",
"length": 12,
"width": 10,
"height": 5,
"weight": 3.3,
"weight_unit": "lb",
"length_unit": "in"
}
]
}
Response Example (data is the order result)
{
"success": true,
"message": "Order created successfully!",
"code": 200,
"data": {
"success": true,
"message": "success",
"fee": 15.05,
"zone": "zone8",
"billing_weight": 3.3069,
"currency_id": 1,
"order_id": 1024,
"label": "https://cdn.xxx.com/label/123_1699999999.pdf",
"tracking": "20260921153000_ab12cd",
"ext_tracking": "9212345678901234567890",
"fee_detail": [{"code": "shipping_fee","name": "Shipping Fee","amount": 15.05}]
}
}
| data field |
Type |
Description |
order_id |
int |
System order ID |
fee / zone / billing_weight / currency_id |
- |
Fee / Zone / Billing weight / Currency |
label |
string |
Label PDF URL (Qiniu CDN), can be downloaded and printed directly |
tracking |
string |
System order number (generated as timestamp + random string), used as the order receipt number |
ext_tracking |
string |
Channel tracking/label number (used to query tracking) |
fee_detail |
array |
List of fee details |
POST cancel - Cancel Order
URL: /api/order/cancel · Description: Cancel an order and refund the balance (supports frozen-period refunds and processing-fee deduction).
Parameters
| Parameter |
Required |
Type |
Description |
order_id |
Yes |
int |
Order ID (only the current vendor's own orders can be operated) |
Cancel rules:
â‘ A completed order cannot be canceled; an already canceled order cannot be canceled again.
â‘¡ When the channel has frozen_day configured, the refund goes to the frozen balance; otherwise it goes directly to the available balance.
â‘¢ The refund deducts the service's refund_price processing fee ratio.
â‘£ Orders in pending (status=0) state do not call the channel cancel API; only the local refund is performed.
Request Example
{
"order_id": 1024
}
Response Example
{
"success": true,
"message": "Order canceled successfully!",
"msg": "Order canceled successfully!",
"code": 200,
"data": []
}
POST label - Get Label
URL: /api/order/label · Description: Get the label of an order (if the label was already generated synchronously when creating the order, you can directly use the label returned by print).
Parameters
| Parameter |
Required |
Type |
Description |
order_id |
Yes |
int |
Order ID (only the current vendor's own orders can be operated) |
Request Example
{
"order_id": 1024
}
Response Example (data is the unified channel return structure)
{
"success": true,
"message": "Label fetched successfully!",
"code": 200,
"data": {
"success": true,
"currency_id": 1,
"label": "https://cdn.xxx.com/label/123_1699999999.pdf",
"tracking": "9212345678901234567890",
"sub_labels": []
}
}
POST tracking - Get Tracking
URL: /api/order/tracking · Description: Get the logistics tracking of an order (calls the channel's get_tracking).
Parameters
| Parameter |
Required |
Type |
Description |
order_id |
Yes |
int |
Order ID (only the current vendor's own orders can be operated) |
Request Example
{
"order_id": 1024
}
Response Example (data is the channel's unified structure)
{
"success": true,
"message": "Tracking retrieved successfully!",
"code": 200,
"data": {
"trackingNumber": "9212345678901234567890",
"status": "delivered",
"statusCategory": "delivered",
"serviceTypeCode": "144",
"originCity": "LOS ANGELES",
"originState": "CA",
"originZIP": "90001",
"destinationCity": "NEW YORK",
"destinationState": "NY",
"destinationZIP": "10001",
"trackingEvents": [{
"eventType": "Delivered, Left with Individual",
"eventTimestamp": "2026-10-01T11:04:19",
"eventCountry": "US",
"eventCity": "DES PLAINES",
"eventState": "IL",
"eventZIP": "60016",
"location": "DES PLAINES,IL,60016",
"timeZone": "GMT-05:00",
"eventCode": "01",
"GMTTimestamp": "2026-10-01T16:04:19Z"
}]
}
}
data Field Reference
| data field |
Type |
Description |
trackingNumber |
string |
Tracking number |
status / statusCategory |
string |
Tracking status / channel status category (e.g. delivered) |
serviceTypeCode |
string |
STC code |
origin* / destination* |
string |
Origin / destination city, state code, ZIP |
trackingEvents |
array |
List of tracking events; each item has eventType / eventTimestamp / eventCountry / eventCity / eventState / eventZIP / location / timeZone / eventCode / GMTTimestamp |
8. Common Parameters (Address / Package) & Error Messages
rate and print share the following address and package parameters.
Shipper address parameters (shipper_*, optional; may pass vendor_address_id / vendor_address_label instead)
| Parameter |
Description |
shipper_name |
Shipper name |
shipper_company |
Shipper company |
shipper_telphone |
Contact phone |
shipper_email |
Email |
shipper_country |
Country (e.g. US) |
shipper_state |
State / Province |
shipper_city |
City |
shipper_street1 / shipper_street2 |
Street address 1 / 2 |
shipper_zipcode |
Postal code / ZIP |
Recipient address parameters (recipient_*)
| Parameter |
Required |
Description |
recipient_name |
Yes |
Recipient name |
recipient_street1 |
Yes |
Street address 1 |
recipient_city |
Yes |
City |
recipient_country |
Yes |
Country (e.g. US) |
recipient_company |
Optional |
Recipient company |
recipient_street2 |
Optional |
Street address 2 |
recipient_zipcode |
Optional |
Postal code / ZIP |
recipient_state |
Optional |
State / Province |
recipient_email |
Optional |
Email |
recipient_telphone |
Optional |
Contact phone |
Package parameters (packages array, shared by rate/print)
| Parameter |
Required |
Description |
packages[i].name |
Optional |
Package name / item name |
packages[i].length |
Yes |
Length |
packages[i].width |
Yes |
Width |
packages[i].height |
Yes |
Height |
packages[i].weight |
Yes |
Weight |
packages[i].weight_unit |
Yes |
Weight unit: lb/g/kg/oz |
packages[i].length_unit |
Yes |
Length unit: in/cm/m |
packages[i].unit |
Optional |
Unit system, default 1 (metric) |
Error Messages Quick Reference (code=400, returned in message/msg)
| Endpoint |
Error Message |
Description |
| Common |
Please provide the vendor ID! |
Vendor ID is missing |
| Common |
Please provide the package info! |
No package info was passed |
| Common |
Package N: dimensions and weight are incomplete! |
Package N has incomplete dimensions/weight |
| Common |
Package N: invalid weight unit, only lb/g/kg/oz are supported! |
Package N has an invalid weight unit |
| Common |
Package N: invalid length unit, only in/cm/m are supported! |
Package N has an invalid length unit |
| Common |
Invalid weight unit / Invalid length unit, ... |
Invalid unit in the legacy single-package format |
| Common |
Please provide the complete recipient address! |
Recipient address is incomplete (name/street1/city/country) |
| print |
Please provide the shipping code! |
Channel code is missing for order creation |
| print |
Please provide the shipping service code! |
Channel service code is missing for order creation |
| print |
Insufficient vendor balance, please top up first! |
Balance + credit ≤ 0, please top up first |
| print |
Reference already exists! |
Reference is duplicated; the order cannot be created again |
| print |
Carrier not found |
Carrier does not exist |
| print |
Label fetch timeout: waiting 1200s, ... |
Label fetch timed out |
| cancel |
Please provide the order ID! |
Order ID is missing |
| cancel |
Order not found! |
Order does not exist, or is not owned by the current vendor (ownership check failure returns the same message) |
| cancel |
Order already completed, cannot be canceled! |
The order is completed and cannot be canceled |
| cancel |
Order already canceled, do not repeat! |
The order is already canceled; do not repeat the operation |
| cancel |
Service not found for this order! |
The service for this order does not exist |
| label |
Shipping not found for this order! |
The channel for this order does not exist |
| label |
Label data is empty / Response missing base64code |
The channel did not return label data |
| Common |
Channel passthrough errors (msgEn/Msg) |
Error messages returned by the channel API are returned as-is |