> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bulk.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Order

> Submit cancel order actions through signed POST /order.

Cancel a specific order by symbol and order ID. A rejection is not cancellation confirmation; inspect the returned status and reconcile subsequent account updates.

Use the current SDK to sign the complete transaction with a fresh nonce. See
[Transaction Signing](https://docs.bulk.trade/api-reference/signing.md) and the shared
[submission guide](https://docs.bulk.trade/api-reference/placeOrder.md#transaction-envelope). The request
example contains placeholder credentials and an illustrative nonce.

Inspect every [response status](https://docs.bulk.trade/api-reference/placeOrder.md#response-format),
including errors returned with HTTP 200. Later order and fill changes arrive
on the [account stream](https://docs.bulk.trade/api-reference/ws-account.md).

```json Signed request body theme={null}
{
  "actions": [
    {
      "cx": {
        "c": "BTC-USD",
        "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"
      }
    }
  ],
  "nonce": "1704067200000000000",
  "account": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signer": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7",
  "signature": "5j7s...base58..."
}
```

```json Illustrative result theme={null}
{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "cancelled": {
            "oid": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F"
          }
        }
      ]
    }
  }
}
```


## OpenAPI

````yaml api-reference/trading/openapi-cancel-order.yaml POST /order
openapi: 3.0.3
info:
  title: Bulk Trading — Cancel Order
  version: 1.0.0
servers:
  - url: https://mainnet-api1.bulk.trade/api/v1
    description: Mainnet (Primary)
  - url: https://exchange-api.bulk.trade/api/v1
    description: Testnet
security: []
paths:
  /order:
    post:
      tags:
        - Trading (Signed)
      summary: Cancel Order
      description: >-
        Submit a signed transaction to the shared POST /order endpoint. Use the
        SDK and canonical signing guide; illustrative signatures and nonces are
        not executable.
      operationId: submitCancelOrder
      parameters:
        - in: header
          name: x-bulk-sig-mode
          required: false
          description: >
            Signature-mode hint. Raw tries only raw; omission tries raw then
            base58. Offchain and base58 hints try that mode first, then the
            other supported modes.

            Omit to use the default raw canonical-binary verification path. Set
            to `offchain` when the

            transaction was signed using the [v0 Solana offchain
            envelope](/api-reference/signing#offchain-signing-mode).
          schema:
            type: string
            enum:
              - raw
              - offchain
              - base58
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FocusedTransaction'
            example:
              actions:
                - cx:
                    c: BTC-USD
                    oid: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
              nonce: '1704067200000000000'
              account: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
              signer: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
              signature: 5j7s...base58...
      responses:
        '200':
          description: >-
            Execution results. HTTP 200 alone is not success; inspect status and
            each statuses entry.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - response
                description: >-
                  Signed transaction result. Status rows describe execution
                  events, not action-array positions.
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - error
                    description: >-
                      Top-level status (ok when request was accepted; check each
                      item in statuses for per-action result)
                  response:
                    type: object
                    required:
                      - type
                      - data
                    properties:
                      type:
                        type: string
                        description: Always "order"
                      data:
                        type: object
                        required:
                          - statuses
                        properties:
                          statuses:
                            type: array
                            description: One status object per execution event
                            items:
                              oneOf:
                                - title: resting
                                  type: object
                                  description: >-
                                    Order placed and resting on book
                                    (non-terminal)
                                  properties:
                                    resting:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: working
                                  type: object
                                  description: >-
                                    Order resting with partial fills
                                    (non-terminal)
                                  properties:
                                    working:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        filledSz:
                                          type: number
                                          description: >-
                                            Filled size so far (signed; negative for
                                            sell-side)
                                        remainingSz:
                                          type: number
                                          description: >-
                                            Remaining size (signed; negative for
                                            sell-side)
                                        vwap:
                                          type: number
                                          description: Volume-weighted average price
                                - title: filled
                                  type: object
                                  description: Order fully filled (terminal)
                                  properties:
                                    filled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        totalSz:
                                          type: number
                                          description: >-
                                            Total filled size (signed; negative for
                                            sell-side)
                                        avgPx:
                                          type: number
                                          description: Average fill price (VWAP)
                                - title: partiallyFilled
                                  type: object
                                  description: Order partially filled and terminal
                                  properties:
                                    partiallyFilled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        totalSz:
                                          type: number
                                          description: >-
                                            Total filled size (signed; negative for
                                            sell-side)
                                        avgPx:
                                          type: number
                                          description: Average fill price (VWAP)
                                - title: cancelled
                                  type: object
                                  description: Order cancelled by user
                                  properties:
                                    cancelled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledRiskLimit
                                  type: object
                                  description: Cancelled due to risk limit violation
                                  properties:
                                    cancelledRiskLimit:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: cancelledSelfCrossing
                                  type: object
                                  description: Cancelled due to self-crossing (STP)
                                  properties:
                                    cancelledSelfCrossing:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledReduceOnly
                                  type: object
                                  description: Cancelled - would not reduce position
                                  properties:
                                    cancelledReduceOnly:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: cancelledIoc
                                  type: object
                                  description: IOC expired without full fill
                                  properties:
                                    cancelledIoc:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        filledSz:
                                          type: number
                                          description: >-
                                            Size filled before expiry (signed;
                                            negative for sell-side)
                                - title: rejectedCrossing
                                  type: object
                                  description: Post-only rejected for crossing
                                  properties:
                                    rejectedCrossing:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: rejectedDuplicate
                                  type: object
                                  description: Duplicate order ID
                                  properties:
                                    rejectedDuplicate:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: rejectedRiskLimit
                                  type: object
                                  description: Rejected due to risk limit on submission
                                  properties:
                                    rejectedRiskLimit:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: rejectedInvalid
                                  type: object
                                  description: Invalid order parameters
                                  properties:
                                    rejectedInvalid:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: deposit
                                  type: object
                                  description: Faucet deposit succeeded
                                  properties:
                                    deposit:
                                      type: object
                                      properties:
                                        amount:
                                          type: number
                                - title: depositFailed
                                  type: object
                                  description: Faucet deposit failed
                                  properties:
                                    depositFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: agentWallet
                                  type: object
                                  description: Agent wallet registered
                                  properties:
                                    agentWallet:
                                      type: object
                                      properties:
                                        agent_wallet:
                                          type: string
                                - title: agentWalletFailed
                                  type: object
                                  description: Agent wallet operation failed
                                  properties:
                                    agentWalletFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: cancelOneRejected
                                  type: object
                                  description: Single cancel rejected
                                  properties:
                                    cancelOneRejected:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                        reason:
                                          type: string
                                - title: cancelAllRejected
                                  type: object
                                  description: Cancel-all rejected
                                  properties:
                                    cancelAllRejected:
                                      type: object
                                      properties:
                                        reason:
                                          type: string
                                - title: triggered
                                  type: object
                                  description: Conditional root fired (non-terminal)
                                  properties:
                                    triggered:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: siblingCancelled
                                  type: object
                                  description: OCO sibling auto-cancelled
                                  properties:
                                    siblingCancelled:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                - title: triggerFailed
                                  type: object
                                  description: Trigger execution failed
                                  properties:
                                    triggerFailed:
                                      type: object
                                      properties:
                                        oid:
                                          type: string
                                          description: Order ID (base58)
                                        reason:
                                          type: string
                                          nullable: true
                                - title: transfer
                                  type: object
                                  description: Margin transfer succeeded
                                  properties:
                                    transfer:
                                      type: object
                                      properties:
                                        from:
                                          type: string
                                          description: Source account pubkey (base58)
                                        to:
                                          type: string
                                          description: Destination account pubkey (base58)
                                        symbol:
                                          type: string
                                          description: Margin asset symbol
                                        amount:
                                          type: number
                                - title: transferFailed
                                  type: object
                                  description: Margin transfer failed
                                  properties:
                                    transferFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: createSubAccount
                                  type: object
                                  description: Sub-account creation succeeded
                                  properties:
                                    createSubAccount:
                                      type: object
                                      properties:
                                        master:
                                          type: string
                                          description: Owning master account pubkey (base58)
                                        sub:
                                          type: string
                                          description: >-
                                            Newly created sub-account pubkey
                                            (base58)
                                        name:
                                          type: string
                                          description: Display name
                                        margin:
                                          type: number
                                          description: >-
                                            Initial margin transferred from master
                                            at creation (0 when none requested)
                                - title: createSubAccountFailed
                                  type: object
                                  description: Sub-account creation failed
                                  properties:
                                    createSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: removeSubAccount
                                  type: object
                                  description: >-
                                    Sub-account removal succeeded; remaining
                                    margin is swept back to master
                                  properties:
                                    removeSubAccount:
                                      type: object
                                      properties:
                                        account:
                                          type: string
                                          description: Removed sub-account pubkey (base58)
                                        marginMoved:
                                          type: number
                                          description: >-
                                            Margin amount returned to the master
                                            account
                                - title: removeSubAccountFailed
                                  type: object
                                  description: Sub-account removal failed
                                  properties:
                                    removeSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: renameSubAccount
                                  type: object
                                  description: Sub-account rename succeeded
                                  properties:
                                    renameSubAccount:
                                      type: object
                                      properties:
                                        master:
                                          type: string
                                          description: Owning master account pubkey (base58)
                                        account:
                                          type: string
                                          description: >-
                                            Sub-account pubkey that was renamed
                                            (base58)
                                        name:
                                          type: string
                                          description: New display name
                                - title: renameSubAccountFailed
                                  type: object
                                  description: Sub-account rename failed
                                  properties:
                                    renameSubAccountFailed:
                                      type: object
                                      properties:
                                        message:
                                          type: string
                                - title: error
                                  type: object
                                  description: Generic error
                                  properties:
                                    error:
                                      type: object
                                      properties:
                                        message:
                                          type: string
              examples:
                executionResult:
                  summary: Illustrative execution result
                  value:
                    status: ok
                    response:
                      type: order
                      data:
                        statuses:
                          - cancelled:
                              oid: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
                authBadSignature:
                  summary: 'Authentication failure: bad signature (HTTP 200)'
                  value:
                    status: error
                    response:
                      type: order
                      data:
                        statuses:
                          - error:
                              message: bad signature
                authUnauthorizedSigner:
                  summary: 'Authentication failure: unauthorized signer (HTTP 200)'
                  value:
                    status: error
                    response:
                      type: order
                      data:
                        statuses:
                          - error:
                              message: unauthorized signer
        '408':
          description: >-
            Response timeout (60 seconds for orders, 5 seconds for current-state
            snapshot requests). An order may still execute; reconcile before
            submitting a replacement.
        '429':
          description: >-
            Request or action rate limit reached. Back off before retrying; the
            body may be plain text or empty.
        '500':
          description: Internal endpoint error - Database or channel error
        '503':
          description: >-
            API disabled or required data/service unavailable. API_LOCKED uses
            the JSON example; other unavailable responses may be empty.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                  error:
                    type: string
              example:
                code: API_LOCKED
                error: api disabled until an admin enables it
components:
  schemas:
    FocusedTransaction:
      type: object
      required:
        - actions
        - nonce
        - account
        - signer
        - signature
      properties:
        actions:
          type: array
          description: >-
            This focused view shows cancel order actions. Use the batch
            reference for mixed trading actions.
          items:
            title: Cancel order (cx)
            type: object
            description: Cancel a specific order by ID
            required:
              - cx
            properties:
              cx:
                type: object
                required:
                  - c
                  - oid
                properties:
                  c:
                    type: string
                    description: Symbol
                    example: BTC-USD
                  oid:
                    type: string
                    description: Order ID (base58 hash)
                    example: Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F
        nonce:
          description: >-
            Fresh Unix nanosecond nonce; use a decimal string to preserve 64-bit
            precision
          oneOf:
            - type: string
              pattern: ^[0-9]+$
            - type: integer
              minimum: 0
        account:
          type: string
          description: >
            Account public key (base58) whose account is being acted on. Must be
            a master pubkey or a sub-account pubkey. Per-instrument isolated
            accounts are managed implicitly via the `i` flag on order actions
            and are never set as `account`.
          example: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
        signer:
          type: string
          description: >
            Signer public key (base58); who is signing. One of:

            - the `account` itself;

            - when `account` is a sub-account: the parent master, or an [agent
            wallet](/api-reference/manageAgentWallet) registered on the parent
            master (automatically authorized for its sub-accounts);

            - an agent wallet registered directly on `account`.
          example: FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7
        signature:
          type: string
          description: >-
            Base58 Ed25519 signature over canonical version-selected action
            bytes, nonce, account, and network domain. See Transaction Signing
            for raw, base58, and offchain modes.
          example: 5j7sVt3k2YxPqH4w...

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.