TikTok Shipping API Integration Guide for Merchants
Overview
This guide is for merchants who manage their own fulfillment system, like ERP, WMS, or a custom backend, and sell on TikTok Shop. By default, TikTok requires shipping labels to be generated through authorized and compliant channels. Learn how AfterShip Shipping API lets you generate official TikTok shipping labels, ensuring 100% compliance with TikTok's fulfillment policies, with one-time setup.
How the TikTok Shipping API integration works
The TikTok Shipping API integration follows three key steps:
- Authorize: Connect your TikTok Shop store with AfterShip to grant the necessary permissions so that AfterShip can securely access your TikTok Shop order data.
- Authenticate: Generate and use your AfterShip API Key to authenticate all API requests. This key verifies your identity and ensures that label generation requests are securely tied to your account.
- Execute: Send a request to the AfterShip Shipping API using the TikTok Shop Order ID. AfterShip will communicate with TikTok and return the official, compliant shipping label for your order.
Prerequisites (Mandatory)
Before making any API calls, two mandatory setup steps must be completed:
Step 1: Connect Your TikTok Shop to AfterShip
AfterShip must be authorized to securely access TikTok Shop order data and generate labels on your behalf. To connect:
- Log in to your TikTok Shop Seller Center.
- Go to app store and install the AfterShip Shipping app.
- Complete the authorization process.
AfterShip securely stores your shop’s access token in the backend, enabling the API to generate shipping labels on your behalf.
Step 2: Generate your AfterShip API Key
This step is a must to authenticate all your API requests:
- Log in to your AfterShip Admin portal.
- Navigate to Settings and click API Keys.
- Click Create API Key.
- Copy and securely store the generated key.
Example format: asat_xxxxxxxx
Integration workflow
Once prerequisites are complete, follow these steps to implement the label generation logic:
Step 1: Extract TikTok Shop Order ID
If you do not have a direct integration with TikTok Shop, your TikTok Shop orders are likely being synced to another platform, such as Shopify or another OMS.
For example, when a TikTok Shop order is synced to Shopify via apps like AfterShip Feed, or by TikTok directly, the original TikTok Shop Order ID is typically stored in the order’s Note Attributes or Tags. You must update your order management logic to extract and store this ID.
Example: Shopify order data synced via AfterShip Feed
"note_attributes": [
{
"name": "Sales Channel",
"value": "TikTok Shop - SANDBOXxxxxxxx"
},
{
"name": "TikTok Shop Order Number",
"value": "57xxxx"
}
]
In this example, “57xxxx” is the TikTok Shop Order ID that you must capture and send in the API request. TikTok Shop Order IDs are always 18 digits long and typically begin with ‘576’ or ‘577’. See the image below from TikTok Shop for a better understanding:

Step 2: Request API to generate a label
When your fulfillment workflow reaches the stage where you need to generate a shipping label for a TikTok Shop order, trigger the API call.
- The request must include your
as-api-keyin the header and the correct TikTok Shop Order ID. - Once the request is successfully processed, AfterShip returns the official TikTok-compliant shipping label URL in the API response.
- You may retrieve the label directly from the API response or receive it through a configured webhook.
What does a TikTok Shipping API request and response look like?
API request CURL example
curl --location 'https://api.aftership.com/postmen/v3/labels/' \
--header 'Content-Type: application/json' \
--header 'as-api-key: {as-api-key}' \
--data-raw '{
"service_type": "tiktok-shipping_standard_shipping",
"order_id": "57xxxx",
"shipment": {
"parcels": [
{
"dimension": {
"depth": 10,
"height": 5,
"width": 8,
"unit": "in"
},
"weight": {
"unit": "lb",
"value": 1.5
}
}
]
}
}'
Response JSON example
{
"meta": {
"code": 200,
"message": "OK",
"details": []
},
"data": {
"id": "6ade72e9-ec99-45a5-908e-187eb7488db6",
"status": "created",
"ship_date": "2026-01-28",
"created_at": "2026-01-28T14:36:27+00:00",
"updated_at": "2026-01-28T14:36:34+00:00",
"tracking_numbers": [
"9234690394227201263806"
],
"carrier_references": [],
"files": {
"label": {
"paper_size": "4x6",
"url": "https://testing-production-download.postmen.io/label/2026-01-28/6ade72e9-ec99-45a5-908e-187eb7488db6-1769610994188.pdf",
"file_type": "pdf"
},
"qr_code": null,
"invoice": null,
"customs_declaration": null,
"manifest": null,
"packing_slip": null
},
"rate": {
"shipper_account": {
"id": "054194464b8d47c6a935f1a16d5844de",
"slug": "tiktok-shipping",
"description": "TTS"
},
"service_type": "tiktok-shipping_standard_shipping",
"service_name": "TikTok Shipping Standard Shipping",
"pickup_deadline": null,
"booking_cut_off": null,
"delivery_date": "2026-02-02T14:36:34+00:00",
"transit_time": 5,
"error_message": null,
"info_message": null,
"charge_weight": {
"value": 1,
"unit": "lb"
},
"total_charge": {
"amount": 6.66,
"currency": "USD"
},
"detailed_charges": [
{
"type": "base",
"charge": {
"amount": 6.66,
"currency": "USD"
}
}
]
},
"references": [],
"order_id": "576477431806268482",
"order_number": null,
"service_type": "tiktok-shipping_standard_shipping",
"shipper_account": {
"id": "054194464b8d47c6a935f1a16d5844de",
"slug": "tiktok-shipping"
},
"service_options": [],
"custom_fields": null,
"carrier_redirect_link": null
}
}
Manage exceptional scenarios
Case 1: Split orders (Multiple shipments)
If you are splitting a single TikTok Shop order into multiple parcels, you must send AfterShip the corresponding Order Line Item IDs. This helps TikTok validate which items belong to each shipment.
Example:
{
"service_type": "tiktok-shipping_standard_shipping",
"order_id": "57xxxx",
"shipment": {
"parcels": [
{
"dimension": {
"depth": 10,
"height": 5,
"width": 8,
"unit": "in"
},
"weight": {
"unit": "lb",
"value": 1.5
},
"items":[ // array of list, present all Order Line item ID included in the current parcel
{
"item_id":"yyyy"
}
]
}
]
}
}
Case 2: Voiding a Label
TikTok does not allow voiding a shipping label once it has been generated. So, you can also not void a TikTok Shipping label via AfterShip. In many e-commerce platforms, this is a common practice that once the label is generated, the order is ready to dispatch.
However, customers can still request a refund or return after the parcel has been delivered, following the standard return process.
FAQs
1. Why do I get an “Unauthorized” error?
If you receive an unauthorized error, please verify the following:
- Ensure you are using the correct header:
as-api-key. Also, make sure you are using a valid API key. - Make sure you have completed Prerequisites – Step 1: Connect TikTok Shop to AfterShip. We cannot verify order ownership without a TikTok Shop connection.
2. Can I use the Shopify Order ID?
No. You must extract and send the original TikTok Shop Order Number stored within your order attributes. The TikTok API rejects Shopify Order IDs or any unknown IDs.
3. How to retrieve the TTS Order ID from the Shopify order?
When TikTok Shop orders are synced to Shopify through sync tools, the original TikTok Shop Order ID is typically auto-filled in Shopify orders metadata, such as Notes attributes, or Tags.
The exact location depends on the sync tool you are using. Below are examples from commonly used sync tools:
Aftership Feed
"note_attributes": [
{
"name": "Sales Channel",
"value": "TikTok Shop - SANDBOXxxxxxxx"
},
{
"name": "TikTok Order Number",
"value": "57xxxx"
}
]
TikTok 1P
"tags": ["TikTokOrderID:57xxxx"]
SKUIQ
"note_attributes": [
{
"name": "SkuIQ Order ID",
"value": "yyyy"
},
{
"name": "TikTok Shop Order ID",
"value": "57xxxx"
}
]
SILK
"note_attributes": [
{
"name": "TTS order number",
"value": "57xxxx"
}
]
ShopeDance
"note_attributes": [
{
"name": "TikTok Shop order number",
"value": "57xxxx"
}
]
CEDCommerce
"note": "Source Order ID:57xxxx"
4. Besides Shopify, does AfterShip also support other platforms (e.g. BigCommerce/OMS/ERP)?
Yes. AfterShip supports integration with any e-commerce platform, OMS, or ERP. The key requirement is to retrieve the original TikTok Shop Order ID from the order data and use that ID in the API request to generate a shipping label.
5. How to find the Order Line item ID?
Contact your order provider for guidance on retrieving the TikTok Shop Order Line Item ID.
Key takeaways
- The AfterShip Shipping API allows merchants to generate official TikTok-compliant shipping labels directly from their own system.
- You must first connect your TikTok Shop to AfterShip before making any API requests.
- All API requests must include your valid AfterShip API Key (as-api-key) for authentication.
- Always use the original TikTok Shop Order ID (18-digit ID starting with 576 or 577). Do not use Shopify or any other unknown order IDs.
- If splitting shipments, you must include the Order Line Item ID to ensure each parcel is correctly mapped to its corresponding items.
- Once a TikTok shipping label is generated, it cannot be voided. Shoppers can place a return after the package is delivered.
- The integration works with all platforms, as long as you can retrieve and send the correct TikTok Shop Order ID.
Updated on: 12/02/2026
