Skip to main content

Create order

posthttps://api.international.coinbase.com/api/

Creates a new order.

Headers
string
required

The Client ID that owns the API Key for the request

string
required

The timestamp of when the request is being made

string
required

The pass phrase affiliated with the API Key

string
required

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

Body params
client_order_idstring

A unique identifier assigned by the client. Must meet one of the following constraints:

  • 18 characters long using all ASCII characters
  • 20 characters long using alphanumeric characters and dash (-)
  • 31 characters long using hexadecimal characters (0-9, a-f, lowercase and no preceding 0s)
  • A UUID using standard hyphenation and all lowercase (e.g., 36a9d3ee-32b7-460e-979a-121735af4824)
sidestring
Possible values: [BUY, SELL]

The side of the transaction

sizestring

The amount in base asset units

tifstring
Possible values: [GTC, IOC, GTT]

The time in force applied to an order. A Good Till Cancel (GTC) or Good Till Time (GTT) can last up to 30 days while 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. Required for all order types except market orders.

instrumentstring

The name, ID, or UUID of the instrument the order wants to transact

typestring
Possible values: [LIMIT, MARKET, STOP_LIMIT, STOP, TAKE_PROFIT_STOP_LOSS]

The type of order being submitted

pricestring

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.

stop_pricestring

The market price that activates a stop order

stop_limit_pricestring

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

expire_timedate-time

The expiration time required for orders with the time in force set to GTT. Must not go beyond 30 days of the current time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).

portfoliostring

The ID or UUID of the portfolio the order belongs to (uses default portfolio if not defined)

userstring

The ID or UUID of the user the order belongs to (only used and required for brokers)

stp_modestring
Possible values: [NONE, AGGRESSING, RESTING, BOTH, DECREMENT_AND_CANCEL]

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

post_onlyboolean

Only submit the order if it will rest on the order book

Responses
Language
Authorization
Header
Request
Response

Click an example response code to see the response here!

application/json