Elimapi Docs

Order API Guide

This feature currently only supports the Vietnamese market. We will add support for other markets in the future. Please stay tuned for updates.

The Order API allows you to create and manage proxy purchasing orders on Taobao and 1688 (Alibaba). Each order maintains two independent statuses: the platform status (status) returned by Taobao/1688, and the Elim payment status (payment_status) managed by the purchasing wallet system.

All endpoints require JWT authentication via the Authorization: Bearer <token> header or API Key (X-API-KEY).

Authentication guide: Authentication

Order Statuses

Before using the API, understand the two status dimensions of an order to avoid confusion when displaying to end users.

Platform Status (status)

Reflects the processing progress of the order on Taobao or 1688.

ValueDescriptionPlatform
creatingOrder just initiated, waiting for platform to confirmβœ… Taobao βœ… 1688
pending_paymentPlatform created the order, awaiting paymentβœ… Taobao βœ… 1688
paidOrder paid on the platformβœ… Taobao βœ… 1688
shippedGoods shipped from warehouse, in transitβœ… Taobao βœ… 1688
completedOrder completed, buyer confirmed receiptβœ… Taobao βœ… 1688
cancelledOrder has been cancelledβœ… Taobao βœ… 1688
unknownCould not parse status from platformβœ… Taobao βœ… 1688

Elim Payment Status (payment_status)

Reflects whether the order has been paid to Elim. This is independent of status β€” an order can be at status=shipped but still payment_status=unpaid if there is an issue.

ValueDescription
unpaidNot yet paid β€” default when order is created
paidPurchasing wallet successfully deducted
refundedRefunded to wallet after order was cancelled
Always display both `status` and `payment_status` fields in your interface. Do not merge them into a single status β€” users need to know both the order progress and payment state.

Preview Order

View details: Preview order

Before creating a real order, call the preview endpoint to get the estimated total and check item availability. This step does not create an order or deduct funds β€” it only returns information for the user to confirm before checkout.

Rate limit: 20 requests / 60 seconds

POST /v1/orders/preview

Body:

{
  "platform": "alibaba",
  "receiver_address": {
    "name": "Nguyen Van A",
    "phone": "02812345678",
    "mobile": "13800138000",
    "address": "εΉΏε·žεΈ‚ε€©ζ²³εŒΊδ½“θ‚²θ₯Ώθ·―123号",
    "province": "广东省",
    "city": "εΉΏε·žεΈ‚",
    "area": "倩河区"
  },
  "line_items": [
    {
      "mp_id": "734467086498",
      "id": "5578084256927",
      "quantity": 2,
      "price": 15.5
    }
  ]
}
The receiver address must be a valid address in China.

line_items Field Explanation

FieldTypeRequiredDescription
mp_idstringYesProduct ID β€” mp_id (Taobao) / offerId (1688)
idstringYesSKU ID β€” mp_skuid (Taobao) / spec_id (1688)
quantitynumberYesPurchase quantity
pricenumberNoUnit price in CNY β€” required for accurate preview

Handling unavailable_items

The response returns an unavailable_items array containing products that cannot be ordered (out of stock, invalid SKU, discontinued). Do not allow order creation if this array is non-empty β€” ask users to resolve the problematic items first.

{
  "unavailable_items": [{ "mp_id": "123456", "id": "sku_789", "reason": "out_of_stock" }]
}

Optional Parameters

ParameterDescriptionPlatform
remarkNotes attached to the orderβœ… Taobao βœ… 1688
promotion_idPromotion program IDβœ… Taobao βœ… 1688

Create Order

View details: Create order

Creates a real order on the platform. The body is identical to preview β€” use data already validated from the preview step to create the order and avoid discrepancies.

Rate limit: 10 requests / 60 seconds

POST /v1/orders

After successful creation, redirect the user to the order detail page (/orders/ORD...). Do not keep the user on the cart page since the order has already been submitted to the platform.

Response Handling

FieldDescription
data.idInternal ID in ORD0000000001 format β€” use for all subsequent actions
statuspending_payment if successful; unknown if an error occurred
data.order_list[]Shop + product details from the platform β€” use to display receipt
If the response returns `status: "unknown"`, display a warning to the user: "Order may not have been created β€” please contact support." Do not continue the payment flow in this case.

ID Convention: Elim IDs always follow the ORD + 10 digits format (e.g., ORD0000000123). A successfully created order will also have the platform’s order_id.

List Orders

View details: List orders

Returns the order list for the current user (identified via JWT). Results are paginated.

Rate limit: 30 requests / 60 seconds

GET /v1/orders

Filter Parameters

ParameterTypeDescription
pagenumberCurrent page β€” default 1
sizenumberItems per page β€” default 20
platformstringtaobao or alibaba β€” omit for both
statusOrderStatusFilter by platform status
created_fromISO dateFilter from date
created_toISO dateFilter to date

Response: { total, page, size, items: OrderListItem[] }

The `line_items` field in the list is a snapshot taken when the order was created. To get the most accurate and up-to-date order information, call `GET /v1/orders/:id`.

Order Detail

View details: Order detail

Returns the complete and most up-to-date information for an order.

Rate limit: 30 requests / 60 seconds

GET /v1/orders/:id

Pass the ID in ORD... format.

Response Differences Between Taobao and 1688

The two platforms return different data structures β€” handle them separately:

PlatformProductsLogistics
1688products[]logistics.logistics_info[] β€” embedded in the response
Taobaoline_items[]Must call GET /v1/orders/:packageId/logistic-detail separately

The platform field is available in the list response β€” cache it from the list view so you know which component to render before calling detail.

Cancel Order

View details: Cancel order

Cancels an order that is in a cancellable status. After the system successfully cancels, call GET /v1/orders/:id again to get the latest status.

Rate limit: 10 requests / 60 seconds

POST /v1/orders/:id/cancel

Condition: Can only cancel when status is creating or pending_payment. Disable the cancel button for all other statuses.

If the order does not yet have a platform order ID (platform hasn't processed it yet), the system returns `{ success: true, message: 'Internal order cancelled, no external order to cancel' }` β€” the order has been cancelled in Elim API but no action was taken on Taobao/1688.

Logistics Tracking

View details: Logistic detail

Returns domestic China shipping tracking information. Taobao only β€” 1688 orders already have logistics.logistics_info[] embedded in the order detail response.

Rate limit: 20 requests / 60 seconds

GET /v1/orders/:packageId/logistic-detail

packageId is an integer, obtained from the Taobao order detail response β€” not the ORD... format ID.

Order Payment

Elim acts as a purchasing agent: users pay Elim through a purchasing wallet (denominated in CNY), and Elim pays the platform outside the system. Full flow:

Preview β†’ Create order (payment_status=unpaid) β†’ Confirm wallet payment β†’ payment_status=paid

Check Wallet Balance

GET /v1/purchasing/wallet

Response: { balance, frozen_balance, available } β€” available = balance - frozen_balance.

Confirm Payment

POST /v1/purchasing/orders/:id/confirm

The system checks the wallet β†’ deducts funds β†’ updates payment_status = paid.

Success response (200):

{
  "order_id": "ORD0000000001",
  "goods_amount_cny": 299.0,
  "shipping_fee_cny": 15.0,
  "service_fee_cny": 15.7,
  "total_amount_cny": 329.7,
  "paid_at": "2026-04-13T10:00:00.000Z",
  "balance_after": 1670.3
}

Use balance_after to update the wallet balance in local state without calling GET /v1/purchasing/wallet again.

Handling Insufficient Balance

When the wallet has insufficient funds, the system returns 400 with body:

{
  "error": "insufficient_balance",
  "deficit": 50.3,
  "current_balance": 279.4,
  "required": 329.7
}

Display a modal showing how much CNY is needed and guide the user to top up. The top-up process is handled outside the system (bank transfer) β€” admin confirms and credits the wallet manually.

Service Fee

Service fee formula: max(order_total Γ— fee_percent, min_fee). The percentage and minimum are configured by admin.

Wallet Transaction History

GET /v1/purchasing/wallet/transactions
ParameterDescription
pagePage number
sizeItems per page
typedeposit / order_deduction / order_refund / admin_adjustment
date_fromFilter from date (ISO date)
date_toFilter to date (ISO date)

Exchange Rates

GET /v1/purchasing/exchange-rates

Returns the current exchange rates VND β†’ CNY and USD β†’ CNY configured by Elim. Display this to users before they top up.

Error Handling

HTTPSituationHandle on your side
400insufficient_balanceNotify user that wallet balance is insufficient
400Invalid platform ID formatShow validation error message
401JWT expiredNotify session expired, prompt user to log in again
404Order not foundDisplay order not found state
429Rate limitNotify rate limit error, ask user to retry later
502Taobao/1688 platform not respondingShow error message, ask user to retry

All error responses follow the shape { statusCode, message, error }. Messages are sometimes in Vietnamese β€” they can be displayed directly to the user.