Skip to content
LogoLogo

cancelByCloid

Endpoint

WebSocket /ws

Selector: request.payload.action.type: "cancelByCloid"

Purpose

Cancel orders by asset and client order ID.

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"cancelByCloid".
request.payload.action.cancelsArrayYesBetween 1 and 32 cancellation objects.
request.payload.action.cancels[].assetUnsigned integerYesSupported perpetual asset index.
request.payload.action.cancels[].cloidHex stringYes0x followed by 32 hexadecimal characters.

Shared envelope: message format.

Request example

Example values. Use a fresh nonce and signature.

{
  "method": "post",
  "id": 258,
  "request": {
    "type": "action",
    "payload": {
      "action": {
        "type": "cancelByCloid",
        "cancels": [
          {
            "asset": 0,
            "cloid": "0x11111111111111111111111111111111"
          }
        ]
      },
      "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.statusOuter status, "ok" in the example below.
data.response.payload.responseCancellation response object.
data.response.payload.response.type"cancel", including for the cancelByCloid action.
data.response.payload.response.data.statusesOne result per cancellation, in request order: "success" or an error object.

Inspect the action status and each child result.

Response example

{
  "channel": "post",
  "data": {
    "id": 258,
    "response": {
      "type": "action",
      "payload": {
        "status": "ok",
        "response": {
          "type": "cancel",
          "data": {
            "statuses": [
              "success"
            ]
          }
        }
      }
    }
  }
}

Constraints

A batch contains between 1 and 32 cancellations. The CLOID must identify a matching open order owned by that customer on the specified asset.

Cancellation can race with fills. Reconcile uncertain outcomes before releasing reservations. Details.

Match responses by data.id. Transport rules.