Create Orders
POST request with body parameters for Spot, Margin, CFD/Infinity, Perpetuals.
Last updated
Was this helpful?
POST request with body parameters for Spot, Margin, CFD/Infinity, Perpetuals.
Last updated
Was this helpful?
POST
https://api.liquid.com/orders
This section explains shareable body parameter for trading_type
of Spot
, Margin
, CFD/Infinity
, Perpetuals
.
For body parameters specific to a trading_type
, navigate further below.
order_type
string
Supported values: limit
, market
, market_with_range
, trailing_stop
, limit_post_only
, stop
product_id
number
For BTCUSD product ID is 1
.
side
string
Supported values: buy
or sell
.
quantity
string
The quantity to buy or sell.
price
string
Price per unit of crypto. Only required if order_type is limit
, limit_post_only
, market_with_range
, stop
.
price_range
string
Only available if order_type
is market_with_range
. Using relative value of max deviation from best price on market (slippage control). Will override price parameter.
trailing_stop_type
string
Only available if order_type
is trailing_stop
. Supported values: price
, percentage
.
trailing_stop_value
string
Only available if order_type
is trailing_stop
. The distance (by percent or price) that the order should trail the market price.
client_order_id
string
Create a self-identified Order ID, a custom unique identifying JSON string up to 36 bytes with any content (as long as it is unique). User must avoid special characters besides "-". client_order_id must always be unique and not be reused.
// Refer to specific examples further below
Nonce is not required in if client_order_id is provided.
limit_post_only orders are limit orders that are only accepted if they do not immediately execute. limit_post _only orders never take liquidity.
limit_post_only order will not match with pre-existing orders. If your order would cause a match with a pre-existing order, your limit_post_only order will be cancelled.
limit_post_only order ensures that you pay the maker and not the taker fee.
Available leverage may be limited based on position and/or jurisdiction.
For spot trading (leverage_level=1), the funding_currency, if specified, has to equal to the product's quoted currency, for example to create an order in product BTCJPY, the funding currency has to be JPY.
For market_with_range:
price:
if order is buy: this order swipes out sell price ladders that has price lower than its price. If this action (partial order execution) bumps market ask price higher than its price, remaining unfulfilled quantity cancelled.
if order is sell: this order swipes out buy price ladders that has price higher than its price. If this action (partial order execution) bumps market ask price lower than its price, remaining unfulfilled quantity cancelled.
price_range:
if order is buy: get the current market ask, + the price_range, then we have price and apply above logic.
if order is sell: get the current market bid, - the price_range.
POST /orders/
// With Client Order ID //
{
"order_type": "limit",
"product_id": "27",
"side": "buy",
"quantity": "0.01",
"price": "100",
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Ensures order is a maker//
{
"order_type": "limit_post_only",
"product_id": "27",
"side": "buy",
"quantity": "0.44",
"price": "150"
}
// With Client Order ID
HTTP 200
{
"id": "2279447648",
"order_type": "limit",
"quantity": 0.01,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 100.0,
"created_at": 1612233855,
"updated_at": 1612233855,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": "7b41d04a1551-455a-939c-81c41c365ad9"
}
// Without Client Order ID
HTTP 200
{
"id": "2279447649",
"order_type": "limit",
"quantity": 0.22,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 100.0,
"created_at": 1612233911,
"updated_at": 1612233911,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when an order with "order_type": "limit_post_only"
// is unable to be a maker
HTTP 422
{
"errors": {
"order": [
"do_not_initiate"
]
}
}
// Error when Client Order ID is too long
HTTP 422
{
"errors": {
"client_order_id": ["invalid"]
}
}
// Duplicated Client Order ID //
HTTP 422
{
"errors": {
"client_order_id": ["exists"]
}
}
POST /orders/
{
"order_type": "market",
"product_id": "27",
"side": "buy",
"quantity": "0.444"
}
// Market with range supports immediate-or-cancel (IOC)
// execution up to the stated price_range to
// control price slippage
{
"order_type": "market_with_range",
"product_id": "27",
"side": "sell",
"quantity": "10",
"price_range": "0.1"
}
HTTP 200
{
"id": "2279447550",
"order_type": "market",
"quantity": 0.444,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.444,
"price": 131.2,
"created_at": 1612171692,
"updated_at": 1612171692,
"status": "filled",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// When trading ETHSGD but do not have any SGD balance
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
POST /orders/
{
"order_type": "stop",
"product_id": "27",
"side": "buy",
"quantity": "1.2",
"price": "140"
}
HTTP 200
{
"id": "2279447551",
"order_type": "stop",
"quantity": 1.2,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 140.0,
"created_at": 1612172093,
"updated_at": 1612172093,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// When trading ETHSGD but do not have any SGD balance
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
POST /orders/
// With 10% higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"trailing_stop_type": "percentage",
"trailing_stop_value": "0.05"
}
// Absolute value of 100 higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"trailing_stop_type": "price",
"trailing_stop_value": "100"
}
// With 10% higher than market price
HTTP 200
{
"id": "2279447670",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 131.3312,
"created_at": 1612237942,
"updated_at": 1612237942,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Absolute value of 100 higher than market price
HTTP 200
{
"id": "2279447671",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 231.2,
"created_at": 1612238002,
"updated_at": 1612238002,
"status": "live",
"leverage_level": 1,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": null,
"take_profit": null,
"stop_loss": null,
"trading_type": "spot",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "spot",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// When trading ETHSGD but do not have any SGD balance
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
Parameters
Optional
Description
leverage_level
No
Valid levels: 2
, 4
, 5
, 10
, 25
. Failure to supply these will result in an execution of spot
order with leverage of 1
trading_type
No
Supported value: margin
margin_type
Yes
Supported value:cross
or isolated,
defaults to isolated
. Only available if leverage_level is not 1
.
When "margin_type": "isolated"
the funding_currency
is the quote currency and does not support other funding currencies.
funding_currency
Conditional
Supported values are: SGD
, JPY
, USD
when "margin_type": "cross"
. When placing a BTCJPY order and account does not have JPY but has enough USD
balance, then specify "funding_currency": "USD"
. This will automatically switch margin_type
to cross
.
order_direction
Yes
Supported values: one_direction
, two_direction
, netout
. Defaults totwo_direction
.
When a user has an open Long position in one_direction
, placing a Short order will be rejected, and vice versa.
Use two_direction
to have an open Long position and an open Short position simultaneously.
Decrease the position sizes of a long position, place a short order with netout
.
take_profit
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be greater than the order's price.
If order side is sell
the value of take_profit
must be less than the order's price.
This same rule applies to orders that are executed at market. Take profit will be executed as a limit order.
stop_loss
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be less than the order's price.
If order side is sell
the value of take_profit
must be greater than the order's price.
This same rule applies to orders that are executed at market. Stop Loss will be executed as a market order.
POST /orders/
// With Client Order ID //
{
"order_type": "limit",
"product_id": "27",
"side": "buy",
"price": "120",
"quantity": "0.333",
"leverage_level": "25",
"trading_type": "margin",
"margin_type": "isolated",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "150",
"stop_loss": "100",
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Ensures order is a maker//
{
"order_type": "limit_post_only",
"product_id": "27",
"side": "buy",
"quantity": "0.44",
"price": "150",
"leverage_level": "25",
"trading_type": "margin"
}
HTTP 200
{
"id": "2279447576",
"order_type": "limit",
"quantity": 0.333,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 120.0,
"created_at": 1612175439,
"updated_at": 1612175439,
"status": "live",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "isolated",
"take_profit": 150.0,
"stop_loss": 100.0,
"trading_type": "margin",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
// Error when Client Order ID is too long
HTTP 422
{
"errors": {
"client_order_id": ["invalid"]
}
}
// Duplicated Client Order ID //
HTTP 422
{
"errors": {
"client_order_id": ["exists"]
}
}
// Error when an order with "order_type": "limit_post_only" is unable to be a maker
HTTP 422
{
"errors": {
"order": [
"do_not_initiate"
]
}
}
POST /orders/
{
"order_type": "market",
"product_id": "27",
"side": "buy",
"quantity": "0.444",
"leverage_level": "25",
"trading_type": "margin",
"margin_type": "cross",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "200",
"stop_loss": "100"
}
// Market with range supports immediate-or-cancel (IOC)
// execution up to the stated price_range to
// control price slippage
{
"order_type": "market_with_range",
"product_id": "27",
"side": "sell",
"quantity": "10",
"price_range": "0.1",
"leverage_level": "25",
"trading_type": "margin"
}
HTTP 200
{
"id": "2279447554",
"order_type": "market",
"quantity": 0.444,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.444,
"price": 131.2,
"created_at": 1612172933,
"updated_at": 1612172933,
"status": "filled",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 200.0,
"stop_loss": 100.0,
"trading_type": "margin",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": "97441404",
"client_order_id": null
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error //
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels //
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
{
"order_type": "stop",
"product_id": "27",
"side": "buy",
"price": "120",
"quantity": "0.333",
"leverage_level": "25",
"trading_type": "margin",
"margin_type": "cross",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "150",
"stop_loss": "100"
}
HTTP 200
{
"id": "2279447577",
"order_type": "stop",
"quantity": 0.333,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 120.0,
"created_at": 1612176682,
"updated_at": 1612176682,
"status": "live",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 150.0,
"stop_loss": 100.0,
"trading_type": "margin",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when "side: "buy" and "price: "90" and "stop_loss": "100",
// avoid this by providing a stop_loss that is lower than 90.
HTTP 422
{
"errors": {
"order": [
"new_stop_loss_price_greater_than_price"
]
}
}
// Error when "side: "buy" and "price: "150" and "take_profit": "100",
// avoid this by providing a take_profit that is higher than 150.
HTTP 422
{
"errors": {
"order": [
"new_take_profit_price_less_than_price"
]
}
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
/// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels //
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
// With 10% higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"leverage_level": "2",
"trading_type": "margin",
"trailing_stop_type": "percentage",
"trailing_stop_value": "0.10"
}
// With absolute value of 100 higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"leverage_level": "2",
"trading_type": "margin",
"trailing_stop_type": "price",
"trailing_stop_value": "100"
}
// With 10% higher than market price
HTTP 200
{
"id": "2279447585",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 131.3312,
"created_at": 1612178876,
"updated_at": 1612178876,
"status": "live",
"leverage_level": 2,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "margin",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// With absolute value of 100 higher than market price
HTTP 200
{
"id": "2279447584",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 231.2,
"created_at": 1612178843,
"updated_at": 1612178843,
"status": "live",
"leverage_level": 2,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "margin",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
Parameters
Optional
Description
leverage_level
No
Valid levels: 2
, 4
, 5
, 10
, 25
, 50
, 100
. Failure to supply these will result in an execution of spot
order with leverage of 1
trading_type
No
Supported values: cfd
margin_type
Yes
Supported value:cross
or isolated,
defaults to isolated
. Only available if leverage_level is not 1
.
When "margin_type": "isolated"
the funding_currency
is the quote currency and does not support other funding currencies.
funding_currency
Conditional
Supported values are: SGD
, JPY
, USD
when "margin_type": "cross"
. When placing a BTCJPY order and account does not have JPY but has enough USD
balance, then specify "funding_currency": "USD"
. This will automatically switch margin_type
to cross
.
order_direction
Yes
Supported values: one_direction
, two_direction
, netout
. Defaults totwo_direction
.
When a user has an open Long position in one_direction
, placing a Short order will be rejected, and vice versa.
Use two_direction
to have an open Long position and an open Short position simultaneously.
Decrease the position sizes of a long position, place a short order with netout
.
take_profit
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be greater than the order's price.
If order side is sell
the value of take_profit
must be less than the order's price.
This same rule applies to orders that are executed at market. Take profit will be executed as a limit order.
stop_loss
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be less than the order's price.
If order side is sell
the value of take_profit
must be greater than the order's price.
This same rule applies to orders that are executed at market. Stop loss will be executed as a market order.
POST /orders/
// With Client Order ID //
{
"order_type": "limit",
"product_id": "27",
"side": "buy",
"price": "120",
"quantity": "0.333",
"leverage_level": "25",
"trading_type": "cfd",
"margin_type": "isolated",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "150",
"stop_loss": "100",
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Ensures order is a maker//
{
"order_type": "limit_post_only",
"product_id": "27",
"side": "buy",
"quantity": "0.55",
"price": "100",
"leverage_level": "25",
"trading_type": "cfd"
}
HTTP 200
{
"id": "2279447576",
"order_type": "limit",
"quantity": 0.333,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 120.0,
"created_at": 1612175439,
"updated_at": 1612175439,
"status": "live",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "isolated",
"take_profit": 150.0,
"stop_loss": 100.0,
"trading_type": "cfd",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
// Error when Client Order ID is too long
HTTP 422
{
"errors": {
"client_order_id": ["invalid"]
}
}
// Duplicated Client Order ID
HTTP 422
{
"errors": {
"client_order_id": ["exists"]
}
}
// Error when an order with "order_type": "limit_post_only" is unable to be a maker
HTTP 422
{
"errors": {
"order": [
"do_not_initiate"
]
}
}
POST /orders/
{
"order_type": "market",
"product_id": "27",
"side": "buy",
"quantity": "0.444",
"leverage_level": "25",
"trading_type": "cfd",
"margin_type": "cross",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "200",
"stop_loss": "100"
}
// Market with range supports immediate-or-cancel (IOC)
// execution up to the stated price_range to
// control price slippage
{
"order_type": "market_with_range",
"product_id": "27",
"side": "sell",
"quantity": "10",
"price_range": "0.1",
"leverage_level": "50",
"trading_type": "cfd"
}
HTTP 200
{
"id": "2279447554",
"order_type": "market",
"quantity": 0.444,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.444,
"price": 131.2,
"created_at": 1612172933,
"updated_at": 1612172933,
"status": "filled",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 200.0,
"stop_loss": 100.0,
"trading_type": "cfd",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": "97441404",
"client_order_id": null
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD", avoid this by changing to "margin_type": "cross"
// or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
{
"order_type": "stop",
"product_id": "27",
"side": "buy",
"price": "120",
"quantity": "0.333",
"leverage_level": "25",
"trading_type": "cfd",
"margin_type": "cross",
"funding_currency": "USD",
"order_direction": "netout",
"take_profit": "150",
"stop_loss": "100"
}
HTTP 200
{
"id": "2279447577",
"order_type": "stop",
"quantity": 0.333,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 120.0,
"created_at": 1612176682,
"updated_at": 1612176682,
"status": "live",
"leverage_level": 25,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 150.0,
"stop_loss": 100.0,
"trading_type": "cfd",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "netout_open",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when "side: "buy" and "price: "90" and "stop_loss": "100", avoid this
// by providing a stop_loss that is lower than 90.
HTTP 422
{
"errors": {
"order": [
"new_stop_loss_price_greater_than_price"
]
}
}
// Error when "side: "buy" and "price: "150" and "take_profit": "100", avoid this
// by providing a take_profit that is higher than 150.
HTTP 422
{
"errors": {
"order": [
"new_take_profit_price_less_than_price"
]
}
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
// With 10% higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"leverage_level": "2",
"trading_type": "cfd",
"trailing_stop_type": "percentage",
"trailing_stop_value": "0.10"
}
// With absolute value of 100 higher than market price //
{
"order_type": "trailing_stop",
"product_id": "27",
"side": "buy",
"quantity": "0.666",
"leverage_level": "2",
"trading_type": "cfd",
"trailing_stop_type": "price",
"trailing_stop_value": "100"
}
// With 10% higher than market price
HTTP 422
{
"id": "2279447585",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 131.3312,
"created_at": 1612178876,
"updated_at": 1612178876,
"status": "live",
"leverage_level": 2,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "cfd",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// With absolute value of 100 higher than market price
HTTP 422
{
"id": "2279447584",
"order_type": "trailing_stop",
"quantity": 0.666,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 231.2,
"created_at": 1612178843,
"updated_at": 1612178843,
"status": "live",
"leverage_level": 2,
"source_exchange": "QUOINE",
"product_id": "27",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "cfd",
"product_code": "CASH",
"funding_currency": "USD",
"crypto_account_id": null,
"currency_pair_code": "ETHUSD",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when trading BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
Parameters
Optional
Description
leverage_level
No
Valid levels: 2
, 4
, 5
, 10
, 25
, 50
, 100
. Failure to supply these will result in an execution of spot
order with leverage of 1
trading_type
No
Supported values: perpetual
margin_type
Yes
Supported value:cross
or isolated,
defaults to isolated
. Only available if leverage_level is not 1
.
funding_currency
Conditional
Currency used to fund the trade with. Default is quoted currency (e.g a trade in BTCUSD product will use USD as the funding currency as default)
order_direction
Yes
Supported values: one_direction
, netout
. Defaults toone_direction
.
When a user has an open Long position in one_direction
, placing a Short order will be rejected, and vice versa.
Decrease the position sizes of a long position, place a short order with netout
.
take_profit
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be greater than the order's price.
If order side is sell
the value of take_profit
must be less than the order's price.
This same rule applies to orders that are executed at market. Take profit will be executed as a limit order.
stop_loss
Yes
Only available if leverage_level is greater than 1.
If order side is buy
the value of take_profit
must be less than the order's price.
If order side is sell
the value of take_profit
must be greater than the order's price.
This same rule applies to orders that are executed at market. Stop Loss will be executed as a market order.
POST /orders/
// With Client Order ID //
{
"order_type": "limit",
"product_id": "603",
"side": "buy",
"quantity": "0.123",
"price": "300000",
"leverage_level": "100",
"trading_type": "perpetual",
"margin_type": "isolated",
"funding_currency": "JPY",
"order_direction": "netout",
"take_profit": "322222",
"stop_loss": "288888",
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Ensures order is a maker//
{
"order_type": "limit_post_only",
"product_id": "603",
"side": "buy",
"quantity": "0.66",
"price": "450000",
"leverage_level": "100",
"trading_type": "perpetual"
}
HTTP 422
{
"id": "2279447632",
"order_type": "limit",
"quantity": 0.123,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 300000.0,
"created_at": 1612232890,
"updated_at": 1612232890,
"status": "live",
"leverage_level": 100,
"source_exchange": "QUOINE",
"product_id": "603",
"margin_type": "isolated",
"take_profit": 322250.0,
"stop_loss": 288900.0,
"trading_type": "perpetual",
"product_code": "CASH",
"funding_currency": "JPY",
"crypto_account_id": null,
"currency_pair_code": "P-BTCJPY",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
}
// Error when trading P-BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading P-BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
// Error when Client Order ID is too long
HTTP 422
{
"errors": {
"client_order_id": ["invalid"]
}
}
// Duplicated Client Order ID
HTTP 422
{
"errors": {
"client_order_id": ["exists"]
}
}
// Error when an order with "order_type": "limit_post_only" is unable to be a maker
HTTP 422
{
"errors": {
"order": [
"do_not_initiate"
]
}
}
POST /orders/
{
"order_type": "market",
"product_id": "603",
"side": "buy",
"quantity": "1.23",
"leverage_level": "100",
"trading_type": "perpetual",
"margin_type": "isolated",
"funding_currency": "JPY",
"order_direction": "netout"
}
// Market with range supports immediate-or-cancel (IOC)
// execution up to the stated price_range to
// control price slippage
{
"order_type": "market_with_range",
"product_id": "603",
"side": "sell",
"quantity": "0.5",
"price_range": "10000",
"leverage_level": "100",
"trading_type": "perpetual"
}
HTTP 200
{
"id": "2279447625",
"order_type": "market",
"quantity": 1.23,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 1.23,
"price": 455000.0,
"created_at": 1612232621,
"updated_at": 1612232621,
"status": "filled",
"leverage_level": 100,
"source_exchange": "QUOINE",
"product_id": "603",
"margin_type": "isolated",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "perpetual",
"product_code": "CASH",
"funding_currency": "JPY",
"crypto_account_id": null,
"currency_pair_code": "P-BTCJPY",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": "97441425",
"client_order_id": null
}
// Error when trading P-BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading P-BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
{
"order_type": "stop",
"product_id": "603",
"side": "buy",
"quantity": "0.123",
"price": "500000",
"leverage_level": "100",
"trading_type": "perpetual",
"margin_type": "isolated",
"funding_currency": "JPY",
"order_direction": "netout",
"take_profit": "522222",
"stop_loss": "488888"
}
HTTP 200
{
"id": "2279447643",
"order_type": "stop",
"quantity": 0.123,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 500000.0,
"created_at": 1612233154,
"updated_at": 1612233154,
"status": "live",
"leverage_level": 100,
"source_exchange": "QUOINE",
"product_id": "603",
"margin_type": "isolated",
"take_profit": 522250.0,
"stop_loss": 488900.0,
"trading_type": "perpetual",
"product_code": "CASH",
"funding_currency": "JPY",
"crypto_account_id": null,
"currency_pair_code": "P-BTCJPY",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when "side: "buy" and "price: "90" and "stop_loss": "100", avoid this
// by providing a stop_loss that is lower than 90.
HTTP 422
{
"errors": {
"order": [
"new_stop_loss_price_greater_than_price"
]
}
}
// Error when "side: "buy" and "price: "150" and "take_profit": "100", avoid this
// by providing a take_profit that is higher than 150.
HTTP 422
{
"errors": {
"order": [
"new_take_profit_price_less_than_price"
]
}
}
// Error when trading P-BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading P-BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}
POST /orders/
// With 10% higher than market price //
{
"order_type": "trailing_stop",
"product_id": "603",
"side": "buy",
"quantity": "0.234",
"leverage_level": "100",
"trading_type": "perpetual",
"trailing_stop_type": "percentage",
"trailing_stop_value": "0.10"
}
// With absolute value of 10000 higher than market price //
{
"order_type": "trailing_stop",
"product_id": "603",
"side": "buy",
"quantity": "0.345",
"leverage_level": "100",
"trading_type": "perpetual",
"trailing_stop_type": "price",
"trailing_stop_value": "10000"
}
// With 10% higher than market price
HTTP 200
{
"id": "2279447644",
"order_type": "trailing_stop",
"quantity": 0.234,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 460450.0,
"created_at": 1612233287,
"updated_at": 1612233287,
"status": "live",
"leverage_level": 100,
"source_exchange": "QUOINE",
"product_id": "603",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "perpetual",
"product_code": "CASH",
"funding_currency": "JPY",
"crypto_account_id": null,
"currency_pair_code": "P-BTCJPY",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// With absolute value of 100 higher than market price
HTTP 200
{
"id": "2279447645",
"order_type": "trailing_stop",
"quantity": 0.345,
"disc_quantity": 0.0,
"iceberg_total_quantity": 0.0,
"side": "buy",
"filled_quantity": 0.0,
"price": 470000.0,
"created_at": 1612233386,
"updated_at": 1612233386,
"status": "live",
"leverage_level": 100,
"source_exchange": "QUOINE",
"product_id": "603",
"margin_type": "cross",
"take_profit": 0.0,
"stop_loss": 0.0,
"trading_type": "perpetual",
"product_code": "CASH",
"funding_currency": "JPY",
"crypto_account_id": null,
"currency_pair_code": "P-BTCJPY",
"average_price": 0.0,
"target": "open",
"order_fee": 0.0,
"source_action": "manual",
"unwound_trade_id": null,
"trade_id": null,
"client_order_id": null
}
// Error when trading P-BTCJPY but account does not have enough JPY balance.
// If account has enough USD balance, provide "funding_currency": "USD"
// to use USD to trade and avoid this error
HTTP 422
{
"errors": {
"user": [
"not_enough_free_balance"
]
}
}
// Error when trading P-BTCJPY and provided "margin_type": "isolated" and
// "funding_currency": "USD" (if have enough USD balance), avoid this by
// changing to "margin_type": "cross" or simply just removing "margin_type"
HTTP 422
{
"errors": {
"order": [
"isolated_feature_is_disabled_for_multi_currency"
]
}
}
// Error when not proving valid leverage levels
HTTP 422
{
"errors": {
"leverage_level": [
"not_valid"
]
}
}
// Error when trying to place a short order but current long position exist
// and long position was an order with "order_direction": "one_direction", avoid
// this by using "order_direction": "two_direction" or "order_direction": "netout"
HTTP 422
{
"errors": {
"user": [
"have_another_direction_trade"
]
}
}