POST /trending/orders
Create a trending, reactions or other-services order for the end user. The price and discount are decided server-side from the user's account — they are never taken from the request.
The target is resolved and checked exactly as in
resolve; the order is then placed with the chosen
order type.
Use case
The user picked a package — place the order and show them how to pay.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer <accessToken> |
x-user-id | yes | End-user id, 1–256 chars [A-Za-z0-9_-]. |
Content-Type | yes | application/json |
Idempotency-Key | no | 8–128 chars [A-Za-z0-9_-]. See below. |
Body
The target fields are the same as in resolve
(service, provider, link, tokenAddress). On top of those:
| Field | Type | Required | Description |
|---|---|---|---|
orderTypeId | string | for dex-trending, other-services | One of the ids resolve returned. |
quantity | integer | no | other-services only. Integer within the package's bounds; defaults to its minimum. Ignored for dex-trending (always 1). |
items | { orderTypeId, quantity }[] | for reactions | 1–8 entries, no repeated orderTypeId, each orderTypeId one resolve returned, quantity an integer within the bounds resolve shows. |
speed | string | no | reactions only. One of the speeds from resolve; defaults to normal. |
Response 201
{
"order": {
"orderId": "…",
"providerOrderId": "…",
"items": [ { "orderTypeId": "…", "quantity": 100, "providerOrderId": "…" } ]
},
"target": {
"chain": "solana",
"pairAddress": "…",
"tokenAddress": "…",
"tokenName": "…",
"tokenSymbol": "…"
}
}
order is the order record, including
providerOrderId (null when not assigned yet). items appears for
reactions orders, each item with its own providerOrderId. Read orderId for every follow-up
call; the remaining order fields (status, price, payment details) may
gain fields over time.
Idempotency
Send an Idempotency-Key so a retry after a timeout does not create a
second order.
- A retry with the same key returns the first response (same status
and body) with the header
Idempotent-Replayed: true. - Keys are scoped to your API client and the
x-user-id, and kept for 24 hours. 5xxand429responses are not stored; the next retry runs again.- If the first request is still running, the retry gets
409. - A malformed key gets
400.
Errors
| Status | Meaning |
|---|---|
400 | Validation failed; target rejected (see resolve — issues / tokenInfo included); orderTypeId or quantity out of range; repeated items entry; invalid speed; malformed Idempotency-Key; or the order was rejected (message says why). |
401 / 403 | Token missing, invalid, expired or revoked / API inactive. |
403 / 409 / 429 | The order was refused; message says why. |
409 | Also: a request with the same Idempotency-Key is still running. |
429 | Per-client rate limit hit. |
503 | Trending disabled or unavailable, or idempotency storage is unavailable (only when Idempotency-Key is sent). |
Example
curl -X POST "$BASE_URL/trending/orders" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"service": "dex-trending",
"link": "https://dexscreener.com/solana/<pair>",
"orderTypeId": "<orderTypeId>"
}'
Reactions:
curl -X POST "$BASE_URL/trending/orders" \
-H "Authorization: Bearer $ACCESS" \
-H "x-user-id: $USER_ID" \
-H "Content-Type: application/json" \
-d '{
"service": "reactions",
"link": "https://dexscreener.com/solana/<pair>",
"items": [ { "orderTypeId": "<orderTypeId>", "quantity": 100 } ],
"speed": "normal"
}'