stable本次发布有变化全部展示
来自 Shopee 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 v2.first_mile.bind_first_mile_tracking_number
Use this api to bind first mile tracking number.
§2 Overview
Overview
| Field | Value |
|---|---|
| Module | FirstMile |
| API type | Shop |
| HTTP method | POST |
| Path | /api/v2/first_mile/bind_first_mile_tracking_number |
| Production URL | https://partner.shopeemobile.com/api/v2/first_mile/bind_first_mile_tracking_number |
| Sandbox URL | https://partner.test-stable.shopeemobile.com/api/v2/first_mile/bind_first_mile_tracking_number |
| Rate limit | [0, 0, 0] |
| Permission | ERP System; Seller In House System; Order Management; Swam ERP |
§3 Request parameters
Request parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| first_mile_tracking_number | string | Yes | CNF731738838434210105 | If using "pickup" or "self_deliver" as the shipment method the "first_mile_tracking_number" field should pass the value generated from v2.first_mile.generate_first_mile_tracking_number.; If using "dropoff" as the shipment method the "first_mile_tracking_number" field should pass the tracking number provide by the supplier. |
| shipment_method | string | Yes | pickup | The shipment method for bound orders, should be pickup, dropoff or self_deliver. |
| region | string | Yes | cn | Use this field to specify the region you want to ship parcel.; Available value: cn,kr.; Please fill in the field according to the region of the Merchant to which the shop belongs. |
| logistics_channel_id | int32 | Yes | 813 | The identity of first-mile logistic channel.; If you using "dropoff" or "pickup" as shipment method, please call v2.first_mile.get_channel_list to get the logsitc_channel_id then fill it.; If you using "self_deliver"as shipment method then the logistics_channel_id should be "null". |
| volume | float | No | 1.0 | The volume of the parcel. |
| weight | float | No | 2.0 | The weight of the parcel. |
| width | float | No | 3.0 | The width of the parcel. |
| length | float | No | 4.0 | The length of the parcel. |
| height | float | No | 5.0 | The height of the parcel. |
| order_list | object[] | Yes | The set of ordersn. You can specify up to 50 ordersns in this call.one fm_tn maximum number of total bind orders is 10000. | |
| order_list.order_sn | string | Yes | 201229TVRKVB8W | Shopee's unique identifier for an order. |
| order_list.package_number | string | No | Shopee's unique identifier for the package under an order. You should't fill the field with empty string when there is't a package number. | |
| warehouse_id | string | No | ECP03 | The identity of transit warehouse address. Retrieved from v2.first_mile.get_transit_warehouse_list.; Note: When the first-mile delivery mode is "Drop Off", this field is expected to be a required field. However, to avoid affecting your existing services, this field will be temporarily optional until April 30, 2026. Please complete the integration before then to avoid any impact on your services if it is changed to a required field later. |
| warehouse_type | int32 | No | 0 | Warehouse type. Retrieved from v2.first_mile.get_transit_warehouse_list. 0 = normal warehouse 1 = vendor warehouse; Note: When the first-mile delivery mode is "Drop Off", this field is expected to be a required field. However, to avoid affecting your existing services, this field will be temporarily optional until April 30, 2026. Please complete the integration before then to avoid any impact on your services if it is changed to a required field later. |
§4 Response parameters
Response parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| request_id | string | uyavvIOqyJUSgWCNaXkCSHigqrFgHpuJ | The identifier for an API request for error tracking. | |
| error | string | firstmile.batch_api_all_failed | Indicate error type if hit error. Empty if no error happened. | |
| message | string | All failed, please check result_list for detail | Indicate error details if hit error. Empty if no error happened. | |
| warning | object[] | Indicate warning message you should take care. | ||
| warning.order_sn | string | 201229TVRKVB8W | Shopee's unique identifier for an order. | |
| response | object | Detail informations you are querying. | ||
| response.first_mile_tracking_number | string | CNF731738838434210105 | The first mile tracking number | |
| response.order_list | object[] | The list of orders. | ||
| response.order_list.order_sn | string | 201229TVRKVB80 | Shopee's unique identifier for an order. | |
| response.order_list.package_number | string | Shopee's unique identifier for the package under an order. | ||
| response.order_list.fail_error | string | firstmile.order_not_exist | Indicate error type if one element hit error. | |
| response.order_list.fail_message | string | Order is not exist. | Indicate error details if one element hit error. |
§5 Common parameters
Common parameters
| Name | Type | Required | Sample | Description |
|---|---|---|---|---|
| partner_id | int | 1 | Partner ID is assigned upon registration is successful. Required for all requests. | |
| timestamp | timestamp | 1610000000 | This is to indicate the timestamp of the request. Required for all requests. Expires in 5 minutes. | |
| access_token | string | c09222e3fc40ffb25fc947f738b1abf1 | The token for API access, using to identify your permission to the api. Valid for multiple use and expires in 4 hours. | |
| shop_id | int | 600000 | Shopee's unique identifier for a shop. Required param for most APIs. | |
| 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 |
§6 Request samples
Request samples
§7 Payload
Payload
{
"first_mile_tracking_number":"CNF081531393648221122",
"order_list":[
{
"order_sn":"221119GAB7FW8H",
"package_number":""
},
{
"order_sn":"221119GF37711Y",
"package_number":""
},
{
"order_sn":"221120GWUAE4GF",
"package_number":""
},
{
"order_sn":"221120H7XD3PMA",
"package_number":""
},
{
"order_sn":"221120HRKXVTEB",
"package_number":""
},
{
"order_sn":"221120J5UN7JMX",
"package_number":""
},
{
"order_sn":"221120J9QAVWFH",
"package_number":""
},
{
"order_sn":"221120JHJ7WC58",
"package_number":""
},
{
"order_sn":"221120JG2K19J2",
"package_number":""
},
{
"order_sn":"221120JPUNFCXP",
"package_number":""
},
{
"order_sn":"221120JT3XGS1J",
"package_number":""
},
{
"order_sn":"221120K01C37DU",
"package_number":""
},
{
"order_sn":"221120JXSE2F4X",
"package_number":""
},
{
"order_sn":"221121K68M6GV2",
"package_number":""
}
],
"shipment_method":"pickup",
"logistics_channel_id":813,
"region":"CN",
"weight":0,
"volume":0,
"length":0,
"width":0,
"height":0
}
§8 Response sample
Response sample
§9 JSON
JSON
{
"error":"",
"message":"",
"response":{
"first_mile_tracking_number":"CNF081531393648221122",
"order_list":[
{
"order_sn":"221120K01C37DU"
},
{
"order_sn":"221120H7XD3PMA"
},
{
"order_sn":"221120J5UN7JMX"
},
{
"order_sn":"221120JG2K19J2"
},
{
"order_sn":"221120JT3XGS1J"
},
{
"order_sn":"221119GAB7FW8H"
},
{
"order_sn":"221120HRKXVTEB"
},
{
"order_sn":"221121K68M6GV2"
},
{
"order_sn":"221119GF37711Y"
},
{
"order_sn":"221120J9QAVWFH"
},
{
"order_sn":"221120JPUNFCXP"
},
{
"order_sn":"221120JXSE2F4X"
},
{
"order_sn":"221120GWUAE4GF"
},
{
"order_sn":"221120JHJ7WC58"
}
]
},
"request_id":"1267bbc898d7703d143a065472245920"
}
§10 Error example
Error example
§11 JSON
JSON
{
"error":"firstmile.batch_api_all_failed",
"message":"Failed, please check result_list for more details.",
"response":{
"first_mile_tracking_number":"CNF848103230971221106",
"order_list":[
{
"order_sn":"221031S8JHUTSD",
"fail_message":"the logistic status is not supported",
"fail_error":"firstmile.business_error"
},
{
"order_sn":"2211047CG145H7",
"fail_message":"the logistic status is not supported",
"fail_error":"firstmile.business_error"
},
{
"order_sn":"2211022WSUYMDQ",
"fail_message":"the logistic status is not supported",
"fail_error":"firstmile.business_error"
}
]
},
"request_id":"b0399ebf4c5f00827d372ad3f7388320"
}
§12 Errors
Errors
| Error | Description | Solution |
|---|---|---|
| error_param | Dropoff FM tracking code must be between 6 to 40 characters | |
| error_param | FM code cannot be empty. | |
| error_param | Format wrong. FM tracking number only contains character and number. | |
| error_param | Pickup FM tracking code must start with "CNF" or "KRF" + 18 numbers | |
| error_param | Self Deliver FM tracking code must start with "CNF" or "KRF" + 18 numbers | |
| firstmile.business_error | There is common business error | |
| firstmile.error | One FM code cannot be predeclared with different shipping methods | |
| firstmile.error | The SLS TN does not belong to FM enabled TWS. | |
| firstmile.error | The SLS TN is tied to another FM code | |
| firstmile.error | The FM code does not exist | |
| firstmile.error | System error (TWS fail), please contact Shopee | |
| firstmile.error | The logistics status is not supported for binding | |
| firstmile.error | The SLS TN does not exist | |
| firstmile.error | The SLS TN is not a CB TN | |
| firstmile.error | The FM status is incorrect. | |
| firstmile.error | System error, please try again later/ contact Shopee | |
| firstmile.error | You used a Delivered FM code, please use a new FM code. | |
| firstmile.error | Your predeclared order creation time is later than pick up time, please use a new FM code. | |
| firstmile.error | The shipping method and logistics id are not matched | |
| firstmile.error | System error, please contact Shopee | |
| firstmile.error | FM Code WHSID can only bind SLS TN with the same WHSID | |
| error_not_found | Wrong parameters, detail: {msg}. | |
| error_permission | Sorry you don't have the permission, detail: {msg}. | |
| firstmile.area_not_support | Area is invalid.Now we only support area in {area}. | |
| firstmile.batch_api_all_failed | Failed, please check result_list for more details. | |
| firstmile.system_error | System error. Please try again later. | |
| firstmile.param_duplication | Duplicate order_sn {order_sn} or package_number: {package_number}. | |
| firstmile.invalid_order_status | The status of order(order_sn: {order_sn}) is invalid. Please check the order status. | |
| firstmile.invalid_package | Package is not exist. | |
| firstmile.order_has_been_split | The order(order_sn: {order_sn}) has been split | |
| firstmile.order_not_exist | Order is not exist. | |
| firstmile.package_has_bind | Package (order_sn: {order_sn}, package_number: {package_number}) has been bind to first mile code. | |
| firstmile.shipment_auth | The shop has no permission for the first mile shipment method: {method}. | |
| firstmile.shipment_pre_declare_permission | The shop has no permission for first mile pre declare. | |
| firstmile.wrong_shipment_method | Shipment method is invalid. Please check the shipment method. | |
| error_network | Inner http call failed | |
| error_data | parse data failed | |
| error_data | data not exist | |
| error_param | parameter invalid | |
| error_param | The information you queried is not found. | |
| error_param | Wrong parameters, detail: {msg}. | |
| error_server | Something wrong. Please try later. | |
| error_shop | shopid is invalid | |
| error_param | request not from gateway |
§13 Common errors
Common errors
| Error | Description | Solution |
|---|---|---|
| error_auth | partner_id is invalid | |
| error_auth | The App is deleted, and you'll be unable to make any API call. | |
| error_auth | App developer’s permissions for authorizations have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details. | |
| error_param | There is no partner_id in query. | |
| error_param | Invalid partner_id. | |
| error_param | no timestamp | |
| error_param | Invalid timestamp | |
| error_param | There is no sign in query. | |
| error_sign | Wrong sign. | |
| invalid_partner_id | Invalid partner_id, please have a check. | |
| error_auth | No permission to current api. | |
| error_api_call_restricted | The App permission for api call have been restricted. If you’re a seller, contact the developer for more information. If you’re the developer, refer to the Open Platform Console for details. | |
| api_suspended | The API is offline. Please call v2 API instead. | |
| error_limit | The total API call number made by your APP has reached the daily API call limit, please try again after 00: 00 (UTC+08:00) | |
| error_rate_limit | Too many requests. You have reached the rate limit. Please try again later. | |
| source_ip_undeclared | Request Source IP ({ip}) is undeclared. Please declare all your IP addresses in the Shopee Open Platform Console > App list > IP Address Whitelist | |
| error_param | Permission denied. This API is currently offline or the request path is incorrect. | |
| error_param | Partner_id is invalid, should be an integer between 0 and 4294967295. | |
| error_param | no timestamp. | |
| error_param | Timestamp is invalid, should be an integer between 0 and 4294967295. | |
| error_param | Timestamp is expired. | |
| error_partner_key_expired | Your API partner key has expired, please reset the Live API Partner Key in Console to get a new valid partner key to call open api. | |
| error_api_permission | This app type has no permission to this API. | |
| error_param | There is no access_token in query. | |
| error_auth | Invalid access_token. | |
| error_auth | Invalid partner_id or shopid. | |
| shop_no_linked | Partner and shop has no linked. | |
| shop_banned | The shop account has been banned. Permissions for shop authorization and API calls have been suspended until the shop account is restored. | |
| invalid_acceess_token | Invalid access_token, please have a check. | |
| partner_shop_no_link | Invalid partner_id or shop_id, please have a check. | |
| error_ashop_api_permission | The shop is Affiliate shop has no permission to call this API. | |
| error_kyc_auth | No permission. Please inform the seller to complete the Seller Registration on Shopee Seller Center first, then this shop can call for this API. | |
| error_auth | System error, please try again later. | |
| error_param | There is no shop_id in query. | |
| error_param | shop_id is invalid, should be an integer between 0 and 4294967295. |
§14 Update log
Update log
| Date | Change |
|---|---|
| 2026-03-20 | Add warehouse_id and warehouse_type request parameter |
| 2024-08-27 | update the description of the request field "region" |
| 2024-06-06 | update first_mile_tracking_number field description If using self_deliver, you must also pass the first_mile_tracking_number value generated from v2.first_mile.generate_first_mile_tracking_number. |
| 2024-04-25 | update the description of first_mile_tracking_number |
| 2023-03-28 | update the description of logistic_channel_id |
