Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bullish-exchange/api-docs/llms.txt

Use this file to discover all available pages before exploring further.

The Orders API provides full order lifecycle management: submitting new orders, querying open and historical orders by ID or filter, and cancelling or amending existing orders via the command entry interface. All write operations (create, cancel, amend) require a valid bearer JWT along with a signed request envelope.

Authentication Headers

All authenticated order endpoints require the following HTTP request headers:
HeaderDescription
AuthorizationBearer <JWT> obtained from the login endpoint.
BX-NONCEClient-side incremented unsigned 64-bit integer, expressed as a string.
BX-SIGNATURESignature generated using the signing format.
BX-TIMESTAMPNumber of milliseconds since EPOCH.
Optionally supply BX-RATELIMIT-TOKEN (from your trading account) to access higher rate limit tiers.

GET /trading-api/v2/orders

Retrieves a list of orders placed by a trading account. Only the last 24 hours of data is available for querying. Supports pagination and filtering.
Authentication: Required. Rate limited: Yes.

Query Parameters

tradingAccountId
string
required
ID of the trading account to query orders for.
symbol
string
Filter by market symbol, e.g. BTCUSD.
clientOrderId
string
Filter by unique numeric client-side order identifier (expressed as a string).
side
string
Filter by order side: BUY or SELL.
status
string
Filter by order status: OPEN, CLOSED, CANCELLED, REJECTED.
_pageSize
integer
Page size. One of: 5, 25, 50, 100. Defaults to 25.

Response Fields (array of Order objects)

orderId
string
Unique exchange-assigned order ID.
clientOrderId
string
Unique client-side numeric identifier provided at order creation.
symbol
string
Market symbol. E.g. BTCUSD.
type
string
Order type: LMT, MKT, STOP_LIMIT, POST_ONLY, LIMIT, MARKET.
side
string
Order side: BUY or SELL.
price
string
Limit price. E.g. "50000.0000".
stopPrice
string
Stop trigger price (for stop-limit orders).
averageFillPrice
string
Average fill price if partially or fully filled.
quantity
string
Order quantity. E.g. "1.00000000".
quantityFilled
string
Quantity that has been filled so far.
quoteAmount
string
Quote quantity deducted from the asset account.
baseFee
string
Base asset fee charged upon trade execution. E.g. "0.00100000".
quoteFee
string
Quote asset fee charged upon trade execution. E.g. "0.0010".
timeInForce
string
Time-in-force policy: GTC (Good Till Cancel), FOK (Fill Or Kill), IOC (Immediate Or Cancel).
status
string
Order status: OPEN, CLOSED, CANCELLED, REJECTED.
statusReason
string
Human-readable description of the current status. E.g. "User cancelled".
statusReasonCode
string
Numeric status reason code. See Error & Rejection Codes.
allowBorrow
boolean
Indicates if the order was allowed to borrow (does not confirm borrowing occurred).
isLiquidation
boolean
Whether this order was executed as a liquidation order.
createdAtDatetime
string
ISO 8601 datetime when the order was acknowledged by the exchange.
createdAtTimestamp
string
Millisecond EPOCH timestamp when the order was acknowledged.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v2/orders?tradingAccountId=111000000000001&symbol=BTCUSD&status=OPEN" \
  -H "Authorization: Bearer <JWT>"

Example Response

{
  "data": [
    {
      "orderId": "390755652232282113",
      "clientOrderId": "12345678",
      "symbol": "BTCUSD",
      "type": "LMT",
      "side": "BUY",
      "price": "50000.0000",
      "stopPrice": null,
      "averageFillPrice": null,
      "quantity": "1.00000000",
      "quantityFilled": "0.00000000",
      "quoteAmount": "0.0000",
      "baseFee": "0.00000000",
      "quoteFee": "0.0003",
      "timeInForce": "GTC",
      "status": "OPEN",
      "statusReason": "Open",
      "statusReasonCode": "6001",
      "allowBorrow": false,
      "isLiquidation": false,
      "createdAtDatetime": "2024-10-04T08:00:00.000Z",
      "createdAtTimestamp": "1728028800000"
    }
  ],
  "links": {
    "next": "/trading-api/v2/orders?tradingAccountId=111000000000001&_nextPage=Mjk3NzM1MzQ5NDI0NjIwMDMy",
    "previous": null
  }
}

POST /trading-api/v2/orders

Creates a new order. A 200 response confirms the command was acknowledged by the exchange — use GET /trading-api/v2/orders/ to confirm the final order status.
Authentication: Required. Rate limited: Yes. Provide BX-RATELIMIT-TOKEN header for higher tiers.

Request Headers

Authorization
string
required
Bearer <JWT>
BX-SIGNATURE
string
required
Request signature.
BX-TIMESTAMP
string
required
Milliseconds since EPOCH.
BX-NONCE
string
required
Client-side incremented unsigned 64-bit integer as a string.
BX-NONCE-WINDOW-ENABLED
string
"true" or "false". Enables out-of-order processing of order requests. Defaults to "false".

Request Body Fields

commandType
string
required
Must be "V3CreateOrder".
tradingAccountId
string
required
ID of the trading account placing the order.
symbol
string
required
Market symbol, e.g. "BTCUSD".
type
string
required
Order type: "LIMIT", "MARKET", "STOP_LIMIT", "POST_ONLY".
side
string
required
Order side: "BUY" or "SELL".
quantity
string
required
Order quantity. E.g. "1.00000000". Strict precision not required.
timeInForce
string
required
Time-in-force: "GTC", "FOK", or "IOC".
price
string
Limit price. Required for LIMIT, STOP_LIMIT, and POST_ONLY orders. E.g. "50000.0000".
stopPrice
string
Stop trigger price. Required for STOP_LIMIT orders.
clientOrderId
string
Client-side unique numeric identifier (expressed as a string). Formerly called handle.
allowBorrow
boolean
Allow the order to borrow assets. Defaults to false.
isMMP
boolean
Subject the order to Market Maker Protection. Only applicable to option markets.

Response Fields

message
string
Acknowledgement message, e.g. "Command acknowledged - CreateOrder".
requestId
string
Unique request ID assigned by the exchange.
orderId
string
Unique exchange-assigned order ID to use for subsequent status queries.
clientOrderId
string
Client-side order ID echoed from the request.

Example — Create a Limit Buy Order

curl -X POST "https://api.exchange.bullish.com/trading-api/v2/orders" \
  -H "Authorization: Bearer <JWT>" \
  -H "BX-SIGNATURE: <SIGNATURE>" \
  -H "BX-TIMESTAMP: 1728028800000" \
  -H "BX-NONCE: 1728028800000001" \
  -H "Content-Type: application/json" \
  -d '{
    "commandType": "V3CreateOrder",
    "clientOrderId": "12345678",
    "symbol": "BTCUSD",
    "type": "LIMIT",
    "side": "BUY",
    "price": "50000.0000",
    "quantity": "1.00000000",
    "timeInForce": "GTC",
    "allowBorrow": false,
    "tradingAccountId": "111000000000001"
  }'

Example Request Body — Spot Limit Order

{
  "commandType": "V3CreateOrder",
  "clientOrderId": "12345678",
  "symbol": "BTCUSD",
  "type": "LIMIT",
  "side": "BUY",
  "price": "50000.0000",
  "quantity": "1.00000000",
  "timeInForce": "GTC",
  "allowBorrow": false,
  "tradingAccountId": "111000000000001"
}

Example Request Body — Market Order

{
  "commandType": "V3CreateOrder",
  "clientOrderId": "12345679",
  "symbol": "BTCUSD",
  "type": "MARKET",
  "side": "BUY",
  "quantity": "0.50000000",
  "timeInForce": "IOC",
  "tradingAccountId": "111000000000001"
}

Example Request Body — Stop-Limit Order

{
  "commandType": "V3CreateOrder",
  "symbol": "BTCUSD",
  "type": "STOP_LIMIT",
  "side": "BUY",
  "price": "31000.1",
  "stopPrice": "31000.8",
  "quantity": "1.1",
  "timeInForce": "GTC",
  "tradingAccountId": "111000000000001"
}

Example Response

{
  "message": "Command acknowledged - CreateOrder",
  "requestId": "633910976353665024",
  "orderId": "633910775316480001",
  "clientOrderId": "12345678"
}

GET /trading-api/v2/orders/

Retrieves a specific order by its exchange-assigned order ID.
Authentication: Required. Rate limited: Yes.

Path Parameters

orderId
number
required
Exchange-assigned order ID.

Query Parameters

tradingAccountId
string
required
ID of the trading account that owns the order.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v2/orders/633910775316480001?tradingAccountId=111000000000001" \
  -H "Authorization: Bearer <JWT>"

GET /trading-api/v2/history/orders

Retrieves paginated historical order records. Only the last 90 days of data are available. Supports pagination and filtering including datetime ranges.
Authentication: Required. Rate limited: Yes.

Query Parameters

tradingAccountId
string
required
ID of the trading account.
symbol
string
Filter by market symbol.
orderId
string
Filter by specific order ID.
clientOrderId
string
Filter by client-side order identifier.
side
string
Filter by order side: BUY or SELL.
status
string
Filter by order status: OPEN, CLOSED, CANCELLED, REJECTED.
createdAtDatetime[gte]
string
Start of datetime range (ISO 8601 with millisecond).
createdAtDatetime[lte]
string
End of datetime range (ISO 8601 with millisecond).
_pageSize
integer
Page size. One of: 5, 25, 50, 100. Defaults to 25.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v2/history/orders?tradingAccountId=111000000000001&symbol=BTCUSD&status=CANCELLED&createdAtDatetime%5Bgte%5D=2024-09-01T00%3A00%3A00.000Z" \
  -H "Authorization: Bearer <JWT>"

POST /trading-api/v2/command

Submits a command to the trading engine. Supports order cancellation, mass cancellation, delayed cancellation, and order amendment. A 200 response confirms command acknowledgement — it does not guarantee execution.
Authentication: Required. Rate limited: Yes. Provide BX-RATELIMIT-TOKEN for higher tiers.
Supported commandType values:
  • V3CancelOrder — Cancel a specific order
  • V1CancelAllOrders — Cancel all open orders across all markets
  • V1CancelAllOrdersByMarket — Cancel all open orders in a specific market
  • V1DelayedCancelAllOrders — Schedule a delayed cancel-all (kill switch)
  • V1UnsetDelayedCancelAllOrders — Unset a pending delayed cancel-all
  • V1AmendOrder — Amend the price, quantity, or type of an open order
  • V3TerminateAMMInstruction — Terminate an active AMM instruction
  • V2TransferAsset — Transfer assets between trading accounts

Request Headers

Authorization
string
required
Bearer <JWT>
BX-SIGNATURE
string
required
Request signature.
BX-TIMESTAMP
string
required
Milliseconds since EPOCH.
BX-NONCE
string
required
Client-side incremented unsigned 64-bit integer as a string.
BX-NONCE-WINDOW-ENABLED
string
"true" or "false". Enables out-of-order request processing.

Cancel a Specific Order

{
  "commandType": "V3CancelOrder",
  "orderId": "633910775316480001",
  "symbol": "BTCUSD",
  "tradingAccountId": "111000000000001"
}

Amend an Open Order

Amendments can change price, quantity, and type (e.g. between taker-only and maker-only). Only applicable to open orders where quantityFilled = 0 and status = OPEN.
{
  "commandType": "V1AmendOrder",
  "orderId": "633910775316480001",
  "symbol": "BTCUSD",
  "price": "49000.0000",
  "quantity": "2.00000000",
  "clientOrderId": "633914459442118656",
  "tradingAccountId": "111000000000001"
}

Cancel All Orders in a Market

{
  "commandType": "V1CancelAllOrdersByMarket",
  "symbol": "BTCUSD",
  "tradingAccountId": "111000000000001"
}

Cancel Order Response

{
  "message": "Command acknowledged - CancelOrder",
  "requestId": "633910976353665024",
  "orderId": "633910775316480001"
}

Amend Order Response

{
  "message": "Command acknowledged - AmendOrder",
  "requestId": "633910976353665024",
  "orderId": "633910775316480001",
  "clientOrderId": "1234567-1"
}

Example Curl — Cancel Order

curl -X POST "https://api.exchange.bullish.com/trading-api/v2/command" \
  -H "Authorization: Bearer <JWT>" \
  -H "BX-SIGNATURE: <SIGNATURE>" \
  -H "BX-TIMESTAMP: 1728028800000" \
  -H "BX-NONCE: 1728028800000002" \
  -H "Content-Type: application/json" \
  -d '{
    "commandType": "V3CancelOrder",
    "orderId": "633910775316480001",
    "symbol": "BTCUSD",
    "tradingAccountId": "111000000000001"
  }'

POST /trading-api/v2/mmp-configuration

Sets up or resets Market Maker Protection (MMP) configuration for a trading account. MMP is only applicable to options orders created with the isMMP flag set to true. Contact your relationship manager to enable MMP for your accounts.
Authentication: Required.

Request Headers

Authorization
string
required
Bearer <JWT>
BX-SIGNATURE
string
required
Request signature.
BX-TIMESTAMP
string
required
Milliseconds since EPOCH.
BX-NONCE
string
required
Client-side incremented unsigned 64-bit integer as a string.

Supported Command Types

  • V1SetMMP — Configure MMP parameters for an underlying asset symbol.
  • V1ResetMMP — Reset MMP configuration for an underlying asset symbol.

Example Request

curl -X POST "https://api.exchange.bullish.com/trading-api/v2/mmp-configuration" \
  -H "Authorization: Bearer <JWT>" \
  -H "BX-SIGNATURE: <SIGNATURE>" \
  -H "BX-TIMESTAMP: 1728028800000" \
  -H "BX-NONCE: 1728028800000003" \
  -H "Content-Type: application/json" \
  -d '{
    "commandType": "V1SetMMP",
    "tradingAccountId": "111000000000001",
    "underlyingAssetSymbol": "BTC",
    "windowTimeInSeconds": "10",
    "frozenTimeInSeconds": "30",
    "quantityLimit": "100",
    "deltaLimit": "50"
  }'

GET /trading-api/v2/mmp-configuration

Returns the MMP configuration for a trading account, optionally filtered by underlying asset symbol.
Authentication: Required.

Query Parameters

tradingAccountId
string
required
ID of the trading account.
symbol
string
Underlying asset symbol to filter the configuration by. E.g. BTC.

Example Request

curl -X GET "https://api.exchange.bullish.com/trading-api/v2/mmp-configuration?tradingAccountId=111000000000001&symbol=BTC" \
  -H "Authorization: Bearer <JWT>"

Build docs developers (and LLMs) love