Skip to API reference

Customer order API

Connect your order system to parcel forwarding, procurement and warehouse fulfillment. For spreadsheet orders, use the Excel templates in your customer account.

Base URLhttps://fromchinahub.com/api/integrations/v1/

Connect your account

  1. Sign in with your verified customer account. Under General, open API Management, select the services you need and submit for review. Each service requires approval.
  2. Approval automatically issues a token. Open API Management and choose Reveal approved key. Copy it when displayed and store it in your server’s secret manager. Keep it out of web pages, mobile apps, workbooks and logs.
  3. Your key works for the services approved on your account and has no scheduled expiry. Replacing or revoking it takes effect immediately. If it is exposed, revoke it in API Management.

Send your first request

Use HTTPS and keep the trailing slash. Set FCH_TOKEN in your server environment. This cURL example requests a quote only. Replace both example IDs with measured waybills belonging to your account.

Field or conditionHow to use it
AuthorizationEvery request needs Bearer followed by a space and the token. Your customer account comes from this credential.
Content-TypePOST requests accept application/json. Use a UTF-8 JSON object with unique field names, at most 64 KiB. Use documented fields and omit URL query parameters.
Idempotency-KeyRequired on POST …/orders/. Generate one stable key per logical order, 8–128 ASCII letters, digits or . _ : -. Persist it before sending.
cURL · consolidation quote
curl --request POST "https://fromchinahub.com/api/integrations/v1/forwarding/quote/" \
  --header "Authorization: Bearer ${FCH_TOKEN}" \
  --header "Content-Type: application/json" \
  --data '{"records":[{"kind":"forecast","id":181},{"kind":"forecast","id":182}],"direct":false}'

Forwarding · parcel pre-alert

Register a parcel before it arrives. Save reference for API status checks and number for the warehouse waybill. The account limit is 20 new pre-alerts per day across submission methods.

  • POST /forwarding/orders/
  • GET /forwarding/orders/{reference}/
Field or conditionHow to use it
action · markingaction defaults to prealert. marking is the required parcel identification or shipping mark, 1–60 characters.
tracking_numberOptional domestic courier tracking number, up to 128 characters. Preserve leading zeros as text.
package_count · remarkPositive integer, 1–1000, default 1. Optional remark, up to 2000 characters.
Request body
{
  "action": "prealert",
  "marking": "SHOP-1042",
  "tracking_number": "SF000123456789",
  "package_count": 1
}
cURL · creates a real pre-alert; replace sample values
curl --request POST "https://fromchinahub.com/api/integrations/v1/forwarding/orders/" \
  --header "Authorization: Bearer ${FCH_TOKEN}" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: prealert-shop-1042" \
  --data '{"action":"prealert","marking":"SHOP-1042","tracking_number":"SF000123456789","package_count":1}'
201 · example receipt
{
  "reference": "F-181",
  "id": 181,
  "kind": "forecast",
  "number": "12345678901",
  "status": "pending",
  "tracking_number": "SF000123456789",
  "marking": "SHOP-1042",
  "package_count": 1
}

Forwarding · consolidate received parcels

Get a quote, present the fee, then confirm with the order endpoint. Confirmation creates a parent waybill and debits the merge fee. The account must have sufficient balance.

  • POST /forwarding/quote/
  • POST /forwarding/orders/
Field or conditionHow to use it
records[]2–100 distinct, measured, eligible waybills in your account. Send kind (forecast or pickup) and its numeric id. Use the id from your API receipt. For existing parcels, open the received row’s status in Waybill overview. The destination URL contains fl_received_focus=forecast_181 or pickup_182; the suffix is the id.
directOptional boolean, default false. true keeps the original boxes, up to 100 boxes, and waives the CNY 0.25/kg merge weight fee. The quoted piece fee can still apply.
fee · pieces · charge_weightQuote returns total fee (CNY), piece count and chargeable weight (kg), plus weight_fee and piece_fee. Direct quotes also include mode and quote_token.
action · expected_fee · quote_token · noteTo confirm, repeat records and direct. Add action="merge" and the exact fee string returned. For direct merges include its quote_token within 15 minutes. Optional note ≤3000 characters.
Quote request
{
  "records": [
    {
      "kind": "forecast",
      "id": 181
    },
    {
      "kind": "forecast",
      "id": 182
    }
  ],
  "direct": true
}
Confirmation body · replace the fee and token with the actual quote
{
  "records": [
    {
      "kind": "forecast",
      "id": 181
    },
    {
      "kind": "forecast",
      "id": 182
    }
  ],
  "direct": true,
  "action": "merge",
  "expected_fee": "3.00",
  "quote_token": "TOKEN_FROM_QUOTE"
}

Procurement · request a purchase

Send buying instructions for staff review. The merchandise estimate excludes commission and domestic freight. The customer reviews the final quote in the portal before payment.

  • POST /procurement/orders/
  • GET /procurement/orders/{reference}/
Field or conditionHow to use it
title · confirmed · items[]Required. Title up to 160 characters, confirmed must be the boolean true (accept the purchase terms); 1–50 product lines.
items[].name · requirementsBoth required. Product name up to 200 characters and buying instructions up to 3000. Include the variant, colour and size.
items[].url · requires_sourcingA supplied product link carries the 3% service rate. Send a complete HTTP(S) URL (≤2000 characters). For staff sourcing, set requires_sourcing to true; the link is optional and the rate is 5%.
items[].quantity · estimated_unit_priceQuantity is an integer 1–100000. Estimated CNY unit price must be positive, with up to two decimals. Merchandise total cannot exceed CNY 9,999,999.99.
delivery_mode · destination · noteRequired mode: our_warehouse or other_warehouse. For other_warehouse supply destination.name (≤160), phone (≤64) and address (≤1500). Optional order note ≤3000.
Sourcing request
{
  "title": "Blue cotton tote bags",
  "confirmed": true,
  "delivery_mode": "our_warehouse",
  "items": [
    {
      "name": "Cotton tote bag",
      "requires_sourcing": true,
      "requirements": "Blue, 35 × 40 cm",
      "quantity": 10,
      "estimated_unit_price": "12.00"
    }
  ]
}
201 · before staff review
{
  "reference": "PC123456789012",
  "status": "submitted",
  "estimated_goods_cny": "120.00",
  "tracking_number": ""
}

Fulfillment · quote and ship inventory

Use Warehouse IDs from your inventory. A quote checks stock and returns available channels. Booking authorizes an actual dispatch, deducts inventory and charges freight and handling to your account. The available balance must cover the entire quoted total.

  • POST /fulfillment/quote/
  • POST /fulfillment/orders/
  • GET /fulfillment/orders/{reference}/
Field or conditionHow to use it
country · items[]Use an uppercase destination code such as US or CN-GD. Send 1–50 distinct inventory items of matching shape and cargo type. Each needs warehouse_id and an integer quantity (1–100000) within available stock.
recipientRequired text: name (≤160), address1 (≤45), city and province (≤120 each), phone1 (≤64). Supply postal_code and tax_number when required by the destination.
recipient · optionalcompany (≤200), address2 (≤45), district (≤120), district_code (≤12), phone2 (≤64), postal_code (≤32) and email (≤254).
product_value · declaration[]product_value is CNY, defaults to 0, up to two decimals. To override stored declarations, send 1–50 lines with name_cn, name_en, integer quantity and positive unit value in USD (field value). Declared quantities must match the shipment total. Optional fields: hs_code, brand, material, usage, sku, weight (kg).
quotes[] · quote_token · confirm_chargeEach option gives channel_name, freight_cny, service_fee_cny, total_cny and quote_token. An empty list means no available service. To book, POST the identical quote payload plus the chosen quote_token and confirm_charge: true, within 900 seconds.
Quote request · use your own inventory and address
{
  "country": "US",
  "items": [
    {
      "warehouse_id": "WH0000000001",
      "quantity": 1
    }
  ],
  "recipient": {
    "name": "Sample Recipient",
    "address1": "10 Example Street",
    "city": "New York",
    "province": "NY",
    "postal_code": "10001",
    "phone1": "+12125550100"
  },
  "product_value": "0.00"
}
200 · illustrative quote
{
  "currency": "CNY",
  "expires_in_seconds": 900,
  "quotes": [
    {
      "channel_name": "Example shipping service",
      "freight_cny": "48.00",
      "service_fee_cny": "4.00",
      "total_cny": "52.00",
      "quote_token": "TOKEN_FROM_QUOTE"
    }
  ]
}
201 · example confirmed shipment
{
  "reference": "FS12345678",
  "status": "warehouse_processing",
  "channel_name": "Example shipping service",
  "freight_cny": "48.00",
  "service_fee_cny": "4.00",
  "total_cny": "52.00",
  "charged": true
}

Order status, retries and errors

Save the reference from each successful creation. GET the detail URL under the same service to read current status. Only an order with an integration receipt for your own account can be retrieved.

Field or conditionHow to use it
status · forwardingTypical values include pending (awaiting arrival), received (in the warehouse), merging, merged (source waybill), to_carrier, carrier_transit and delivered.
status · procurementsubmitted → reviewing → quoted (customer confirmation) → purchasing → purchased → shipped → received. A closed request can be cancelled or refunded. tracking_number is filled once domestic tracking is recorded.
status · fulfillmentwarehouse_processing (preparing), in_shipping (dispatched), trying_intercepting, returning or received. A detail response also gives the selected channel, freight, handling, total and charged flag.
200 · 201GET and quotes return 200. A new order returns 201 and Idempotency-Replayed: false. Sending the same key and equivalent order data again returns the original receipt with 200 and Idempotency-Replayed: true.
400 · 413 · 415Read error.message. Correct the fields or JSON (400), reduce the request to 64 KiB (413), or send application/json (415). Only send one JSON object per request.
401 · 403For 401, check your key and whether it was replaced or revoked in API Management. For 403, verify your approved service and customer access with support.
404 · 405404: check the reference, account and service. 405: use the supported HTTP method in the Allow response header.
409A key reused for different data is an idempotency_conflict. For insufficient_balance, fund the account. For changed quotes or stock, check the last receipt and fetch a fresh quote before authorizing a new order. One set of fulfillment quote options can book one shipment.
429 · 503 · timeoutsLimits are 60 requests/minute per customer and 120/minute per source IP. A 429 or 503 includes Retry-After: 60. Wait, then retry with the same key and body. After a network timeout, also keep the original key and body.
cURL · look up a saved reference
curl "https://fromchinahub.com/api/integrations/v1/forwarding/orders/F-181/" \
  --header "Authorization: Bearer ${FCH_TOKEN}"
403 · error response
{
  "error": {
    "code": "scope_denied",
    "message": "This integration service has not been enabled."
  }
}

Place orders with Excel

Sign in to the Excel workspace, download the template for your service, keep the headings and enter plain values. Preview the orders before confirming. Forwarding and procurement require integration approval for that service. For fulfillment, use the shipping workspace under your fulfillment account.

Field or conditionHow to use it
Forwarding · 转运Orders sheet, one pre-alert per row. Required: order_ref, marking. Optional: tracking_number, package_count, remark. Format tracking numbers as text.
Procurement · 代购Orders sheet. Supply order_ref, title, name, requirements, quantity and estimated_unit_price. Add url for link orders or set requires_sourcing to TRUE. Repeat order_ref and title to group lines. Spreadsheet purchases are delivered to our warehouse.
Forwarding & procurement · 转运和代购Up to 20 orders and 50 rows per .xlsx file, 512 KiB maximum. Use a stable order_ref (1–64 ASCII letters, digits, dots, dashes or underscores; start with a letter or digit). Confirm the preview within 15 minutes. Keep the same references on retry.
Fulfillment · 履约Use the separate shipping template. Group item rows by order_ref and enter inventory, quantity and recipient details. Up to 100 orders, 1000 product rows and 2 MiB. Review each channel and total, then confirm within 15 minutes to submit and charge the batch.
Fulfillment re-upload · 履约重传Keep each original order_ref. If the preview flags an already submitted order, it shows the original waybill number. Remove those rows and upload the remaining orders before confirming the batch.
↑ Back to top

Express, postal & ocean channels

DHLDHL
UPSUPS
FedExFedEx
TNTTNT
DPDDPD
AramexARAMEX
USPSUSPS
PurolatorPurolator
Yamato TransportYAMATO · 黑猫宅急便
GLSGLS
Royal MailRoyal Mail
YunExpressYunExpress · 云途
Yanwen ExpressYanwen · 燕文
COMONE EXPRESSCOMONE EXPRESS
SF ExpressSF Express · 顺丰
China Post · 中国邮政China Post · 中国邮政
EMSEMS
KYE · 跨越速运KYE · 跨越速运
J&T Express · 极兔J&T Express · 极兔
货拉拉 · Huolala货拉拉 · Huolala
Cainiao · 菜鸟Cainiao · 菜鸟
GOFOGOFO
UniUniUniUni
4PX · 递四方4PX · 递四方
MatsonMatson · 美森
MaerskMAERSK
MSCMSC
CMA CGMCMA CGM
COSCO ShippingCOSCO SHIPPING
Evergreen MarineEVERGREEN
Ocean Network ExpressONE · Ocean Network Express