来自 TikTok Shop 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 Path: /fulfillment/202309/packages/{package_id}/shipping_documents
#§2 Method: [GET]
#§3 Function Description
For orders shipped by TikTok Shop, this API retrieves the URL of shipping documents (shipping label and packing slip) for a package specified by the package ID. This API is only applicable to "TikTok Shipping" orders. To obtain the shipping documents URL via this API, first call "Ship Package" to ship the corresponding package.
§4 Common Parameters
For common parameters, refer to How to call TikTok Shop APIs - Common Parameters
| Properties | Location | Type | Require | Sample | Properties description |
|---|---|---|---|---|---|
| shop_cipher | query | string | Y | GCP_XF90igAAAABh00qsWgtvOiGFNqyubMt3 | Use this property to pass shop information in requesting the API. Failure in passing the correct value when requesting the API for cross-border shops will return incorrect response. |
| Get by API Get Authorization Shop | |||||
| content-type | header | string | Y | application/json | Allowed type: application/json |
§5 Request Path Parameters
| Properties | Type | Require | Sample | Properties description |
|---|---|---|---|---|
| package_id | string | Y | 5433567853345 | TikTok Shop package ID. |
§6 Request Query Parameters
| Properties | Type | Require | Sample | Properties description |
|---|---|---|---|---|
| app_key | string | Y | 38abcd | Every single app will have a unique key. Please use the specific key assigned to your app. |
| sign | string | Y | 5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c | Signature generated by gen algorithm. When you send API requests to TTS, you must sign them so that TTS can identify the senders. |
| timestamp | int | Y | 1623812664 | Unix timestamp GMT (UTC+00:00). This timestamp is used across all API requests. Developers can use this convert to local time. |
| document_type | string | Y | SHIPPING_LABEL | Available document types: |
SHIPPING_LABEL: Returns the shipping label in PDF format by default.PACKING_SLIP: Returns the packing slip in PDF format by default.SHIPPING_LABEL_AND_PACKING_SLIP: Returns both the shipping label and the packing slip for the package, both in PDF format by default.SHIPPING_LABEL_PICTURE: Returns the shipping label in PNG format.HAZMAT_LABEL: Returns the hazmat label in PDF format by default. You must only use this value when there are hazmat items in the package. When you use the value,document_sizeis fixed to A4, and you don't need to specifydocument_size.INVOICE_LABEL: For Brazil market only, document_size is fixed to A6, and you don't need to specifydocument_size. Returns the invoice label in PDF format by default | document_size |string |N |A6 |Use this field to specify the size of the document to obtain. This parameter is only applicable to shipping labels, picking slips, and packing slips that are in the PDF format. It is not applicable for hazmat labels as these are fixed to A4. If you specifySHIPPING_LABEL_PICTUREfor thedocument_type, any value specified in thedocument_sizewill be ignored.
Possible values:
A6(Default)A5| document_format |string |N |PDF |The format of the shipping document. Possible values:- PDF (Default)
- ZPL (Only for BR and MX market)
Note: Not applicable for SHIPPING_LABEL_PICTURE document type. |
shipping_period |string |N |DEFAULT |Obtain shipping labels from designated last-mile delivery providers for cross-border scenarios.
Possible values:
- DEFAULT (Default)
- LAST_MILE (Only cross-border services under the 4PL model with the business solution of 3PL for main transport & customs clearance + 4PL for last-mile delivery will return the last-mile shipping label; calls from all other scenarios will be invalid. ) |
§7 Request Sample
Query
https://open-api.tiktokglobalshop.com/fulfillment/202309/packages/5433567853345/shipping_documents?app_key=123abc&sign=5361235029d141222525e303d742f9e38aea052d10896d3197ab9d6233730b8c×tamp=1625484268&shop_cipher=ROW_RHkDDABBAAB8tKAVoAqsMTjsQZFLyNfY&document_type=SHIPPING_LABEL&document_size=A6&document_format=PDF&shipping_period=DEFAULT
§8 Response Parameters
| Properties | Type | Sample | Properties description |
|---|---|---|---|
| code | int | 0 | The success or failure status code returned in API response. |
| message | string | Success | The success or failure messages returned in API response. Reasons of failure will be described in the message. |
| request_id | string | 202203070749000101890810281E8C70B7 | Request log |
| data | object | Specific return information | |
| ^doc_url | string | https://magelng.bytedance.net2/wsos_v2/oec_fulfillment_doc_tts/object/wsos641232 | The URL of the shipping label and packing slip generated for the specified package. |
| The URL is valid for 24 hours. | |||
| ^tracking_number | string | 752455325694 | The package tracking number from the shipping carrier. |
§9 Response Sample
{"code":0,"data":{"doc_url":"https://magelng.bytedance.net2/wsos_v2/oec_fulfillment_doc_tts/object/wsos641232","tracking_number":"752455325694"},"message":"Success","request_id":"202203070749000101890810281E8C70B7"}
§10 Error Code
For common error codes, refer to How to call TikTok Shop APIs - Common Error Code
| Code | Message |
|---|---|
| 11006010 | Internal package status error, please try again later. |
| 11034002 | This API is only applicable to TikTok Shipping orders. For seller shipping, please obtain the shipping label offline and upload it to TikTok Shop via API or Seller Center. |
| 11034009 | Warehouse does not exist. |
| 11034023 | Shipping document generation timeout error, please try again later. |
| 11034025 | Internal package tag error, pleaser try again later. |
| 11034037 | The shipping document is still being generated by the logistics provider, please try again later. |
| 21008017 | This API is only applicable to TikTok Shipping orders. For seller shipping, please obtain the shipping label offline and upload it to TikTok Shop via API or Seller Center. |
| 21008043 | This package is fulfilled by TikTok. Shipping documents cannot be printed. |
| 21008109 | Unable to retrieve shipping information, please double check the order status. |
| 21011001 | Package not found. If the error persists, please contact the platform for assistance. |
| 21021010 | Failed to ship. You may cancel the order without penalty by selecting the following reason: Unable to deliver to buyer address. |
| 21023022 | Unknown label print timeout error. If the error persists, please contact the platform for assistance. |
| 21023034 | Internal package update error, please try again later. |
| 21023035 | Please arrange shipment before retrieving the shipping document. |
| 21023046 | Package has already been shipped. |
| 21023059 | Package has already been cancelled. |
| 21042102 | Documents couldn't be printed after the package has been pickup. |
| 21042104 | Documents couldn't be printed before shipped.Please check shipping is arranged and try again. |
| 36009003 | Internal error. Please try again. If the issue persists after multiple attempts, please contact platform support. |
