DELETE
/
orders
/
{order_id}
curl --request DELETE \
  --url https://api.exchange.coinbase.com/orders/{order_id} \
  --header 'cb-access-key: <api-key>' \
  --header 'cb-access-passphrase: <api-key>' \
  --header 'cb-access-sign: <api-key>' \
  --header 'cb-access-timestamp: <api-key>'
"<string>"

Cancel a previously placed order

The order must belong to the profile that the API key belongs to. If the order had no matches during its lifetime, its record may be purged. This means the order details is not available with GET /orders/<id>.

To prevent a race condition when canceling an order, it is highly recommended that you specify the product id as a query string.

API Key Permissions

This endpoint requires the “trade” permission.

Orders can be canceled using either the exchange assigned id or the client assigned client_oid. When using client_oid it must be preceded by the client: namespace.

Response

A successfully cancelled order response includes:

  • the order ID if the order is cancelled with the exchange assigned id,
  • the client assigned client_oid if the order is cancelled with client order ID.

Cancel Reject

If the order could not be canceled (already filled or previously canceled, etc.), then an error response indicates the reason in the message field.

Authorizations

cb-access-key
string
header
required
cb-access-passphrase
string
header
required
cb-access-sign
string
header
required
cb-access-timestamp
string
header
required

Path Parameters

order_id
string
required

Orders may be canceled using either the exchange assigned id or the client assigned client_oid. When using client_oid it must be preceded by the client: namespace.

Query Parameters

profile_id
string

Cancels orders on a specific profile

product_id
string

Optional product id of order

Response

200
application/json

the id of the order that was cancelled`