POST
/
api
/
v1
/
orders
Create order
curl --request POST \
  --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>' \
  --header 'Content-Type: application/json' \
  --data '{
  "client_order_id": "<string>",
  "side": "BUY",
  "size": "<string>",
  "tif": "GTC",
  "instrument": "<string>",
  "type": "LIMIT",
  "price": "<string>",
  "stop_price": "<string>",
  "stop_limit_price": "<string>",
  "expire_time": "2023-11-07T05:31:56Z",
  "portfolio": "<string>",
  "stp_mode": "AGGRESSING",
  "post_only": true,
  "close_only": true,
  "algo_strategy": "TWAP"
}'
{
  "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);
CreateOrderRequest request = new CreateOrderRequest.Builder()
    .instrument("BTC-PERP")
    .side("BUY")
    .size("0.0001")
    .orderType("LIMIT")
    .price("50000")
    .tif("GTC")
    .clientOrderId("1234567890")
    .build();
CreateOrderResponse response = ordersService.createOrder(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

Body

application/json
client_order_id
string
required

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)
side
enum<string>
required

The side of the transaction

Available options:
BUY,
SELL
Example:

"BUY"

size
string
required

The amount in base asset units

tif
enum<string>
required

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

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

"GTC"

instrument
string
required

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

type
enum<string>
required

The type of order being submitted

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.

stop_price
string

The market price that activates a stop order

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.

expire_time
string<date-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).

portfolio
string

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

stp_mode
enum<string>

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

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

"AGGRESSING"

post_only
boolean

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

close_only
boolean

Only submit the order if it will close an existing order

algo_strategy
enum<string>

The algorithmic trading strategy to use for the order

Available options:
TWAP
Example:

"TWAP"

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"