Flash

Cancel orders in batch

Changed on

Cancel up to 25 flash orders with one funder signature. Returns 200 with one result per order id, in request order; partial success is reported per order, never as a whole-call failure.

Signature required. Construct the canonical UTF-8 batch cancel message and sign it with the funder wallet:

  • Message format: "Definitive Flash v1 — Cancel Orders\nOrders:\n<orderId>\n<orderId>..." — one lowercase UUID per line, in the same order as orderIds, no trailing newline. Identical bytes across EVM and SVM; only the signing primitive differs.
  • EVM chains — sign with EIP-191 personal_sign over the message bytes; pass the 65-byte 0x-prefixed hex signature as userSignature.
  • SVM (solana) — sign with Ed25519 over the message bytes; pass the 64-byte base58 signature as userSignature.
  • Echo the exact message text back as cancelMessage.

One wallet per batch: ids the signer does not fund come back NOT_FOUND and the rest proceed. A userSignature that is not valid hex or base58 is rejected with 400 INVALID_SIGNATURE before any lookup; a well-formed signature that fails to verify is reported per order as NOT_FOUND, never as a 4xx.

Each result mirrors single cancel: ok: true for a fresh or already-cancelled order; otherwise ok: false with an errorCode standing in for the status single cancel would have returned. PENDING_CANCEL means a cancel is already in flight — treat it as cancelled and confirm via GET /orders/{orderId}.

Cancelling an entry order never cancels its attached bracket pair; include the bracket's own id to cancel it.

post/orders/cancel

Request

  • Base URL
    https://flash.definitive.fi/v1
  • Auth
    API key in header x-definitive-api-key

Request body

orderIdsstring[] required

1–25 order ids to cancel, as lowercase hyphenated UUIDs, in the same order as the lines of cancelMessage. Duplicates are rejected.

cancelMessagestring required

UTF-8 plaintext the funder wallet signed. Format: "Definitive Flash v1 — Cancel Orders\nOrders:\n<orderId>\n<orderId>..." — one lowercase UUID per line in orderIds order, no trailing newline. Same bytes across EVM and SVM.

userSignaturestring required

Funder wallet signature over cancelMessage. Accepts 0x-prefixed hex (EVM convention) or base58 (Solana convention). EVM: 65 bytes from EIP-191 personal_sign. SVM: 64 bytes from Ed25519.

Response

Per-order results, in request order

Example response

{
  "results": [
    {
      "errorCode": "ALREADY_FILLED"
    }
  ]
}

Changes