Order API Reference
Summary
This page lists the statuses, endpoints, parameters, and error codes of the order module. For the full end-to-end workflow, see the Guide to placing & paying for Taobao/1688 orders. How to receive order updates over webhooks has its own reference page.
Scope: Multiple markets are supported. Payment is unified in VND, USD, or RMB (CNY) — the purchasing wallet is topped up in one of these three currencies; balances and order amounts in the API are normalized to a common unit (
*_cny).
Elim is a technology platform that handles order fulfilment and payment — it does not sell retail and does not take end customers directly. Your system pays Elim through the purchasing wallet, and Elim in turn pays the seller on the platform. Because of this, every order carries two independent statuses — the platform status (status) and the payment status with Elim (payment_status) — plus one indicator of the platform-side payment result (platform_payment_status).
Every endpoint requires JWT authentication (Authorization: Bearer <token>) or an API Key (x-api-key). See Authenticating API requests.
Platform status (status)
The order’s processing progress on Taobao / 1688.
| Value | Description |
|---|---|
creating | Order just initiated, waiting for the platform to confirm |
pending_payment | Platform created the order, awaiting payment |
paid | Order paid on the platform side |
shipped | Goods shipped from the warehouse, in transit |
completed | Order completed, receipt confirmed |
cancelled | Order has been cancelled |
unknown | Could not read the status from the platform |
creating → pending_payment → paid → shipped → completed
↘ cancelled
Elim payment status (payment_status)
The payment progress between the user and Elim. Independent of status.
| Value | Description | Money in wallet |
|---|---|---|
unpaid | Default when the order is created — no payment request sent yet | Not affected |
requested | The user has sent a payment request | Held (frozen_balance) |
approved | Elim approved the request and is paying the platform | Still held |
paid | Payment completed | Deducted from balance |
rejected | Elim rejected the request (rejection_reason gives the reason) | Released back |
refunded | A paid order was refunded to the wallet | Added back to balance |
unpaid → requested → approved → paid → refunded
↑ ↓
└──── rejected
From requested, the user can withdraw their own request to go back to unpaid (see cancel-payment-request). After approved, the only way back is a refund.
Platform payment result (platform_payment_status)
Only has a value after Elim has attempted payment with the platform.
| Value | Description |
|---|---|
pending | Sending the payment instruction to the platform |
success | The platform recorded the payment |
failed | The platform reported an error — Elim will handle it manually |
unknown | Result not yet determined |
Always show both
statusandpayment_statusin your interface.platform_payment_statusis mainly for diagnostics when something goes wrong.
Order endpoints
Prefix /v1/orders. Rate limits are per second window.
| Endpoint | Method | Description | Rate limit |
|---|---|---|---|
/v1/orders/preview | POST | Preview an order: estimated total, availability check — no order created, no money deducted | 20 / 60s |
/v1/orders | POST | Create a real order on the platform | 10 / 60s |
/v1/orders | GET | List the current user’s orders (paginated) | 30 / 60s |
/v1/orders/stats | GET | Aggregate order statistics by date range / status | 30 / 60s |
/v1/orders/:id | GET | Order details — auto-syncs the latest status from the platform on every call | 30 / 60s |
/v1/orders/:id/cancel | POST | Cancel an order while it is still in a cancellable state | 10 / 60s |
/v1/orders/:id/logistic-detail?package_id=<int> | GET | Domestic China shipping tracking (Taobao only) | 20 / 60s |
Preview and create order — body
{
"platform": "alibaba",
"receiver_address": {
"name": "Nguyen Van A",
"phone": "02812345678",
"mobile": "13800138000",
"address": "广州市天河区体育西路123号",
"province": "广东省",
"city": "广州市",
"area": "天河区",
"town": "天河南街道"
},
"line_items": [
{ "product_ref": "734467086498", "sku_ref": "5578084256927", "quantity": 2, "price": 15.5 }
],
"preview_token": "c5f75ec1-9f8d-4bf6-9de2-048d50fef349",
"idempotency_key": "checkout-2026-08-25-001",
"remark": "Note for the seller",
"promotion_id": "PROMO123"
}
| Field | Type | Required | Description |
|---|---|---|---|
platform | string | Yes | taobao or alibaba (1688) |
receiver_address | Address | Yes | A valid shipping address in China |
warehouse_address | Address | No | The dispatch warehouse address |
line_items | LineItem[] | Yes | List of items (see below) |
preview_token | string | No | Token from preview; single-use, expires after 10 minutes. Pass it when creating the order to lock in the price you previewed |
idempotency_key | string | Recommended | Anti-duplicate key per checkout. A repeated request with the same key returns the same order |
client_order_id | string | No | Order code from your own system (auto-generated if omitted) |
promotion_id | string | No | Promotion code |
remark | string | No | Note for the seller |
line_items[]
Each element identifies an item by the product_ref + sku_ref pair, taken directly from product search / detail.
| Field | Type | Required | Description |
|---|---|---|---|
product_ref | string | Yes | Product ID or link from the product search response |
sku_ref | string | Yes | The matching SKU ID — Taobao: skus[].id · 1688: skus[].spec_id |
quantity | number | Yes | Quantity |
price | number | No | Unit price in CNY — recommended so the preview returns exact figures |
The
mp_id+mp_skuid(marketplace ID) pair is still accepted for backward compatibility.
receiver_address
| Field | Required | Description |
|---|---|---|
name | Yes | Recipient name |
phone | Yes | Landline phone number |
mobile | Yes | Mobile number |
address | Yes | Detailed address (in Chinese) |
province / city / area | Recommended | Province / City / District |
town | No | Ward / commune |
Preview response
{
"success": true,
"preview_token": "c5f75ec1-9f8d-4bf6-9de2-048d50fef349",
"currency": "CNY",
"total_product_amount": 31.0,
"total_post_fee": 8.0,
"total_amount": 39.0,
"shops": [
{
"seller_id": "b2b-2201234567",
"seller_name": "广州某某贸易有限公司",
"post_fee": 8.0,
"shop_amount": 31.0,
"items": [
{ "product_id": "734467086498", "sku_id": "5578084256927", "quantity": 2, "unit_price": 15.5, "total_price": 31.0 }
]
}
],
"unavailable_items": []
}
| Field | Description |
|---|---|
total_product_amount | Total goods amount (CNY) |
total_post_fee | Total domestic China shipping fee |
total_amount | Total payable to the platform = goods + shipping |
unavailable_items[] | Items that cannot be ordered (out of stock / wrong SKU / delisted). Do not create the order if this array is non-empty |
Create order response
{
"status": "pending_payment",
"data": {
"id": "ORD0000000123",
"order_list": [
{
"success": true,
"amount": 39.0,
"post_fee": 8.0,
"lines": [
{ "sub_id": "E2101234567890", "product_id": "734467086498", "sku_id": "5578084256927", "quantity": 2, "amount": 31.0 }
]
}
]
}
}
| Field | Description |
|---|---|
data.id | Internal order ID in the form ORD + 10 digits — used for every later operation |
status | pending_payment on success; unknown when it cannot be determined — stop the payment flow and re-check via order details |
data.order_list[] | Shop + line details from the platform — use to build a receipt |
A new order is always at payment_status = unpaid.
List orders — filter parameters
GET /v1/orders
| Parameter | Type | Description |
|---|---|---|
page | number | Current page (default 1) |
size | number | Orders per page (default 20) |
platform | string | taobao / alibaba — empty = both |
status | string | Filter by platform status |
payment_status | string | Filter by Elim payment status |
client_order_id | string | Filter by your own order code |
created_from / created_to | ISO date | Creation date range |
Response: { total, page, size, items: OrderListItem[] }.
{
"total": 1, "page": 1, "size": 20,
"items": [
{
"id": "ORD0000000123",
"platform": "alibaba",
"status": "paid",
"payment_status": "paid",
"total_amount_cny": 39.0,
"total_amount": 39.0,
"products": [
{ "id": "734467086498", "name": "某某商品", "price": 15.5, "quantity": 2, "img_urls": ["https://..."] }
],
"created_at": "2026-04-09T10:30:00.000Z"
}
]
}
line_items/productsin the list are a snapshot from order creation. For the latest data, callGET /v1/orders/:id.
Order detail — differences by platform
GET /v1/orders/:id — auto-syncs the status from the platform before responding.
| Platform | Item list | Shipping |
|---|---|---|
| 1688 | products[] | logistics.logistics_info[] embedded in the response |
| Taobao | line_items[] | Call GET /v1/orders/:id/logistic-detail?package_id=<int> separately |
The platform field is present in the list response — store it to pick the display path before calling detail.
package_id is an integer taken from the Taobao order detail response, not an ORD... ID.
Cancel order — conditions
POST /v1/orders/:id/cancel — only when status is creating or pending_payment.
If the order has no platform order code yet:
{ "success": true, "message": "Internal order cancelled, no external order to cancel" }.
Purchasing wallet endpoints
Prefix /v1/purchasing.
| Endpoint | Method | Description |
|---|---|---|
/v1/purchasing/wallet | GET | Wallet balance |
/v1/purchasing/wallet/transactions | GET | Transaction history (paginated) |
/v1/purchasing/exchange-rates | GET | Exchange rates in effect |
GET /v1/purchasing/wallet
{
"balance": 1670.30,
"frozen_balance": 286.50,
"available_balance": 1383.80,
"total_deposited": 5000.00,
"total_spent": 3329.70,
"updated_at": "2026-06-19T00:00:00.000Z"
}
| Field | Description |
|---|---|
balance | Total balance in CNY |
frozen_balance | Held for orders at requested / approved |
available_balance | balance − frozen_balance — the amount actually usable. Compare this against the order amount |
total_deposited / total_spent | Cumulative figures |
GET /v1/purchasing/wallet/transactions
Parameters: page, size, type, date_from, date_to. Response: { total, page, size, items }.
type | Meaning |
|---|---|
deposit | Top-up into the wallet |
order_freeze | Money held when a payment request is sent |
order_unfreeze | Money released when the request is withdrawn or rejected |
order_deduction | Money deducted when order payment completes |
order_refund | Order refunded to the wallet |
admin_adjustment | Elim adjusted the balance manually |
GET /v1/purchasing/exchange-rates
An array of active exchange rates per currency pair (VND→CNY, USD→CNY): source_currency, target_currency, rate (market rate), markup_percent, effective_rate (the rate Elim applies after markup).
Order payment endpoints
Prefix /v1/purchasing/orders/:id. :id takes the ORD... form.
| Endpoint | Method | From status | To status | Description |
|---|---|---|---|---|
/request-payment | POST | unpaid | requested | Confirm the order and send a payment request — holds money in the wallet |
/cancel-payment-request | POST | requested | unpaid | Withdraw the request — releases the held money |
/confirm | POST | unpaid | paid | Direct payment (where enabled) — deducts money immediately, no approval step |
/payment | GET | — | — | Details of the order’s payment record |
POST …/request-payment
{
"success": true,
"order_id": "ORD0000000123",
"frozen_amount": 286.50,
"goods_amount_cny": 281.50,
"shipping_fee_cny": 0,
"service_fee_cny": 5.00
}
Insufficient wallet error — 400:
{
"error": "insufficient_balance",
"current_balance": 120.00,
"available_balance": 90.00,
"required": 286.50,
"deficit": 196.50
}
POST …/confirm
{
"order_id": "ORD0000000123",
"goods_amount_cny": 281.50,
"shipping_fee_cny": 0,
"service_fee_cny": 5.00,
"total_amount_cny": 286.50,
"payment_status": "paid",
"wallet_balance_after": 1383.80
}
Use wallet_balance_after to update the displayed balance without calling GET /v1/purchasing/wallet again.
State transitions performed by Elim
Users do not call these operations. They are listed to explain how payment_status will change and when you receive payment.updated.
| Elim operation | From | To | Wallet effect |
|---|---|---|---|
| Approve request | requested | approved | Money stays held |
| Reject request | requested | rejected | Held money released; rejection_reason gives the reason |
| Platform payment succeeded | approved | paid | Held money deducted; platform_payment_status = success |
| Platform payment failed | approved | unpaid | platform_payment_status = failed; Elim reaches out to resolve it |
| Refund | paid | refunded | Added back to balance; generates an order_refund transaction |
Receiving order updates over webhooks
Register a webhook so Elim calls into your system whenever an order’s status or payment_status changes — instead of polling for status. Two events relate to the order module:
| Event | When it is sent |
|---|---|
order.updated | The order’s status changed: sync from the platform, periodic sync, or cancellation |
payment.updated | payment_status changed: request sent, request withdrawn, approved, rejected, platform payment done/failed, or refund |
The payload carries an order snapshot: data.order.id, status, payment_status, platform_payment_status, total_amount_cny, updated_at. Return HTTP 2xx once processed.
The registration endpoint, the full payload structure, headers, HMAC signature verification, and the retry policy: see the Webhook reference.
Error codes
| HTTP | Situation | What to do |
|---|---|---|
400 | insufficient_balance | Top up deficit more CNY and resend the request |
400 | Cannot request payment: current status is "..." | The order is no longer at unpaid |
400 | Invalid platform ID format | Check product_ref / sku_ref |
401 | JWT expired | Get a new token |
403 | Accessing an order not on your account | Only operate on your own orders |
404 | Order / payment record not found | Re-check the ORD... ID |
422 | LINE_ITEM_SKU_NOT_RESOLVABLE / LINE_ITEM_PRODUCT_NOT_RESOLVABLE (Taobao) | Wrong sku_ref / product_ref — fetch them again from product detail |
429 | Rate limit exceeded | Wait ~60 seconds and pace your calls |
502 | Taobao/1688 platform not responding | Retry; do not create a duplicate order |
Error responses follow the shape { statusCode, message, error }. message is sometimes in Vietnamese and can be shown directly.
ID conventions
- Internal order ID:
ORD+ 10 digits, e.g.ORD0000000123. Used for every endpoint. - Platform order code (
order_id): issued by Taobao/1688, only present after the order is created successfully. package_id: an integer, used for Taobao shipping tracking.
Related links
- Guide to placing & paying for Taobao/1688 orders — step-by-step workflow
- Webhook reference — receive
order.updated/payment.updatedupdates - Authenticating API requests
- Full API reference