Skip to content
LogoLogo

Cancel orders by CLOID

Endpoint

POST /exchange

Selector: action.type: "cancelByCloid"

Purpose

Targets an order by its client order ID instead of a returned venue order ID. The lookup is scoped to the authorized customer's account and the specified asset.

Authorization

Owner or permitted trading agent. The SDK signs the action; see raw signing for custom clients.

Request fields

FieldTypeRequiredMeaning
actionObjectYesThe supported action described below.
nonceUnsigned integerYesTrading nonce; native-style millisecond timestamp convention.
signatureObjectYesWallet signature containing r, s and recovery byte v (27 or 28).
expiresAfterUnsigned integer or nullNoRequest expiry in Unix milliseconds.
vaultAddressNullNoOmit or use null; customer subaccount/vault routing is outside this profile.

The action object contains:

FieldTypeRequiredMeaning
action.typeStringYes"cancelByCloid".
action.cancelsArrayYesBetween 1 and 32 cancellation objects.
action.cancels[].assetUnsigned integerYesSupported perpetual asset index.
action.cancels[].cloidHex stringYes0x followed by 32 hexadecimal characters.

See the shared trading envelope for the common signing and routing fields.

Request example

The proof and identifiers are illustrative.

{
  "action": {
    "type": "cancelByCloid",
    "cancels": [
      {
        "asset": 0,
        "cloid": "0x11111111111111111111111111111111"
      }
    ]
  },
  "nonce": 1796250000000,
  "signature": {
    "r": "0x1111111111111111111111111111111111111111111111111111111111111111",
    "s": "0x2222222222222222222222222222222222222222222222222222222222222222",
    "v": 27
  }
}

Response fields

FieldMeaning
statusOuter status, "ok" in the example below.
responseCancellation response object.
response.type"cancel", including for the cancelByCloid action.
response.data.statusesOne result per cancellation, in request order: "success" or an error object.

Response example

The action returns the cancellation response type, "cancel":

{
  "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.