v2.first_mile.generate_and_bind_first_mile_tracking_number
POST /api/v2/first_mile/generate_and_bind_first_mile_tracking_number
Dùng API này để tạo số theo dõi chặng đầu cho phương thức giao hàng qua đơn vị vận chuyển.
Đường dẫn Endpoint
URL: https://partner.shopeemobile.com/api/v2/first_mile/generate_and_bind_first_mile_tracking_number
Tham số chung
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| partner_id | int | 1 | ID đối tác được cấp sau khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu. |
| timestamp | timestamp | 1610000000 | Dùng để xác định thời điểm của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút. |
| access_token | string | c09222e3fc40ffb25fc947f738b1abf1 | Token dùng để truy cập API, xác định quyền của bạn đối với API. Có thể dùng nhiều lần và hết hạn sau 4 giờ. |
| shop_id | int | 600000 | Mã định danh duy nhất của Shopee cho một gian hàng. Tham số bắt buộc cho hầu hết các API. |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature generated by partner_id, api path, timestamp, access_token, shop_id and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2 |
Tham số Request
| Tên | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|
| shipment_method | string | True | courier_delivery | The shipment method for generate and bind orders. Available value: courier_delivery. |
| region | string | False | CN | Use this field to specify the region you want to ship parcel. Available value: CN. |
| order_list | object[] | True | The list of order_sn. You can specify up to 50 order_sns in this call. One fm_tn maximum number of total bind orders is 10000. | |
| order_sn | string | True | 2410106R7TSAJR | Shopee's unique identifier for an order. |
| package_number | string | False | Shopee's unique identifier for the package under an order. You should fill the field with empty string when there isn't a package number. | |
| courier_delivery_info | object | True | The set of information you need to generate FM tracking number and bind orders. | |
| address_id | int64 | True | 11222 | The identity of address. Retrieved from v2.logistics.get_address_list, address_type need to be FIRST_MILE_PICKUP_ADDRESS. |
| warehouse_id | string | True | ECP04 | The identity of transit warehouse address. Retrieved from v2.first_mile.get_transit_warehouse_list. |
| logistics_product_id | int64 | True | 1010004 | The definition of logistics product ID: 1010003 (kuaidi100 to C) - seller book courier pickup and pay offline 1010004 (kuaidi100 prepaid(MP)) - seller can use prepaid account to place courier order, so prepaid_account_id is required |
| prepaid_account_id | int64 | False | 21 | ID of prepaid account. Retrieved from v2.merchant.get_merchant_prepaid_account_list. |
| courier_service_id | string | True | LCN70002 | The identity of courier service. Retrieved from v2.first_mile.get_courier_delivery_channel_list. |
Tham số Response
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| error | string | Cho biết loại lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi. | |
| message | string | Cho biết chi tiết lỗi nếu xảy ra lỗi. Rỗng nếu không có lỗi. | |
| request_id | string | Mã định danh cho yêu cầu API, dùng để theo dõi lỗi. | |
| response | object | ||
| binding_id | string | DCN249601021852HU | Binding ID |
| success_list | object[] | ||
| order_sn | string | 2410106R7TSAJR | Shopee's unique identifier for an order. |
| package_number | string | Shopee's unique identifier for the package under an order. | |
| fail_list | object[] | ||
| order_sn | string | 2004239MRBBFPJ | Shopee's unique identifier for an order. |
| package_number | string | Shopee's unique identifier for the package under an order. | |
| fail_error | string | firstmile.package_has_bind | Cho biết loại lỗi nếu một phần tử gặp lỗi. |
| fail_message | string | Package (order_sn: 2004239MRBBFPJ, package_number: ) has been bind to first mile code. | Cho biết chi tiết lỗi nếu một phần tử gặp lỗi. |