API Đơn hàng
Tạo đơn hàng
| Method | POST |
|---|---|
| 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 Name | Data Type | Description |
|---|---|---|---|
| 1 | address_id | Long | Mã kho hàng (3.1) |
| 2 | consignee_name | String | Họ tên người nhận |
| 3 | consignee_phone | String | Số điện thoại người nhận |
| 4 | consignee_address | String | Địa chỉ người nhận 1 |
| 5 | consignee_address_other | String | Địa chỉ người nhận 2 |
| 6 | consignee_country | String | Mã quốc gia (fix: US) |
| 7 | consignee_city | String | Tỉnh / thành phố (3.2) |
| 8 | consignee_postal_code | String | 5 chữ số (người dùng nhập) |
| 9 | consignee_state_code | String | State code (3.2) |
| 10 | order_number | String | Mã đơn hàng của đối tác |
| 11 | product_name | String | Nội dung hàng hóa |
| 12 | product_price | Decimal | Giá trị hàng hóa |
| 13 | length | Decimal | Chiều dài (cm) |
| 14 | width | Decimal | Chiều rộng (cm) |
| 15 | height | Decimal | Chiều cao (cm) |
| 16 | weight | Decimal | Trọng lượng (gram) |
| 17 | service_code | String | Dịch vụ chính (liên hệ) |
| 18 | service_add | String | Dịch vụ gia tăng |
| 19 | money_collection | Decimal | Số tiền thu hộ |
| 20 | order_code_upstream_partner | String | Mã đố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
| STT | Tên trường | Kiểu dữ liệu | Mô tả |
|---|---|---|---|
| 1 | error | boolean | Trạng thái lỗi |
| 2 | ref | String | Mã tham chiếu giao dịch |
| 3 | message | String | Thông báo |
| 4 | data | String | Mã đơn hàng của BELL |
Hủy đơn hàng
| Method | POST |
|---|---|
| URL | /api/order/cancel-order |
Payload request
| No. | Field Name | Data Type | Description |
|---|---|---|---|
| 1 | order_number | String | Mã vận đơn của BELL |
Response
{
"error": false,
"ref": null,
"message": "Thành công",
"data": null
}
In nhãn vận đơn
| Method | GET |
|---|---|
| URL | /api/order/print-order/{order_number} |
Path request
| No. | Field Name | Data Type | Description |
|---|---|---|---|
| 1 | order_number | String | Mã 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 Name | Data Type | Description |
|---|---|---|---|
| 1 | error | boolean | Trạng thái lỗi |
| 2 | ref | String | Mã tham chiếu |
| 3 | message | String | Thông báo |
| 4 | data.orderNumber | String | Mã đơn hàng của BELL |
| 5 | data.labelFormat | String | Loại nhãn |
| 6 | data.labelSize | String | Kích thước nhãn |
| 7 | data.label | String | Nội dung nhãn (Base64) |
| 8 | data.tracking | String | Mã tham chiếu / Tracking number |
| 9 | data.labelUrl | String | Label dạng PDF (xem trực tuyến) |
Track shipment
| Method | GET |
|---|---|
| URL | /api/order/tracking/{order_number} |
Path request
| No. | Field Name | Data Type | Description |
|---|---|---|---|
| 1 | order_number | String | Mã 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 Name | Data Type | Description |
|---|---|---|---|
| 1 | error | boolean | Trạng thái lỗi (false = thành công) |
| 2 | ref | String | Mã tham chiếu yêu cầu (có thể null) |
| 3 | message | String | Thông báo kết quả xử lý |
| 4 | data | Array | Danh sách sự kiện tracking |
| 5 | data[].trackingNumber | String | Mã vận đơn / tracking number |
| 6 | data[].code | String | Mã sự kiện hoặc mã tham chiếu nội bộ |
| 7 | data[].city | String | Thành phố phát sinh sự kiện |
| 8 | data[].stateCode | String | Mã bang / tỉnh |
| 9 | data[].zipCode | String | Mã bưu chính |
| 10 | data[].countryCode | String | Mã quốc gia (ISO-2) |
| 11 | data[].eventDate | String | Thời gian xảy ra sự kiện (ISO 8601, UTC) |
| 12 | data[].eventStatus | String | Trạng thái / nội dung sự kiện tracking |