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 a dedicated 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 was cancelled before the platform took payment |
closed | Order was paid, then the platform closed the trade after a successful refund (including a partial one). It is not a cancellation; see the order’s refund requests for the refunded amount |
unknown | Could not be determined: the status could not be read from the platform, or the platform refused to create the order (the create-order response still succeeds but with status = unknown) |
cancellation_pending | Cancellation request sent, waiting for the platform to confirm |
cancellation_failed | The platform refused the cancellation — the order is unchanged; you can resend the payment request or cancel again |
route_unknown | The outcome of order creation could not be determined (failure midway) — re-check with the order details, do not create a duplicate order |
preview_finalization_pending | The order is waiting to be finalized from a preview |
expired | A draft order that was never fully created on the platform, and has been cleaned up |
creating → pending_payment → paid → shipped → completed
↓
cancellation_pending → cancelled
↓
cancellation_failed
An order can be cancelled at several points; the diagram only illustrates the cancellation branch from pending_payment. Handle every status value above (including unknown ones) with a default branch rather than assuming a fixed set of values.
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, Elim can still reject if platform payment has not started; once paid, it can only be reversed by a refund (see Refunds).
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 a clear error — the held funds are automatically returned to the wallet, and the order goes back to unpaid |
unknown | Result not yet determined (timeout, lost connection) — the order stays approved, and Elim reconciles with the platform before concluding |
Always show both
statusandpayment_statusin your interface.platform_payment_statusis mainly for diagnostics when something goes wrong.
Order endpoints
Prefix /v1/orders. All endpoints below share a limit of 60 requests / 60 seconds per account (Elim may adjust this per account). Every call to /v1/orders* counts toward the API quota; /v1/purchasing/*, /v1/refunds*, and /v1/webhooks* do not.
| Endpoint | Method | Description |
|---|---|---|
/v1/orders/preview | POST | Preview an order: estimated total, availability check — no order created, no money deducted |
/v1/orders | POST | Create a real order on the platform |
/v1/orders | GET | List the current user’s orders (paginated) |
/v1/orders/stats | GET | Aggregate order statistics by date range / status |
/v1/orders/:id | GET | Order details — auto-syncs the latest status from the platform on every call |
/v1/orders/:id/cancel | POST | Send a cancellation request — the platform decides the outcome (see below) |
/v1/orders/:id/logistic-detail?package_id=<int> | GET | Domestic China shipping tracking (Taobao: package_id required; 1688: optional) |
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 | Yes (create order) | Anti-duplicate key, up to 128 characters; missing → 400. Resending the same key and the same content returns the original order; the same key with different content → 409 IDEMPOTENCY_KEY_PAYLOAD_MISMATCH. Use a new key for every checkout |
client_order_id | string | No | A reference code on your side. It is stored and counts toward the idempotency content match, but is not returned in the response and cannot be used to filter the order list. Keep your own mapping between ORD... and your code |
promotion_id | string | No | Promotion code |
remark | string | No | Note for the seller |
auto_pay | boolean | No | true: pay from the purchasing wallet as soon as the order is created, without a separate payment request. Default false. Cannot be changed after the order is created |
line_items[]
Each element identifies an item by the product_ref + sku_ref pair, taken directly from product search / details.
| 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 that preview returns exact figures |
The
mp_id+mp_skuidpair (marketplace IDs) is still accepted for backward compatibility.
receiver_address
| Field | Required | Description |
|---|---|---|
name | Yes | Recipient name |
phone | Yes | Landline number |
mobile | Yes | Mobile number |
address | Yes | Detailed address (in Chinese) |
province / city / area | Recommended | Province / City / District |
town | No | Subdistrict / town |
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. Does not include the Elim service fee — the fee is calculated when the payment request is sent (see Service fee) |
unavailable_items[] | Items that cannot be ordered (out of stock / wrong SKU / discontinued). 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": [
{ "product_id": "734467086498", "sku_id": "5578084256927", "quantity": 2, "amount": 31.0 }
]
}
]
}
}
| Field | Description |
|---|---|
data.id | Internal order ID in the form ORD + 10 digits — use it for every later operation |
status | pending_payment on success; unknown when the platform refused to create the order — stop the payment flow. If the outcome is genuinely undetermined, the request may return an error instead of this response: check GET /v1/orders before retrying, and do not create a new order with a different key |
data.order_list[] | Shop + line-item details from the platform — use them to build a receipt |
data.payment_status | unpaid by default; approved when the order was paid from the wallet through auto_pay |
data.auto_pay_error | Only when auto_pay: true was sent but the order could not be paid: insufficient_balance (wallet too low) or not_applicable. The order is still created as unpaid; top up, then request payment as usual |
Without auto_pay, a new order is at payment_status = unpaid. With auto_pay: true and enough wallet balance, it goes straight to approved (money held), skipping the payment request and the wait for approval.
Order list — 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 — leave empty for both |
status | string | Filter by platform status |
payment_status | string | Filter by Elim payment status |
internal_order_id | string | Filter by ORD... ID |
platform_order_id | string | Filter by platform order code |
order_id[] | string[] | Filter by multiple platform order codes |
created_from / created_to | ISO date | Creation date range |
Response: { total, page, size, items: OrderListItem[] }.
{
"total": 1,
"page": 1,
"size": 20,
"items": [
{
"id": "ORD0000000123",
"order_id": "123456789",
"platform": "alibaba",
"status": "paid",
"payment_status": "paid",
"platform_payment_status": "success",
"amount": 39.0,
"total_amount_cny": 39.0,
"receiver_address": { "name": "Nguyen Van A", "mobile": "13800138000", "address": "..." },
"line_items": [
{ "product_id": "734467086498", "sku_id": "5578084256927", "quantity": 2, "amount": 31.0 }
],
"preview": {
"shop_name": "广州某某贸易有限公司",
"goods_amount": 31.0,
"post_fee": 8.0,
"enriched": true,
"lines": []
},
"created_at": "2026-04-09T10:30:00.000Z",
"updated_at": "2026-04-09T10:35:00.000Z"
}
]
}
preview is a summary for building the list (shop name, recipient, goods amount, shipping fee, and line items with name/image when available). total_amount_cny is the total the customer pays Elim and may be null before a payment request exists.
line_items/previewin the list are a snapshot taken when the order was created. For the latest data, callGET /v1/orders/:id.
Order details — differences by platform
GET /v1/orders/:id — automatically syncs the status from the platform before returning.
| 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 logistic-detail endpoint also works for 1688 orders (package_id or tracking_number to filter parcels); add lang=vi|en to translate the shipping content.
Order details also include rejection_reason (when Elim rejects a payment request) and payment_request_available (when the order can have a payment request sent).
The platform field is already present in the list response — save it to choose how to display an order before calling the details.
package_id is an integer taken from the Taobao order details response, not the ORD... ID.
Cancelling an order
POST /v1/orders/:id/cancel — Elim does not block by status (except a closed order, which returns 409): the cancellation request is forwarded to the platform, and the platform decides. In your interface, only allow cancelling when status is creating or pending_payment; in other statuses the platform usually refuses.
| Situation | Response / outcome |
|---|---|
| The order has no platform order code yet | { "success": true, "message": "Internal order cancelled, no external order to cancel", "internal_order_id": ... } — status = cancelled |
The order is already cancelled | { "success": true, "already_cancelled": true, "internal_order_id": ... } (safe to call again) |
The order is closed | HTTP 409 — the order was paid and closed after a refund, so it cannot be cancelled |
| The platform accepts | status = cancelled |
| The platform refuses | Response success: false, status = cancellation_failed |
| Outcome undetermined | status = cancellation_pending, error (outcome unclear) — call GET /v1/orders/:id to see the result, and do not cancel repeatedly |
Cancelling does not automatically refund. Money held for a payment request (
requested/approved) is released automatically when the order is cancelled on the platform. For an order that is alreadypaid, the money does not return to the wallet on cancellation: see Refunds.
Service fee
The total you pay Elim for each order = goods amount + domestic shipping fee + Elim service fee. The service fee is calculated on the goods amount, according to the configuration assigned to your account:
- Percentage type (
goods amount × rate) or fixed. - There may be a minimum and a maximum per order.
- An account may have its own configuration; otherwise the general configuration applies.
The fee is quoted when the payment request is sent (service_fee_cny in request-payment) and recorded in the wallet transaction (service_fee_cny). Contact Elim for the rate that applies to your account.
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 currently applied |
GET /v1/purchasing/wallet
{
"balance": 1670.3,
"frozen_balance": 286.5,
"available_balance": 1383.8,
"total_deposited": 5000.0,
"total_spent": 3329.7,
"updated_at": "2026-06-19T00:00:00.000Z"
}
| Field | Description |
|---|---|
balance | Total CNY balance |
frozen_balance | Held for requested / approved orders |
available_balance | balance − frozen_balance — the amount actually usable. Compare this number against the order value |
total_deposited / total_spent | Cumulative figures |
GET /v1/purchasing/wallet/transactions
Parameters: page, size, type, date_from, date_to. Response: { total, page, size, items }. Each transaction has type, amount, balance_before, balance_after, status (pending / completed / failed / cancelled), reference_type, reference_id, service_fee_cny, note, created_at.
type | Meaning |
|---|---|
deposit | Top-up into the wallet |
order_freeze | Funds held when a payment request is sent |
order_unfreeze | Funds released when a request is withdrawn or rejected |
order_deduction | Funds deducted when order payment completes |
order_refund | Money returned to the wallet — distinguish the source by reference_type (table below) |
admin_adjustment | Manual balance adjustment by Elim |
Sources of order_refund (reference_type):
reference_type | Source |
|---|---|
platform_payment_failed | Platform payment clearly failed — all held funds are returned |
platform_discount | The final order price was lower than the amount you held (price change / discount / bargaining) — the difference is returned |
refund_request | Money returned from a per-line-item refund request (Refunds) |
order | Elim refunded the entire paid order |
GET /v1/purchasing/exchange-rates
List of exchange rates currently applied for each top-up currency (VND, USD → CNY): source_currency, target_currency (always CNY), rate (the rate Elim applies), updated_at.
Order payment endpoints
Prefix /v1/purchasing/orders/:id. :id takes the ORD... form.
| Endpoint | Method | From status | To status | Description |
|---|---|---|---|---|
/request-payment | POST | unpaid / rejected | requested | Confirm the order and send a payment request — holds funds in the wallet |
/cancel-payment-request | POST | requested | unpaid | Withdraw the request — releases the held funds |
/confirm | POST | unpaid | paid | Direct payment — off by default, returns 403 Direct payment is not available. Use request-payment |
/payment | GET | — | — | Details of the order’s payment record |
POST …/request-payment
{
"success": true,
"order_id": "ORD0000000123",
"frozen_amount": 286.5,
"goods_amount_cny": 281.5,
"shipping_fee_cny": 0,
"service_fee_cny": 5.0
}
Insufficient wallet balance error — 400:
{
"error": "insufficient_balance",
"current_balance": 120.0,
"frozen_balance": 30.0,
"available_balance": 90.0,
"required": 286.5,
"deficit": 196.5
}
POST …/confirm
{
"order_id": "ORD0000000123",
"goods_amount_cny": 281.5,
"shipping_fee_cny": 0,
"service_fee_cny": 5.0,
"total_amount_cny": 286.5,
"payment_status": "paid",
"wallet_balance_after": 1383.8
}
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 action | From | To | Wallet effect |
|---|---|---|---|
| Approve the request | requested | approved | Funds stay held |
| Reject the request | requested | rejected | Held funds released; rejection_reason gives the reason |
| Platform payment succeeds | approved | paid | Held funds deducted; platform_payment_status = success |
| Platform payment clearly fails | approved | unpaid | platform_payment_status = failed; held funds fully returned (order_refund, platform_payment_failed) — you can resend the request |
| Order cancelled on the platform while funds are held | requested / approved | unpaid | Held funds released (periodic check, ~10 minutes) |
| Refund the entire order | paid | refunded | Added back to balance; an order_refund transaction is generated (reference_type = order) |
Receiving order updates via webhook
Register a webhook so Elim calls 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 changes: sync from the platform, periodic sync, or order cancellation |
payment.updated | payment_status changes: request sent, request withdrawn, approved, rejected, platform payment succeeded/failed, or refund |
The payload carries a snapshot of the order: data.order.id, status, payment_status, platform_payment_status, total_amount_cny, updated_at. Return HTTP 2xx once processed.
Registration endpoints, the full payload structure, headers, HMAC signature verification, and the retry policy: see the Webhook Reference.
Error codes
| HTTP | Situation | What to do on your side |
|---|---|---|
400 | Missing / too long idempotency_key | Send a key of ≤ 128 characters |
400 | insufficient_balance | Top up the deficit in CNY, then 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 that does not belong to the account | Only act on your own orders |
404 | Order / payment record does not exist | Re-check the ORD... ID |
409 | IDEMPOTENCY_KEY_PAYLOAD_MISMATCH | Same idempotency_key but different content — use a new key or resend the original content |
409 | Payment unavailable for this order | The order is one you pay the platform for yourself — do not use the wallet flow |
409 | ORDER_TEMPORARILY_UNAVAILABLE | Elim cannot process the order right now — try again later |
409 | ORDER_RESULT_PENDING | Elim is still confirming the result — check the order again later, do not create a duplicate |
409 | ORDER_OPERATION_IN_PROGRESS | The same operation is already running — wait, then check again |
409 | ORDER_OPERATION_FAILED | Elim could not complete the operation — try again later |
422 | LINE_ITEM_SKU_NOT_RESOLVABLE / LINE_ITEM_PRODUCT_NOT_RESOLVABLE (Taobao) | Wrong sku_ref / product_ref — retrieve it again from the product details |
429 | Rate limit exceeded | Wait ~60 seconds and space out your calls |
5xx | System error or the platform is temporarily unresponsive | Retry later; do not create a duplicate order. If it persists, send the Elim team the order ID (ORD...) and the time it occurred |
Error responses have the form { statusCode, message, error }. message is sometimes in Vietnamese and can be displayed directly.
ID conventions
- Internal order ID:
ORD+ 10 digits, for exampleORD0000000123. Used for every endpoint. - Platform order code (
order_id): issued by Taobao/1688, only available after the order is successfully created. package_id: an integer, used for Taobao shipping tracking.
Related links
- Guide to placing & paying for Taobao/1688 orders — step-by-step workflow
- Refunds — per-line-item refunds, and the paths by which money returns to the wallet
- Webhook Reference — receive
order.updated/payment.updatedupdates - Authenticating API requests
- Full API Reference