DELETE
/
api
/
v1
/
orders
Cancel orders
curl --request DELETE \
  --url https://api.international.coinbase.com/api/v1/orders \
  --header 'CB-ACCESS-KEY: <api-key>' \
  --header 'CB-ACCESS-PASSPHRASE: <api-key>' \
  --header 'CB-ACCESS-SIGN: <api-key>' \
  --header 'CB-ACCESS-TIMESTAMP: <api-key>'
[
  {
    "order_id": 43877033468085760,
    "client_order_id": "ABC123",
    "side": "BUY",
    "instrument_id": 2562519737567269,
    "instrument_uuid": "359f66d8-4235-47c3-9733-0fbfe2cfaa0a",
    "symbol": "BTC-PERP",
    "portfolio_id": 1724343681801273,
    "portfolio_uuid": "b80ec69b-1229-4bcf-a6a8-c506ffd74c20",
    "type": "LIMIT",
    "price": 20215.53,
    "stop_price": 20015.53,
    "stop_limit_price": 20015.53,
    "size": 1.5423,
    "tif": "GTC",
    "expire_time": "2023-03-16T23:59:53.000Z",
    "stp_mode": "AGGRESSING",
    "event_type": "TRADE",
    "event_time": "2023-03-16T23:59:53.000Z",
    "submit_time": "2023-03-16T23:59:53.000Z",
    "order_status": "WORKING",
    "leaves_qty": "<string>",
    "exec_qty": "<string>",
    "avg_price": "<string>",
    "fee": "<string>",
    "post_only": true,
    "close_only": true,
    "algo_strategy": "TWAP",
    "text": "client cancel"
  }
]
OrdersService ordersService = IntxServiceFactory.createOrdersService(client);
CancelOrdersRequest request = new CancelOrdersRequest.Builder()
    .portfolio("portfolio_id")
    .build();
CancelOrdersResponse response = ordersService.cancelOrders(request);
For more information, please visit the INTX Java SDK.

Authorizations

CB-ACCESS-KEY
string
header
required

The Client ID that owns the API Key for the request

CB-ACCESS-PASSPHRASE
string
header
required

The pass phrase affiliated with the API Key

CB-ACCESS-SIGN
string
header
required

A HMAC SHA-256 signature using the API Key secret on the string TIMESTAMP, METHOD, REQUEST_PATH, BODY

CB-ACCESS-TIMESTAMP
string
header
required

The timestamp of when the request is being made

Query Parameters

portfolio
string
required

Identifies the portfolio by UUID (e.g., 892e8c7c-e979-4cad-b61b-55a197932cf1) or portfolio ID (e.g., 5189861793641175)

instrument
string

Identifies the instrument by name (e.g., BTC-USDC), UUID (e.g., ce55a827-f04a-45c0-9d9b-8bbdb9b48065), or instrument ID (e.g., 7149252043835013)

side
enum<string>

Identifies the side by name (e.g., BUY, SELL)

Available options:
BUY,
SELL
Example:

"BUY"

instrument_type
string

Identifies the instruments by type . Allowed values: SPOT, PERPETUAL_FUTURE

Response

Order submitted

order_id
string

A unique identifier assigned by the exchange

Example:

43877033468085760

client_order_id
string

A unique identifier assigned by the client

Example:

"ABC123"

side
enum<string>

The side of the transaction

Available options:
BUY,
SELL
Example:

"BUY"

instrument_id
string

The unique identifier of the instrument the order wants to transact in

Example:

2562519737567269

instrument_uuid
string<uuid>

The UUID of the instrument the order wants to transact in

Example:

"359f66d8-4235-47c3-9733-0fbfe2cfaa0a"

symbol
string

The name of the instrument the order wants to transact in

Example:

"BTC-PERP"

portfolio_id
string<string>

The unique identifier of the portfolio the order was submitted under

Example:

1724343681801273

portfolio_uuid
string<uuid>

The UUID of the portfolio the order was submitted under

Example:

"b80ec69b-1229-4bcf-a6a8-c506ffd74c20"

type
enum<string>

The type of the order

Available options:
LIMIT,
MARKET,
STOP_LIMIT,
STOP,
TAKE_PROFIT_STOP_LOSS
Example:

"LIMIT"

price
string

The max or min price limit in quote asset units to buy or sell at (respectively). Only used for limit and stop limit order types.

Example:

20215.53

stop_price
string

The market price that activates a stop order

Example:

20015.53

stop_limit_price
string

The limit price at which the TP/SL stop leg order will be placed. Only used for TP/SL order type.

Example:

20015.53

size
string

The amount in base asset units

Example:

1.5423

tif
enum<string>

The time in force applied to an order. A Good Till Cancel (GTC) can last up to 30 days. An Immediate or Cancel (IOC) attempts to fill as much of the order as possible and/or cancels immediately when no resting orders meet or improve the order's price limit. A Fill or Kill (FOK) is canceled without filling if it does not completely fill immediately. This will not be populated for assignments

Available options:
GTC,
IOC,
GTT,
FOK
Example:

"GTC"

expire_time
string<date-time>

The expiration time for orders with the time in force set to GTT. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).

Example:

"2023-03-16T23:59:53.000Z"

stp_mode
enum<string>

Specifies the behavior for self match handling. None disables the functionality, new cancels the newest order, and both cancels both

Available options:
NONE,
AGGRESSING,
RESTING,
BOTH,
DECREMENT_AND_CANCEL
Example:

"AGGRESSING"

event_type
enum<string>

The most recent type of event that happened to the order

Available options:
NEW,
TRADE,
CANCELED,
REPLACED,
PENDING_CANCEL,
REJECTED,
PENDING_NEW,
EXPIRED,
PENDING_REPLACE,
STOP_TRIGGERED
Example:

"TRADE"

event_time
string<date-time>
Example:

"2023-03-16T23:59:53.000Z"

submit_time
string<date-time>
Example:

"2023-03-16T23:59:53.000Z"

order_status
enum<string>

The type of the order

Available options:
WORKING,
DONE
Example:

"WORKING"

leaves_qty
string

The amount of the order remaining open on the exchange

exec_qty
string

The traded quantity on the order

avg_price
string

The average price that the order has traded at so far

fee
string

The exchange fee affiliated with the trade (only for trade events)

post_only
boolean

Indicates that the order was submitted with the post_only instruction

close_only
boolean

Indicates that the order was submitted with the close_only instruction

algo_strategy
enum<string>

Specifies the algorithmic trading strategy for the order

Available options:
TWAP
Example:

"TWAP"

text
string

A text message that gets populated for canceled orders

Example:

"client cancel"