Skip to main content
Elimapi

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.

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 has been cancelled
unknownCould 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.

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, 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.

ValueDescription
pendingSending the payment instruction to the platform
successThe platform recorded the payment
failedThe platform reported an error — Elim will handle it manually
unknownResult not yet determined

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. Rate limits are per second window.

EndpointMethodDescriptionRate limit
/v1/orders/previewPOSTPreview an order: estimated total, availability check — no order created, no money deducted20 / 60s
/v1/ordersPOSTCreate a real order on the platform10 / 60s
/v1/ordersGETList the current user’s orders (paginated)30 / 60s
/v1/orders/statsGETAggregate order statistics by date range / status30 / 60s
/v1/orders/:idGETOrder details — auto-syncs the latest status from the platform on every call30 / 60s
/v1/orders/:id/cancelPOSTCancel an order while it is still in a cancellable state10 / 60s
/v1/orders/:id/logistic-detail?package_id=<int>GETDomestic 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"
}
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_keystringRecommendedAnti-duplicate key per checkout. A repeated request with the same key returns the same order
client_order_idstringNoOrder code from your own system (auto-generated if omitted)
promotion_idstringNoPromotion code
remarkstringNoNote for the seller

line_items[]

Each element identifies an item by the product_ref + sku_ref pair, taken directly from product search / detail.

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 the preview returns exact figures

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

receiver_address

FieldRequiredDescription
nameYesRecipient name
phoneYesLandline phone number
mobileYesMobile number
addressYesDetailed address (in Chinese)
province / city / areaRecommendedProvince / City / District
townNoWard / 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": []
}
FieldDescription
total_product_amountTotal goods amount (CNY)
total_post_feeTotal domestic China shipping fee
total_amountTotal 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 }
        ]
      }
    ]
  }
}
FieldDescription
data.idInternal order ID in the form ORD + 10 digits — used for every later operation
statuspending_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

ParameterTypeDescription
pagenumberCurrent page (default 1)
sizenumberOrders per page (default 20)
platformstringtaobao / alibaba — empty = both
statusstringFilter by platform status
payment_statusstringFilter by Elim payment status
client_order_idstringFilter by your own order code
created_from / created_toISO dateCreation 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 / products in the list are a snapshot from order creation. For the latest data, call GET /v1/orders/:id.

Order detail — differences by platform

GET /v1/orders/:id — auto-syncs the status from the platform before responding.

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

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

GET /v1/purchasing/wallet/transactions

Parameters: page, size, type, date_from, date_to. Response: { total, page, size, items }.

typeMeaning
depositTop-up into the wallet
order_freezeMoney held when a payment request is sent
order_unfreezeMoney released when the request is withdrawn or rejected
order_deductionMoney deducted when order payment completes
order_refundOrder refunded to the wallet
admin_adjustmentElim 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.

EndpointMethodFrom statusTo statusDescription
/request-paymentPOSTunpaidrequestedConfirm the order and send a payment request — holds money in the wallet
/cancel-payment-requestPOSTrequestedunpaidWithdraw the request — releases the held money
/confirmPOSTunpaidpaidDirect payment (where enabled) — deducts money immediately, no approval step
/paymentGETDetails 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 operationFromToWallet effect
Approve requestrequestedapprovedMoney stays held
Reject requestrequestedrejectedHeld money released; rejection_reason gives the reason
Platform payment succeededapprovedpaidHeld money deducted; platform_payment_status = success
Platform payment failedapprovedunpaidplatform_payment_status = failed; Elim reaches out to resolve it
RefundpaidrefundedAdded 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:

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

HTTPSituationWhat to do
400insufficient_balanceTop up deficit more CNY and 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 not on your accountOnly operate on your own orders
404Order / payment record not foundRe-check the ORD... ID
422LINE_ITEM_SKU_NOT_RESOLVABLE / LINE_ITEM_PRODUCT_NOT_RESOLVABLE (Taobao)Wrong sku_ref / product_ref — fetch them again from product detail
429Rate limit exceededWait ~60 seconds and pace your calls
502Taobao/1688 platform not respondingRetry; 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.