Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

cancel

Cancels orders by exchange-assigned order id. To cancel by your own client order id, use cancelByCloid.

POST/exchangetype cancel

Cancel orders by the exchange-assigned order id.Agent-signed

Action fields
cancelsCancelBody[]required

Cancel bodies; at most 200 per action.

ainteger · uint32required

Instrument's external id — the `index` value from `perpMeta`; Outcome markets use the `instrument_id`. Long form: `asset`.

ointeger · uint64required

Order id to cancel, as an integer. A numeric string is parsed too, but the node hashes the value as an integer, so sign it as one. Long form: `oid`.

groupingstringoptional

Selects which order family the id refers to. Defaults to `na`.

"na""tpsl""trigger"
typestringrequired

Must be `cancel`.

"cancel"
Request example
curl -X POST https://rpc.txflow-testnet.xyz/exchange \
  -H "Content-Type: application/json" \
  -H "x-api-version: 2026-08-16" \
  -d '{
  "action": {
    "type": "cancel",
    "cancels": [
      {
        "a": 1,
        "o": 123456789
      }
    ]
  },
  "signature": {
    "r": "0x<r>",
    "s": "0x<s>",
    "v": 27
  },
  "nonce": 1757992743994,
  "vaultAddress": null,
  "signatureChainId": null
}'
Try it
testnet · no account yet
Generates a throwaway key in your browser, claims testnet USDC and authorizes an agent key. The account is kept while you browse the docs and lost on reload.
Response · CancelOrder 200
codeinteger

`0` on success.

dataobject
dataobject
typestring

The action's internal name, which does not always match the request `type`.

"CancelOrder"
statusstring

A rejected request returns `err` with a non-zero `code` and the reason in `message` (or `response`).

"ok"
Response example
{
  "status": "ok",
  "code": 0,
  "data": {
    "type": "CancelOrder",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

Cancel body

ainteger · uint32required

Instrument's external id — the `index` value from `perpMeta`; Outcome markets use the `instrument_id`. Long form: `asset`.

ointeger · uint64required

Order id to cancel, as an integer. A numeric string is parsed too, but the node hashes the value as an integer, so sign it as one. Long form: `oid`.

groupingstringoptional

Selects which order family the id refers to. Defaults to `na`.

"na""tpsl""trigger"

Next steps

The response is a single success for the whole action and does not report which orders were cancelled — confirm the result with frontendOpenOrders.

For an Outcome order, a is the market's instrument_id. Confirm it with outcomeFrontendOpenOrders and follow the result on outcomeOrderUpdates.