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
| Event | When it is sent |
|---|---|
order.updated | The order status (status) changes, the order total changes, or the platform confirms payment: sync from the platform, periodic sync, or order cancellation |
payment.updated | The 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*). PollGET /v1/refunds/:idperiodically — see Refunds.
Subscription management endpoints
Prefix /v1/webhooks.
| Endpoint | Method | Description |
|---|---|---|
/v1/webhooks | GET | List existing subscriptions |
/v1/webhooks | POST | Create a subscription — returns the secret only once |
/v1/webhooks/:id | PATCH | Edit url, events, or is_active |
/v1/webhooks/:id | DELETE | Delete a subscription |
/v1/webhooks/:id/rotate-secret | POST | Change the secret — returns the new value once |
/v1/webhooks/:id/deliveries | GET | Log of up to the 50 most recent deliveries (newest first): status, attempt_count, response_status, last_error |
/v1/webhooks/:id/test | POST | Send 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"
}
}
}
| Field | Description |
|---|---|
id | Event ID, in the form evt_... — use it to avoid duplicate processing |
event | order.updated or payment.updated |
created_at | When the event was generated (ISO 8601) |
data.order.id | Internal order ID ORD... — the key for looking up the order in your system |
data.order.platform | taobao or alibaba (1688) |
data.order.order_id | Platform order code (may be null if not yet fully created on the platform) |
data.order.status | Platform status — see the status table |
data.order.payment_status | Elim payment status — see the payment_status table |
data.order.platform_payment_status | Platform-side payment result |
data.order.total_amount_cny | Order amount (CNY), may be null |
data.order.updated_at | The 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
| Header | Value |
|---|---|
Content-Type | application/json |
User-Agent | elim-api-webhooks/1.0 |
X-Elim-Event | Event name |
X-Elim-Delivery | Delivery record ID — stays the same across retries of the same event |
X-Elim-Timestamp | Unix time, in seconds |
X-Elim-Signature | sha256=<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
| Condition | Result |
|---|---|
Response 2xx | Marked as successful |
Timeout / network error / non-2xx code | Retry is scheduled |
| First attempt | Immediately when the event occurs |
| Total attempts | 3 |
| Spacing between attempts | 60 seconds, then 300 seconds |
| Timeout per request | 10 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
secretis only shown after creation orrotate-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.