Chuyển tới nội dung chính

API Đơn hàng


Tạo đơn hàng

MethodPOST
URL/api/order/create-order

Body request

{
"address_id": 2,
"consignee_name": "sarenda mcguire",
"consignee_phone": "",
"consignee_address": "6105 W Elmwood Dr",
"consignee_address_other": "",
"consignee_country": "US",
"consignee_city": "Wildomar",
"consignee_postal_code": "57718",
"consignee_state_code": "SD",
"order_number": "DEV123456789",
"product_name": "Metal",
"product_price": 5.5,
"length": 1.93,
"width": 108,
"height": 1.9,
"weight": 1.1,
"service_code": "EPK",
"service_add": "",
"money_collection": 0,
"order_code_upstream_partner": "partner_of_partner"
}

Giải thích

No.Field NameData TypeDescription
1address_idLongMã kho hàng (3.1)
2consignee_nameStringHọ tên người nhận
3consignee_phoneStringSố điện thoại người nhận
4consignee_addressStringĐịa chỉ người nhận 1
5consignee_address_otherStringĐịa chỉ người nhận 2
6consignee_countryStringMã quốc gia (fix: US)
7consignee_cityStringTỉnh / thành phố (3.2)
8consignee_postal_codeString5 chữ số (người dùng nhập)
9consignee_state_codeStringState code (3.2)
10order_numberStringMã đơn hàng của đối tác
11product_nameStringNội dung hàng hóa
12product_priceDecimalGiá trị hàng hóa
13lengthDecimalChiều dài (cm)
14widthDecimalChiều rộng (cm)
15heightDecimalChiều cao (cm)
16weightDecimalTrọng lượng (gram)
17service_codeStringDịch vụ chính (liên hệ)
18service_addStringDịch vụ gia tăng
19money_collectionDecimalSố tiền thu hộ
20order_code_upstream_partnerStringMã đối tác của đối tác
thông tin

consignee_country hiện cố định là US. service_code cần liên hệ để lấy danh sách dịch vụ khả dụng.

Response

{
"error": false,
"ref": null,
"message": "Tạo đơn thành công",
"data": "DEV123456789"
}

Giải thích

STTTên trườngKiểu dữ liệuMô tả
1errorbooleanTrạng thái lỗi
2refStringMã tham chiếu giao dịch
3messageStringThông báo
4dataStringMã đơn hàng của BELL

Hủy đơn hàng

MethodPOST
URL/api/order/cancel-order

Payload request

No.Field NameData TypeDescription
1order_numberStringMã vận đơn của BELL

Response

{
"error": false,
"ref": null,
"message": "Thành công",
"data": null
}

In nhãn vận đơn

MethodGET
URL/api/order/print-order/{order_number}

Path request

No.Field NameData TypeDescription
1order_numberStringMã vận đơn của BELL

Response

{
"error": false,
"ref": null,
"message": "Thành công",
"data": {
"orderNumber": "BELL1202103548",
"tracking": "42080521921449037400250000264",
"labelFormat": "GIF",
"labelSize": "4x6",
"label": "tneDuLVwOxtZ5fOBHUuCYVF4JfsIPHmAPTmFzZF4RRsAXRtnrnGEarmEbvmEczmEd3mEeTpiAAAA7",
"labelUrl": "https://usps-tool.top/pdf/get?id=DEV123456789~64932"
}
}

Giải thích

No.Field NameData TypeDescription
1errorbooleanTrạng thái lỗi
2refStringMã tham chiếu
3messageStringThông báo
4data.orderNumberStringMã đơn hàng của BELL
5data.labelFormatStringLoại nhãn
6data.labelSizeStringKích thước nhãn
7data.labelStringNội dung nhãn (Base64)
8data.trackingStringMã tham chiếu / Tracking number
9data.labelUrlStringLabel dạng PDF (xem trực tuyến)

Track shipment

MethodGET
URL/api/order/tracking/{order_number}

Path request

No.Field NameData TypeDescription
1order_numberStringMã vận đơn của BELL

Response

{
"error": false,
"ref": null,
"message": "Thành công",
"data": [
{
"trackingNumber": "BELL2512171654532484",
"code": "12345678900",
"city": "City 0",
"stateCode": "State 0",
"zipCode": "Zip 0",
"countryCode": "Country 0",
"eventDate": "2025-12-18T03:57:04.896549Z",
"eventStatus": "LabelCreated 0"
},
{
"trackingNumber": "BELL2512171654532484",
"code": "12345678901",
"city": "City 1",
"stateCode": "State 1",
"zipCode": "Zip 1",
"countryCode": "Country 1",
"eventDate": "2025-12-18T03:57:04.896558Z",
"eventStatus": "LabelCreated 1"
}
]
}

Giải thích

No.Field NameData TypeDescription
1errorbooleanTrạng thái lỗi (false = thành công)
2refStringMã tham chiếu yêu cầu (có thể null)
3messageStringThông báo kết quả xử lý
4dataArrayDanh sách sự kiện tracking
5data[].trackingNumberStringMã vận đơn / tracking number
6data[].codeStringMã sự kiện hoặc mã tham chiếu nội bộ
7data[].cityStringThành phố phát sinh sự kiện
8data[].stateCodeStringMã bang / tỉnh
9data[].zipCodeStringMã bưu chính
10data[].countryCodeStringMã quốc gia (ISO-2)
11data[].eventDateStringThời gian xảy ra sự kiện (ISO 8601, UTC)
12data[].eventStatusStringTrạng thái / nội dung sự kiện tracking