Articles on: API & Webhooks

TikTok Shipping API Integrations Guide for 3PL Partners

Plans: Pro and Enterprise Platforms: All platforms


Overview


This article explains how 3PL and WMS providers can integrate with the AfterShip Shipping API to generate official TikTok shipping labels on behalf of merchants.


If you are handling fulfillment for merchants selling on TikTok Shop, you may already receive TikTok Shop orders in your system through Shopify or another OMS. However, due to TikTok’s authorization model and API restrictions, you cannot directly generate official TikTok Shipping (TTS) labels.


Explore the required architecture, OAuth implementation, and API workflow.


By participating in the AfterShip Partner Program, you can:


  • Enable merchants to authorize your platform via OAuth 2.0
  • Allow merchants to connect TikTok Shop with AfterShip
  • Generate official TikTok shipping labels using the TikTok Shop Order ID
  • Ensure 100% compliance with TikTok fulfillment policies


AfterShip acts as the compliance layer between your system and TikTok.


If you are a merchant integrating directly with AfterShip (instead of a 3PL or WMS platform), refer to the TikTok Shipping API Integration Guide for Merchants for the complete setup instructions and API workflow specific to merchant systems.


Understanding the data flow and architecture


Before implementation, it is important to understand the two required authorization flows:


Authorization flow 1: 3PL ↔ AfterShip (Token A)


The merchant authorizes your 3PL platform to call the AfterShip API on their behalf. 


This authorization is implemented using OAuth 2.0 and results in an access token that your system can use when making API calls. This authorization is referred to as Token A.



Authorization flow 2: AfterShip ↔ TikTok Shop (Token B)


The merchant installs and authorizes the AfterShip Shipping app in TikTok Shop


This authorization allows AfterShip to access TikTok Shop order data and generate official TikTok shipping labels. The authorization is referred to as Token B.


End-to-end sequence


Once both authorization steps are completed, the system workflow proceeds as follows:


1. Order sync


TikTok Shop order ↔ Shopify or other OMS ↔ WMS


  • TikTok Shop order syncs to Shopify (or other OMS)
  • Order is imported into your WMS.
  • The order contains the original TikTok Shop Order ID in the note attributes.


2. Request label


When your warehouse system needs to generate a shipping label:


  • Your WMS calls the AfterShip API.
  • The request uses: Merchant access Token (Token A) and TikTok Shop Order ID.


3. Generate label


  • AfterShip validates authorization and uses Token B to request a label from TikTok.


4. Return


AfterShip returns the generated shipping label PDF URL and shipment details to your WMS.


Implementation steps


Start: Join the AfterShip partner program


Before you begin the integration process, Contact Sales to initiate the AfterShip partner program onboarding. Once approved, you will receive:


  • AfterShip Partner permissions
  • client_id
  • client_secret


These are required in the further steps to implement OAuth 2.0.


Step 1: Implement OAuth 2.0 (Merchant authorization)


To generate labels on behalf of multiple merchants, you must obtain a unique access_token for each merchant via OAuth 2.0. AfterShip supports two implementation styles, allowing you to choose as per your platform capabilities and implementation complexity. Choose an integration style from the two options discussed below: 



  • Best suited for: Platforms that have an App Store or Integration Marketplace.


  • Experience: Merchant finds AfterShip Shipping appears as an official integration app inside your platform and clicks Connect to start the OAuth flow.


  • Effort level: Medium (Requires frontend UI development and integration setup within your platform.)




  • Best suited for: Platforms requiring headless integrations or immediate launch without UI change. 


  • Experience: You share the secure setup link with the merchant via email, dashboard notification, or settings page. The merchant clicks the link to complete authorization.


  • Effort level: Low (No complex frontend development required)


The OAuth Workflow


Regardless of the integration style you choose, the backend logic for handling the token exchange remains the same. 


1. Initiate authorization


  • For Option A (UI): Add AfterShip Shipping to your app store or the integration marketplace. The merchant clicks the Connect button to trigger the OAuth flow.
  • For Option B (Direct Link): Construct the OAuth authorization URL using client_id and redirect_url, and send it to the merchant. For example, via onboarding email: “Click here to enable TikTok Shop fulfillment”.


2. Redirect to AfterShip


Redirect the merchant to AfterShip’s authorization page, where they will log in and approve the integration.


3. Handle the callback


After approval, AfterShip redirects merchants to your specified callback URL with a temporary authorization code.


4. Exchange token

Your server exchanges the (temporary) code for an access_token and a refresh_token. These tokens should be securely stored in your database against the merchant’s account ID.


For detailed API reference and parameter details, refer to: AfterShip OAuth 2.0 Overview


Important: Technical requirement for Option B


When using the Direct Authorization Link, merchants may open the link directly from an email, without being actively logged into your platform. So, you must use the state parameter to identify the merchant during the callback process.


Here is the recommended workflow: 


1. Generate a Unique Link: Construct the OAuth authorization URL and include the merchant’s unique identifier in the state parameter. For security, it is recommended to encrypt or sign this identifier.



2. Send to Merchant: Share this specific authorization link with the merchant through email, dashboard notification, or onboarding instructions.


3. Handle Context via Callback: After the merchant completes authorization, AfterShip redirects them to your callback_url. The state parameter you sent will be originally returned.



4. Restore Context: Decode or decrypt the state parameter to retrieve the merchant ID. You can then exchange the authorization code for the access token and securely store it under the correct merchant account in your system.


Step 2: Extract the TikTok Shop Order ID


When TikTok Shop orders are synced to Shopify via AfterShip Feed or TikTok itself, the original TikTok Shop Order ID is usually stored in the Note Attributes or Tags.


Example Shopify Order Data synced by AfterShip Feed:


"note_attributes": [
{
"name": "Sales Channel",
"value": "TikTok Shop - SANDBOXxxxxxxx"
},
{
"name": "TikTok Shop Order Number",
"value": "57xxxx"
}
]



  • TikTok Shop Order IDs are 18-digit numbers
  • They typically begin with 576 or 577
  • You must modify your order import logic to capture and store this ID
  • Do not use Shopify Order ID
  • Here, value 57xxxx is the ID you must save for further steps.


Step 3: Generate the Shipping label via API


  • When your warehouse workflow reaches the label generation step for a TikTok Shop order, trigger the API call to the AfterShip Shipping API. The request must include the Merchant access token (as-access-token) and the TikTok Shop order ID for AfterShip to verify it’s an authorized merchant and call the TTS API to generate the shipping label.


  • AfterShip returns the official TikTok shipping label URL. You can get the label from the API response/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-access-token: {merchant_access_token}' \
--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
}
}


Merchant onboarding guide


For this integration to work, your merchants must complete a one-time setup.


The onboarding steps may vary slightly depending on how you implemented Step 1 (OAuth authorization) on your platform: either via an Embedded Integration (App Store/UI button) or a Direct Authorization Link.


Provided below are two templates. Choose one that matches your integration method and share it with your merchants to guide them.


📢 Instructions for merchants (Templates)


Subject: Action Required: Enable TikTok Shop Fulfillment


  • You must perform the following two steps to ensure we can generate official TikTok Shop shipping labels. 


Step 1: Connect [Your 3PL Name] with AfterShip


Make sure to choose the right steps according to your integration method.


Option A: If you implemented Embedded Integration (App store or Button in UI)


  1. (Merchant) Log in to your [Your 3PL Name] Portal.
  2. Open the Integrations (or App Store) page.
  3. Locate AfterShip and click Connect/Install.
  4. Log in/Sign up to the AfterShip account.
  5. Click Authorize.


This allows us [3PL] to securely communicate with AfterShip to request labels on your behalf.


Option B: If you implemented the Direct Authorization Link


  1. (Merchant) Click the Secure setup link sent via Email (or in the notifications dashboard).
  2. You will be redirected to the AfterShip authorization page.
  3. Log in/Sign up to the AfterShip account.
  4. Click Authorize.


This securely links your AfterShip account to our [3PL] system so we can automate label generation.


Step 2: Connect TikTok Shop to AfterShip Shipping


Important note: Even after connecting us [3PL] with AfterShip, the merchant must also connect and authorize AfterShip to access TikTok Shop orders.


Follow these steps to connect TikTok Shop:


  1. Install the AfterShip Shipping app from the TikTok Shop App Store.
  2. Follow the prompts and authorize the connection.


This step allows AfterShip to generate official shipping labels for the merchant’s TikTok Shop orders. 


⚠️ If Step 2 is not completed, we won’t be able to generate shipping labels, and fulfillment may be blocked.


FAQs


1. How is payment handled for TikTok Shipping labels?


  • The 3PL provider pays AfterShip for the TikTok Shipping API usage associated with all merchants who have authorized the integration through OAuth.
  • Merchants pay TikTok Shop for the actual shipping label cost charged by TikTok.
  • Merchants can still use AfterShip with other carriers, and pay to AfterShip for the generic subscription.


2. What if the merchant hasn't connected TikTok Shop to AfterShip?


If the merchant has not connected their TikTok Shop account to AfterShip, the API request call to generate a shipping label will fail due to missing permissions. Please ensure your UI prompts the merchants to complete the setup. 


3. Why can’t we use the Shopify Order ID to generate the label?


TikTok's API requires their own unique TikTok Shop Order ID. The Shopify Order ID is not recognized by TikTok as a result it cannot be used in the API request. You must ensure your order import logic captures the TikTok Shop Order Number stored in the order attributes or tags.


4. How can I retrieve the TikTok Shop Order ID from a Shopify order?


TTS Order ID is auto-filled to Shopify order when the sync tools (such as AfterShip Feed, TikTok integrations) syncs the TTS order to Shopify. Please do check with the sync tools about the details.


Below are the Shopify order examples from some popular sync tools to give you the idea of how to extract TTS order ID.


AfterShip Feed


"note_attributes": [
{
"name": "Sales Channel",
"value": "TikTok Shop - SANDBOXxxxxxxx"
},
{
"name": "TikTok Shop 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"


5. Does AfterShip support platforms other than Shopify (e.g., BigCommerce, OMS, ERP)?


Yes, we support all e-commerce platforms/OMS/ERP. The key requirement is that your system must be able to retrieve the original TikTok Shop Order ID from the order info and send it in the API request when generating the shipping label.


6. How to handle the split orders case?


If a single TikTok Shop order is split into multiple shipments, you must also include the Order Line Item ID for each item in the API request along with the TikTok Shop Order ID.


Example request payload:


{
"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"
}
]
}
]
}
}


7. How to find the Order Line item ID?


Contact your order provider for guidance on retrieving the TikTok Shop Order Line Item ID.


8. How to handle the void label case?


TikTok Shop doesn’t allow to void label after the label is generated. So, you cannot void the TikTok shipping label via AfterShip.


In most e-commerce systems, generating a shipping label indicates that the shipment is ready for dispatch, thus it doesn’t allow to void the order or shipment anymore. However, the shopper can requests a refund or return, after the parcel is delivered.



Updated on: 10/03/2026