---
title: "Cancel OTC Trade"
method: POST
path: "/v2/otc-command#cancel"
tags: ["otc"]
---

# Cancel OTC Trade

`POST /v2/otc-command#cancel`

## Request

- Base URL: `https://api.exchange.bullish.com/trading-api`
- URL: `https://api.exchange.bullish.com/trading-api/v2/otc-command#cancel`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bullish/apis/bullish-trading-api/docs/v2/otc-command%23cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

Cancel a pending OTC trade or reject an OTC trade previously submitted on your behalf by an inter-dealer broker.

Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged
but does not indicate that the command was executed.
This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
ordering and addition of null fields in the request body.

Command schemas and examples are provided below. Supported commands:
- V1CancelOtcTrade
- V1CancelAllOtcTrades

Requires
- [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

## Headers

- `BX-SIGNATURE` string, required
- `BX-TIMESTAMP` string, required
- `BX-NONCE` string, required

## Request body

- union
  - CancelOtcTradeCommand: A command to cancel an OTC trade. Only one of `clientOtcTradeId` or `otcTradeId` can be used in the cancel OTC trade command
    - `commandType` 'V1CancelOtcTrade', required: Specifies the command type and must be ‘V1CancelOtcTrade' to indicate the cancellation of an OTC trade.
    - `otcTradeId` string: unique numeric (i64) identifier generated on Bullish side expressed as a string value
    - `clientOtcTradeId` string: unique numeric (i64) identifier generated on the client side expressed as a string value
    - `tradingAccountId` string, required: unique trading account ID
  - CancelAllOtcTradesCommand: A command to cancel all pending OTC trades.
    - `commandType` 'V1CancelAllOtcTrades', required: Specifies the command type and must be ‘V1CancelAllOtcTrades' to indicate the cancellation of all pending OTC trades.
    - `tradingAccountId` string, required: unique trading account ID

## Response `200`

Status OK. This means a command was successfully acknowledged.

- union
  - CancelOtcTradeResponse: A response for an acknowledged OTC command to cancel an OTC trade
    - `message` string, required: message indicating the status of the request
    - `requestId` string, required
    - `otcTradeId` string, required: unique numeric (i64) identifier generated on Bullish side expressed as a string value
    - `clientOtcTradeId` string: unique numeric (i64) identifier generated on the client side expressed as a string value
    - `tradingAccountId` string, required: unique trading account ID
  - CancelAllOtcTradesResponse: A response for an acknowledged OTC command to cancel all pending OTC trades
    - `message` string, required: message indicating the status of the request
    - `requestId` string, required
    - `tradingAccountId` string, required: unique trading account ID

## Other responses

- `400`: Bad Request For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
- `401`: Unauthorized. Either API details are missing or invalid
- `403`: Forbidden- You do not have access to the requested resource
- `500`: Internal Server Error

---

[API](https://skmtc.dev/bullish/apis/bullish-trading-api.md) - [All operations](https://skmtc.dev/bullish/apis/bullish-trading-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bullish/apis/bullish-trading-api/revisions/df5d69ccedcf?raw)
