Skip to content
LogoLogo

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

FieldTypeRequiredMeaning
methodStringYes"post".
idIntegerYes0–9,007,199,254,740,991; unique among outstanding requests.
request.typeStringYes"action".
request.payload.actionObjectYesAction fields below.
request.payload.nonceUnsigned integerYesTrading nonce in Unix milliseconds.
request.payload.signatureObjectYesr, s, v; recovery byte 27 or 28.
request.payload.expiresAfterUnsigned integer or nullNoExpiry in Unix milliseconds.
request.payload.vaultAddressNullNoOmit or use null.

Action fields:

FieldTypeRequiredMeaning
request.payload.action.typeStringYes"order".
request.payload.action.ordersArrayYesBetween 1 and 32 order objects.
request.payload.action.groupingStringYes"na".
request.payload.action.orders[].aUnsigned integerYesSupported perpetual asset index.
request.payload.action.orders[].bBooleanYestrue for buy; false for sell.
request.payload.action.orders[].pDecimal stringYesPositive limit price.
request.payload.action.orders[].sDecimal stringYesPositive order size.
request.payload.action.orders[].rBooleanYesReduce-only flag.
request.payload.action.orders[].tObjectYes{"limit":{"tif":"Gtc"}}.
request.payload.action.orders[].cHex stringNoClient 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

FieldTypeMeaning
channelString"post".
data.idIntegerRequest ID.
data.response.typeString"action", or "error" for request errors.
data.response.payloadObject or stringAction result below, or an error string.

Action result fields:

FieldMeaning
data.response.payload.status"ok" for an admitted request or "err" for a request-level rejection.
data.response.payload.responseResponse 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.statusesOne result per submitted order, in request order.
data.response.payload.response.data.statuses[].resting.oidOrder ID for a resting order.
data.response.payload.response.data.statuses[].filled.oidOrder ID for a filled order.
data.response.payload.response.data.statuses[].filled.totalSzTotal filled size reported by a filled result.
data.response.payload.response.data.statuses[].filled.avgPxAverage fill price reported by a filled result.
data.response.payload.response.data.statuses[].errorRejection 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.