order
Endpoint
WebSocket /ws
Selector: request.payload.action.type: "order"
Purpose
Place 1–32 GTC limit orders.
Authorization
Owner or permitted trading agent. The SDK signs the payload. HTTP and WebSocket share trading nonces.
Request fields
| Field | Type | Required | Meaning |
|---|---|---|---|
method | String | Yes | "post". |
id | Integer | Yes | 0–9,007,199,254,740,991; unique among outstanding requests. |
request.type | String | Yes | "action". |
request.payload.action | Object | Yes | Action fields below. |
request.payload.nonce | Unsigned integer | Yes | Trading nonce in Unix milliseconds. |
request.payload.signature | Object | Yes | r, s, v; recovery byte 27 or 28. |
request.payload.expiresAfter | Unsigned integer or null | No | Expiry in Unix milliseconds. |
request.payload.vaultAddress | Null | No | Omit or use null. |
Action fields:
| Field | Type | Required | Meaning |
|---|---|---|---|
request.payload.action.type | String | Yes | "order". |
request.payload.action.orders | Array | Yes | Between 1 and 32 order objects. |
request.payload.action.grouping | String | Yes | "na". |
request.payload.action.orders[].a | Unsigned integer | Yes | Supported perpetual asset index. |
request.payload.action.orders[].b | Boolean | Yes | true for buy; false for sell. |
request.payload.action.orders[].p | Decimal string | Yes | Positive limit price. |
request.payload.action.orders[].s | Decimal string | Yes | Positive order size. |
request.payload.action.orders[].r | Boolean | Yes | Reduce-only flag. |
request.payload.action.orders[].t | Object | Yes | {"limit":{"tif":"Gtc"}}. |
request.payload.action.orders[].c | Hex string | No | Client order ID: 0x followed by 32 hexadecimal characters. |
Shared envelope: message format.
Request example
Example values. Use a fresh nonce and signature.
{
"method": "post",
"id": 256,
"request": {
"type": "action",
"payload": {
"action": {
"type": "order",
"orders": [
{
"a": 0,
"b": true,
"p": "100000",
"s": "0.001",
"r": false,
"t": {
"limit": {
"tif": "Gtc"
}
},
"c": "0x11111111111111111111111111111111"
}
],
"grouping": "na"
},
"nonce": 1796250000000,
"signature": {
"r": "0x1111111111111111111111111111111111111111111111111111111111111111",
"s": "0x2222222222222222222222222222222222222222222222222222222222222222",
"v": 27
}
}
}
}Response fields
| Field | Type | Meaning |
|---|---|---|
channel | String | "post". |
data.id | Integer | Request ID. |
data.response.type | String | "action", or "error" for request errors. |
data.response.payload | Object or string | Action result below, or an error string. |
Action result fields:
| Field | Meaning |
|---|---|
data.response.payload.status | "ok" for an admitted request or "err" for a request-level rejection. |
data.response.payload.response | Response object on success; a reason string for a request-level rejection. |
data.response.payload.response.type | "order" for the order response. |
data.response.payload.response.data.statuses | One result per submitted order, in request order. |
data.response.payload.response.data.statuses[].resting.oid | Order ID for a resting order. |
data.response.payload.response.data.statuses[].filled.oid | Order ID for a filled order. |
data.response.payload.response.data.statuses[].filled.totalSz | Total filled size reported by a filled result. |
data.response.payload.response.data.statuses[].filled.avgPx | Average fill price reported by a filled result. |
data.response.payload.response.data.statuses[].error | Rejection reason for an individual child. |
Inspect the action status and each child result.
Response example
{
"channel": "post",
"data": {
"id": 256,
"response": {
"type": "action",
"payload": {
"status": "ok",
"response": {
"type": "order",
"data": {
"statuses": [
{
"resting": {
"oid": 12345
}
}
]
}
}
}
}
}
}Constraints
This profile supports Gtc limit orders with grouping: "na". A batch contains between 1 and 32 orders. IOC, post-only ALO, trigger orders, grouped TP/SL and builder fields are outside the supported action shape.
The customer planner accepts up to six fractional price digits and eight fractional size digits after ignoring trailing zeros. Market and venue constraints still apply. Price, size and market checks can reject an individual child.
An acknowledgement is distinct from reconciled fill and position accounting. An uncertain result retains the corresponding reservations until its outcome is reconciled. A missing response is not permission to blindly resubmit.
Match responses by data.id. Transport rules.