Skip to main content
Elim Asia

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.

ValueDescription
creatingOrder just initiated, waiting for the platform to confirm
pending_paymentPlatform created the order, awaiting payment
paidOrder paid on the platform side
shippedGoods shipped from the warehouse, in transit
completedOrder completed, receipt confirmed
cancelledOrder was cancelled before the platform took payment
closedOrder 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
unknownCould 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_pendingCancellation request sent, waiting for the platform to confirm
cancellation_failedThe platform refused the cancellation — the order is unchanged; you can resend the payment request or cancel again
route_unknownThe outcome of order creation could not be determined (failure midway) — re-check with the order details, do not create a duplicate order
preview_finalization_pendingThe order is waiting to be finalized from a preview
expiredA 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.

ValueDescriptionMoney in wallet
unpaidDefault when the order is created — no payment request sent yetNot affected
requestedThe user has sent a payment requestHeld (frozen_balance)
approvedElim approved the request and is paying the platformStill held
paidPayment completedDeducted from balance
rejectedElim rejected the request (rejection_reason gives the reason)Released back
refundedA paid order was refunded to the walletAdded 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.

ValueDescription
pendingSending the payment instruction to the platform
successThe platform recorded the payment
failedThe platform reported a clear error — the held funds are automatically returned to the wallet, and the order goes back to unpaid
unknownResult not yet determined (timeout, lost connection) — the order stays approved, and Elim reconciles with the platform before concluding

Always show both status and payment_status in your interface. platform_payment_status is 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.

EndpointMethodDescription
/v1/orders/previewPOSTPreview an order: estimated total, availability check — no order created, no money deducted
/v1/ordersPOSTCreate a real order on the platform
/v1/ordersGETList the current user’s orders (paginated)
/v1/orders/statsGETAggregate order statistics by date range / status
/v1/orders/:idGETOrder details — auto-syncs the latest status from the platform on every call
/v1/orders/:id/cancelPOSTSend a cancellation request — the platform decides the outcome (see below)
/v1/orders/:id/logistic-detail?package_id=<int>GETDomestic 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"
}
FieldTypeRequiredDescription
platformstringYestaobao or alibaba (1688)
receiver_addressAddressYesA valid shipping address in China
warehouse_addressAddressNoThe dispatch warehouse address
line_itemsLineItem[]YesList of items (see below)
preview_tokenstringNoToken from preview; single-use, expires after 10 minutes. Pass it when creating the order to lock in the price you previewed
idempotency_keystringYes (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_idstringNoA 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_idstringNoPromotion code
remarkstringNoNote for the seller
auto_paybooleanNotrue: 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.

FieldTypeRequiredDescription
product_refstringYesProduct ID or link from the product search response
sku_refstringYesThe matching SKU ID — Taobao: skus[].id · 1688: skus[].spec_id
quantitynumberYesQuantity
pricenumberNoUnit price in CNY — recommended so that preview returns exact figures

The mp_id + mp_skuid pair (marketplace IDs) is still accepted for backward compatibility.

receiver_address

FieldRequiredDescription
nameYesRecipient name
phoneYesLandline number
mobileYesMobile number
addressYesDetailed address (in Chinese)
province / city / areaRecommendedProvince / City / District
townNoSubdistrict / 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": []
}
FieldDescription
total_product_amountTotal goods amount (CNY)
total_post_feeTotal domestic China shipping fee
total_amountTotal 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 }
        ]
      }
    ]
  }
}
FieldDescription
data.idInternal order ID in the form ORD + 10 digits — use it for every later operation
statuspending_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_statusunpaid by default; approved when the order was paid from the wallet through auto_pay
data.auto_pay_errorOnly 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

ParameterTypeDescription
pagenumberCurrent page (default 1)
sizenumberOrders per page (default 20)
platformstringtaobao / alibaba — leave empty for both
statusstringFilter by platform status
payment_statusstringFilter by Elim payment status
internal_order_idstringFilter by ORD... ID
platform_order_idstringFilter by platform order code
order_id[]string[]Filter by multiple platform order codes
created_from / created_toISO dateCreation 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 / preview in the list are a snapshot taken when the order was created. For the latest data, call GET /v1/orders/:id.

Order details — differences by platform

GET /v1/orders/:id — automatically syncs the status from the platform before returning.

PlatformItem listShipping
1688products[]logistics.logistics_info[] embedded in the response
Taobaoline_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.

SituationResponse / 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 closedHTTP 409 — the order was paid and closed after a refund, so it cannot be cancelled
The platform acceptsstatus = cancelled
The platform refusesResponse success: false, status = cancellation_failed
Outcome undeterminedstatus = 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 already paid, 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.

EndpointMethodDescription
/v1/purchasing/walletGETWallet balance
/v1/purchasing/wallet/transactionsGETTransaction history (paginated)
/v1/purchasing/exchange-ratesGETExchange 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"
}
FieldDescription
balanceTotal CNY balance
frozen_balanceHeld for requested / approved orders
available_balancebalance − frozen_balance — the amount actually usable. Compare this number against the order value
total_deposited / total_spentCumulative 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.

typeMeaning
depositTop-up into the wallet
order_freezeFunds held when a payment request is sent
order_unfreezeFunds released when a request is withdrawn or rejected
order_deductionFunds deducted when order payment completes
order_refundMoney returned to the wallet — distinguish the source by reference_type (table below)
admin_adjustmentManual balance adjustment by Elim

Sources of order_refund (reference_type):

reference_typeSource
platform_payment_failedPlatform payment clearly failed — all held funds are returned
platform_discountThe final order price was lower than the amount you held (price change / discount / bargaining) — the difference is returned
refund_requestMoney returned from a per-line-item refund request (Refunds)
orderElim 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.

EndpointMethodFrom statusTo statusDescription
/request-paymentPOSTunpaid / rejectedrequestedConfirm the order and send a payment request — holds funds in the wallet
/cancel-payment-requestPOSTrequestedunpaidWithdraw the request — releases the held funds
/confirmPOSTunpaidpaidDirect payment — off by default, returns 403 Direct payment is not available. Use request-payment
/paymentGET——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 actionFromToWallet effect
Approve the requestrequestedapprovedFunds stay held
Reject the requestrequestedrejectedHeld funds released; rejection_reason gives the reason
Platform payment succeedsapprovedpaidHeld funds deducted; platform_payment_status = success
Platform payment clearly failsapprovedunpaidplatform_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 heldrequested / approvedunpaidHeld funds released (periodic check, ~10 minutes)
Refund the entire orderpaidrefundedAdded 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:

EventWhen it is sent
order.updatedThe order’s status changes: sync from the platform, periodic sync, or order cancellation
payment.updatedpayment_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

HTTPSituationWhat to do on your side
400Missing / too long idempotency_keySend a key of ≤ 128 characters
400insufficient_balanceTop up the deficit in CNY, then resend the request
400Cannot request payment: current status is "..."The order is no longer at unpaid
400Invalid platform ID formatCheck product_ref / sku_ref
401JWT expiredGet a new token
403Accessing an order that does not belong to the accountOnly act on your own orders
404Order / payment record does not existRe-check the ORD... ID
409IDEMPOTENCY_KEY_PAYLOAD_MISMATCHSame idempotency_key but different content — use a new key or resend the original content
409Payment unavailable for this orderThe order is one you pay the platform for yourself — do not use the wallet flow
409ORDER_TEMPORARILY_UNAVAILABLEElim cannot process the order right now — try again later
409ORDER_RESULT_PENDINGElim is still confirming the result — check the order again later, do not create a duplicate
409ORDER_OPERATION_IN_PROGRESSThe same operation is already running — wait, then check again
409ORDER_OPERATION_FAILEDElim could not complete the operation — try again later
422LINE_ITEM_SKU_NOT_RESOLVABLE / LINE_ITEM_PRODUCT_NOT_RESOLVABLE (Taobao)Wrong sku_ref / product_ref — retrieve it again from the product details
429Rate limit exceededWait ~60 seconds and space out your calls
5xxSystem error or the platform is temporarily unresponsiveRetry 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 example ORD0000000123. 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.