Skip to main content
Elim Asia

Webhook Reference

Summary

Register an HTTPS endpoint so Elim proactively calls your system whenever an order or payment changes status — instead of polling for status. This page describes the events, management endpoints, payload structure, how to verify signatures, and the retry policy.

To see where webhooks fit in the order lifecycle, see the Guide to placing & paying for Taobao/1688 orders and the Order API Reference.

Every endpoint requires JWT authentication (Authorization: Bearer <token>) or an API Key (x-api-key).

Events

EventWhen it is sent
order.updatedThe order status (status) changes, the order total changes, or the platform confirms payment: sync from the platform, periodic sync, or order cancellation
payment.updatedThe payment status (payment_status) changes: request sent, request withdrawn, approved, rejected, platform payment succeeded/failed, automatic refund (platform payment failed, discount difference refunded), or Elim refunds the entire order

You only receive the events you subscribe to. Most people subscribe to both.

There is no webhook yet for per-line-item refund requests (/v1/refunds*). Poll GET /v1/refunds/:id periodically — see Refunds.

Subscription management endpoints

Prefix /v1/webhooks.

EndpointMethodDescription
/v1/webhooksGETList existing subscriptions
/v1/webhooksPOSTCreate a subscription — returns the secret only once
/v1/webhooks/:idPATCHEdit url, events, or is_active
/v1/webhooks/:idDELETEDelete a subscription
/v1/webhooks/:id/rotate-secretPOSTChange the secret — returns the new value once
/v1/webhooks/:id/deliveriesGETLog of up to the 50 most recent deliveries (newest first): status, attempt_count, response_status, last_error
/v1/webhooks/:id/testPOSTSend a test call to the registered url (body { "event": "order.updated" }). The test payload has data: { "test": true } instead of data.order — make sure you can handle this case

Create-subscription body

{
  "url": "https://your-system.example/webhooks/elim",
  "events": ["order.updated", "payment.updated"],
  "is_active": true
}

The secret (in the form whsec_...) is only returned right after creation or rotate-secret. Store it somewhere safe — you need it to verify every request. If you lose the secret, call rotate-secret to issue a new one: the old secret becomes invalid immediately, with no transition period, so update your receiving system right after rotating.

Each account may have at most 5 active subscriptions; exceeding this → 400. An invalid or empty events → 400.

Payload structure

Both events share one shape — they differ in the event field:

{
  "id": "evt_4a1f2c...",
  "event": "payment.updated",
  "created_at": "2026-06-19T00:00:00.000Z",
  "data": {
    "order": {
      "id": "ORD0000000123",
      "platform": "taobao",
      "order_id": "123456789",
      "status": "paid",
      "payment_status": "paid",
      "platform_payment_status": "success",
      "total_amount_cny": 123.45,
      "updated_at": "2026-06-19T00:00:00.000Z"
    }
  }
}
FieldDescription
idEvent ID, in the form evt_... — use it to avoid duplicate processing
eventorder.updated or payment.updated
created_atWhen the event was generated (ISO 8601)
data.order.idInternal order ID ORD... — the key for looking up the order in your system
data.order.platformtaobao or alibaba (1688)
data.order.order_idPlatform order code (may be null if not yet fully created on the platform)
data.order.statusPlatform status — see the status table
data.order.payment_statusElim payment status — see the payment_status table
data.order.platform_payment_statusPlatform-side payment result
data.order.total_amount_cnyOrder amount (CNY), may be null
data.order.updated_atThe order’s most recent update (ISO 8601)

What to do on your side: look up data.order.id, update the order status in your system, then return HTTP 2xx. Payloads may arrive out of order — always trust the newer updated_at and ignore events older than the state you already hold.

Headers on every call

HeaderValue
Content-Typeapplication/json
User-Agentelim-api-webhooks/1.0
X-Elim-EventEvent name
X-Elim-DeliveryDelivery record ID — stays the same across retries of the same event
X-Elim-TimestampUnix time, in seconds
X-Elim-Signaturesha256=<hmac>

Verifying the signature

Signing string: "{X-Elim-Timestamp}.{raw_json_body}" — use the raw body exactly as received, not parsed and re-serialized.

Algorithm: HMAC-SHA256(secret, signing_string), compared with the part after sha256= in X-Elim-Signature using a timing-safe comparison function.

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyElimWebhook(
  secret: string,
  timestamp: string,
  rawBody: string,
  signature: string,
): boolean {
  const expected = `sha256=${createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`)
    .digest('hex')}`;
  return timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

The secret is used as-is (including the whsec_ prefix) as the HMAC key. Elim does not check the time on the receiving side — you should reject requests whose X-Elim-Timestamp is too far from the current time (for example more than 5 minutes) to limit replay.

Retry policy

ConditionResult
Response 2xxMarked as successful
Timeout / network error / non-2xx codeRetry is scheduled
First attemptImmediately when the event occurs
Total attempts3
Spacing between attempts60 seconds, then 300 seconds
Timeout per request10 seconds

Retries are swept every minute, so the actual delay may be up to ~1 minute beyond the 60/300-second marks. All three attempts use the same event id (evt_...) and the same X-Elim-Delivery — use the id to avoid duplicate processing. See the result of each delivery at GET /v1/webhooks/:id/deliveries. Use POST /v1/webhooks/:id/test to quickly check your receiving configuration.

Security

  • The URL in the production environment must be HTTPS. The dev environment accepts localhost.
  • Internal / private / metadata IPs are blocked in production.
  • The secret is only shown after creation or rotate-secret.
  • The payload does not contain passwords, API keys, JWTs, or platform access tokens.

If you have not set up webhooks

Query the status directly at any time with GET /v1/orders/:id — on every call, Elim automatically syncs the latest status from the platform before returning. See the Order API Reference.