Liquid API
Search…
Create Orders
POST request with body parameters for Spot, Margin, CFD/Infinity, Perpetuals.
post
https://api.liquid.com
/orders
Create an Order
Nonce is not required in authentication’s payload 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.

Spot Order Type Examples

Limit Order

Request
Response
1
POST /orders/
2
3
// With Client Order ID //
4
{
5
"order_type": "limit",
6
"product_id": "27",
7
"side": "buy",
8
"quantity": "0.01",
9
"price": "100",
10
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
11
}
12
13
// Ensures order is a maker//
14
{
15
"order_type": "limit_post_only",
16
"product_id": "27",
17
"side": "buy",
18
"quantity": "0.44",
19
"price": "150"
20
}
Copied!
1
// With Client Order ID
2
HTTP 200
3
{
4
"id": "2279447648",
5
"order_type": "limit",
6
"quantity": 0.01,
7
"disc_quantity": 0.0,
8
"iceberg_total_quantity": 0.0,
9
"side": "buy",
10
"filled_quantity": 0.0,
11
"price": 100.0,
12
"created_at": 1612233855,
13
"updated_at": 1612233855,
14
"status": "live",
15
"leverage_level": 1,
16
"source_exchange": "QUOINE",
17
"product_id": "27",
18
"margin_type": null,
19
"take_profit": null,
20
"stop_loss": null,
21
"trading_type": "spot",
22
"product_code": "CASH",
23
"funding_currency": "USD",
24
"crypto_account_id": null,
25
"currency_pair_code": "ETHUSD",
26
"average_price": 0.0,
27
"target": "spot",
28
"order_fee": 0.0,
29
"source_action": "manual",
30
"unwound_trade_id": null,
31
"trade_id": null,
32
"client_order_id": "7b41d04a1551-455a-939c-81c41c365ad9"
33
}
34
35
// Without Client Order ID
36
HTTP 200
37
{
38
"id": "2279447649",
39
"order_type": "limit",
40
"quantity": 0.22,
41
"disc_quantity": 0.0,
42
"iceberg_total_quantity": 0.0,
43
"side": "buy",
44
"filled_quantity": 0.0,
45
"price": 100.0,
46
"created_at": 1612233911,
47
"updated_at": 1612233911,
48
"status": "live",
49
"leverage_level": 1,
50
"source_exchange": "QUOINE",
51
"product_id": "27",
52
"margin_type": null,
53
"take_profit": null,
54
"stop_loss": null,
55
"trading_type": "spot",
56
"product_code": "CASH",
57
"funding_currency": "USD",
58
"crypto_account_id": null,
59
"currency_pair_code": "ETHUSD",
60
"average_price": 0.0,
61
"target": "spot",
62
"order_fee": 0.0,
63
"source_action": "manual",
64
"unwound_trade_id": null,
65
"trade_id": null,
66
"client_order_id": null
67
}
68
69
// Error when an order with "order_type": "limit_post_only"
70
// is unable to be a maker
71
HTTP 422
72
{
73
"errors": {
74
"order": [
75
"do_not_initiate"
76
]
77
}
78
}
79
80
// Error when Client Order ID is too long
81
HTTP 422
82
{
83
"errors": {
84
"client_order_id": ["invalid"]
85
}
86
}
87
88
// Duplicated Client Order ID //
89
HTTP 422
90
{
91
"errors": {
92
"client_order_id": ["exists"]
93
}
94
}
Copied!

Market Order

Request
Response
1
POST /orders/
2
3
{
4
"order_type": "market",
5
"product_id": "27",
6
"side": "buy",
7
"quantity": "0.444"
8
}
9
10
// Market with range supports immediate-or-cancel (IOC)
11
// execution up to the stated price_range to
12
// control price slippage
13
{
14
"order_type": "market_with_range",
15
"product_id": "27",
16
"side": "sell",
17
"quantity": "10",
18
"price_range": "0.1"
19
}
Copied!
1
HTTP 200
2
{
3
"id": "2279447550",
4
"order_type": "market",
5
"quantity": 0.444,
6
"disc_quantity": 0.0,
7
"iceberg_total_quantity": 0.0,
8
"side": "buy",
9
"filled_quantity": 0.444,
10
"price": 131.2,
11
"created_at": 1612171692,
12
"updated_at": 1612171692,
13
"status": "filled",
14
"leverage_level": 1,
15
"source_exchange": "QUOINE",
16
"product_id": "27",
17
"margin_type": null,
18
"take_profit": null,
19
"stop_loss": null,
20
"trading_type": "spot",
21
"product_code": "CASH",
22
"funding_currency": "USD",
23
"crypto_account_id": null,
24
"currency_pair_code": "ETHUSD",
25
"average_price": 0.0,
26
"target": "spot",
27
"order_fee": 0.0,
28
"source_action": "manual",
29
"unwound_trade_id": null,
30
"trade_id": null,
31
"client_order_id": null
32
}
33
34
// When trading ETHSGD but do not have any SGD balance
35
HTTP 422
36
{
37
"errors": {
38
"user": [
39
"not_enough_free_balance"
40
]
41
}
42
}
Copied!

Stop Order

Request
Response
1
POST /orders/
2
3
{
4
"order_type": "stop",
5
"product_id": "27",
6
"side": "buy",
7
"quantity": "1.2",
8
"price": "140"
9
}
Copied!
1
HTTP 200
2
{
3
"id": "2279447551",
4
"order_type": "stop",
5
"quantity": 1.2,
6
"disc_quantity": 0.0,
7
"iceberg_total_quantity": 0.0,
8
"side": "buy",
9
"filled_quantity": 0.0,
10
"price": 140.0,
11
"created_at": 1612172093,
12
"updated_at": 1612172093,
13
"status": "live",
14
"leverage_level": 1,
15
"source_exchange": "QUOINE",
16
"product_id": "27",
17
"margin_type": null,
18
"take_profit": null,
19
"stop_loss": null,
20
"trading_type": "spot",
21
"product_code": "CASH",
22
"funding_currency": "USD",
23
"crypto_account_id": null,
24
"currency_pair_code": "ETHUSD",
25
"average_price": 0.0,
26
"target": "spot",
27
"order_fee": 0.0,
28
"source_action": "manual",
29
"unwound_trade_id": null,
30
"trade_id": null,
31
"client_order_id": null
32
}
33
34
// When trading ETHSGD but do not have any SGD balance
35
HTTP 422
36
{
37
"errors": {
38
"user": [
39
"not_enough_free_balance"
40
]
41
}
42
}
Copied!

Trailing-Stop Order

Request
Response
1
POST /orders/
2
3
// With 10% higher than market price //
4
{
5
"order_type": "trailing_stop",
6
"product_id": "27",
7
"side": "buy",
8
"quantity": "0.666",
9
"trailing_stop_type": "percentage",
10
"trailing_stop_value": "0.05"
11
}
12
// Absolute value of 100 higher than market price //
13
{
14
"order_type": "trailing_stop",
15
"product_id": "27",
16
"side": "buy",
17
"quantity": "0.666",
18
"trailing_stop_type": "price",
19
"trailing_stop_value": "100"
20
}
Copied!
1
// With 10% higher than market price
2
HTTP 200
3
{
4
"id": "2279447670",
5
"order_type": "trailing_stop",
6
"quantity": 0.666,
7
"disc_quantity": 0.0,
8
"iceberg_total_quantity": 0.0,
9
"side": "buy",
10
"filled_quantity": 0.0,
11
"price": 131.3312,
12
"created_at": 1612237942,
13
"updated_at": 1612237942,
14
"status": "live",
15
"leverage_level": 1,
16
"source_exchange": "QUOINE",
17
"product_id": "27",
18
"margin_type": null,
19
"take_profit": null,
20
"stop_loss": null,
21
"trading_type": "spot",
22
"product_code": "CASH",
23
"funding_currency": "USD",
24
"crypto_account_id": null,
25
"currency_pair_code": "ETHUSD",
26
"average_price": 0.0,
27
"target": "spot",
28
"order_fee": 0.0,
29
"source_action": "manual",
30
"unwound_trade_id": null,
31
"trade_id": null,
32
"client_order_id": null
33
}
34
35
// Absolute value of 100 higher than market price
36
HTTP 200
37
{
38
"id": "2279447671",
39
"order_type": "trailing_stop",
40
"quantity": 0.666,
41
"disc_quantity": 0.0,
42
"iceberg_total_quantity": 0.0,
43
"side": "buy",
44
"filled_quantity": 0.0,
45
"price": 231.2,
46
"created_at": 1612238002,
47
"updated_at": 1612238002,
48
"status": "live",
49
"leverage_level": 1,
50
"source_exchange": "QUOINE",
51
"product_id": "27",
52
"margin_type": null,
53
"take_profit": null,
54
"stop_loss": null,
55
"trading_type": "spot",
56
"product_code": "CASH",
57
"funding_currency": "USD",
58
"crypto_account_id": null,
59
"currency_pair_code": "ETHUSD",
60
"average_price": 0.0,
61
"target": "spot",
62
"order_fee": 0.0,
63
"source_action": "manual",
64
"unwound_trade_id": null,
65
"trade_id": null,
66
"client_order_id": null
67
}
68
69
// When trading ETHSGD but do not have any SGD balance
70
HTTP 422
71
{
72
"errors": {
73
"user": [
74
"not_enough_free_balance"
75
]
76
}
77
}
Copied!

Margin Orders Additional Body Parameters

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_profitmust 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_profitmust 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.

Limit Order

Request
Response
1
POST /orders/
2
3
// With Client Order ID //
4
{
5
"order_type": "limit",
6
"product_id": "27",
7
"side": "buy",
8
"price": "120",
9
"quantity": "0.333",
10
"leverage_level": "25",
11
"trading_type": "margin",
12
"margin_type": "isolated",
13
"funding_currency": "USD",
14
"order_direction": "netout",
15
"take_profit": "150",
16
"stop_loss": "100",
17
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
18
}
19
20
// Ensures order is a maker//
21
{
22
"order_type": "limit_post_only",
23
"product_id": "27",
24
"side": "buy",
25
"quantity": "0.44",
26
"price": "150",
27
"leverage_level": "25",
28
"trading_type": "margin"
29
}
Copied!
1
HTTP 200
2
{
3
"id": "2279447576",
4
"order_type": "limit",
5
"quantity": 0.333,
6
"disc_quantity": 0.0,
7
"iceberg_total_quantity": 0.0,
8
"side": "buy",
9
"filled_quantity": 0.0,
10
"price": 120.0,
11
"created_at": 1612175439,
12
"updated_at": 1612175439,
13
"status": "live",
14
"leverage_level": 25,
15
"source_exchange": "QUOINE",
16
"product_id": "27",
17
"margin_type": "isolated",
18
"take_profit": 150.0,
19
"stop_loss": 100.0,
20
"trading_type": "margin",
21
"product_code": "CASH",
22
"funding_currency": "USD",
23
"crypto_account_id": null,
24
"currency_pair_code": "ETHUSD",
25
"average_price": 0.0,
26
"target": "open",
27
"order_fee": 0.0,
28
"source_action": "netout_open",
29
"unwound_trade_id": null,
30
"trade_id": null,
31
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
32
}
33
34
// Error when trading BTCJPY but account does not have enough JPY balance.
35
// If account has enough USD balance, provide "funding_currency": "USD"
36
// to use USD to trade and avoid this error
37
HTTP 422
38
{
39
"errors": {
40
"user": [
41
"not_enough_free_balance"
42
]
43
}
44
}
45
46
// Error when trading BTCJPY and provided "margin_type": "isolated" and
47
// "funding_currency": "USD" (if have enough USD balance), avoid this by
48
// changing to "margin_type": "cross" or simply just removing "margin_type"
49
HTTP 422
50
{
51
"errors": {
52
"order": [
53
"isolated_feature_is_disabled_for_multi_currency"
54
]
55
}
56
}
57
58
// Error when not proving valid leverage levels
59
HTTP 422
60
{
61
"errors": {
62
"leverage_level": [
63
"not_valid"
64
]
65
}
66
}
67
68
// Error when trying to place a short order but current long position exist
69
// and long position was an order with "order_direction": "one_direction", avoid
70
// this by using "order_direction": "two_direction" or "order_direction": "netout"
71
HTTP 422
72
{
73
"errors": {
74
"user": [
75
"have_another_direction_trade"
76
]
77
}
78
}
79
80
// Error when Client Order ID is too long
81
HTTP 422
82
{
83
"errors": {
84
"client_order_id": ["invalid"]
85
}
86
}
87
88
// Duplicated Client Order ID //
89
HTTP 422
90
{
91
"errors": {
92
"client_order_id": ["exists"]
93
}
94
}
95
96
// Error when an order with "order_type": "limit_post_only" is unable to be a maker
97
HTTP 422
98
{
99
"errors": {
100
"order": [
101
"do_not_initiate"
102
]
103
}
104
}
Copied!

Market Order

Request
Response
1
POST /orders/
2
3
{
4
"order_type": "market",
5
"product_id": "27",
6
"side": "buy",
7
"quantity": "0.444",
8
"leverage_level": "25",
9
"trading_type": "margin",
10
"margin_type": "cross",
11
"funding_currency": "USD",
12
"order_direction": "netout",
13
"take_profit": "200",
14
"stop_loss": "100"
15
}
16
17
// Market with range supports immediate-or-cancel (IOC)
18
// execution up to the stated price_range to
19
// control price slippage
20
{
21
"order_type": "market_with_range",
22
"product_id": "27",
23
"side": "sell",
24
"quantity": "10",
25
"price_range": "0.1",
26
"leverage_level": "25",
27
"trading_type": "margin"
28
}
Copied!
1
HTTP 200
2
{
3
"id": "2279447554",
4
"order_type": "market",
5
"quantity": 0.444,
6
"disc_quantity": 0.0,
7
"iceberg_total_quantity": 0.0,
8
"side": "buy",
9
"filled_quantity": 0.444,
10
"price": 131.2,
11
"created_at": 1612172933,
12
"updated_at": 1612172933,
13
"status": "filled",
14
"leverage_level": 25,
15
"source_exchange": "QUOINE",
16
"product_id": "27",
17
"margin_type": "cross",
18
"take_profit": 200.0,
19
"stop_loss": 100.0,
20
"trading_type": "margin",
21
"product_code": "CASH",
22
"funding_currency": "USD",
23
"crypto_account_id": null,
24
"currency_pair_code": "ETHUSD",
25
"average_price": 0.0,
26
"target": "open",
27
"order_fee": 0.0,
28
"source_action": "netout_open",
29
"unwound_trade_id": null,
30
"trade_id": "97441404",
31
"client_order_id": null
32
}
33
34
// Error when trading BTCJPY but account does not have enough JPY balance.
35
// If account has enough USD balance, provide "funding_currency": "USD"
36
// to use USD to trade and avoid this error //
37
HTTP 422
38
{
39
"errors": {
40
"user": [
41
"not_enough_free_balance"
42
]
43
}
44
}
45
46
// Error when trading BTCJPY and provided "margin_type": "isolated" and
47
// "funding_currency": "USD" (if have enough USD balance), avoid this by
48
// changing to "margin_type": "cross" or simply just removing "margin_type"
49
HTTP 422
50
{
51
"errors": {
52
"order": [
53
"isolated_feature_is_disabled_for_multi_currency"
54
]
55
}
56
}
57
58
// Error when not proving valid leverage levels //
59
HTTP 422
60
{
61
"errors": {
62
"leverage_level": [
63
"not_valid"
64
]
65
}
66
}
67
68
// Error when trying to place a short order but current long position exist
69
// and long position was an order with "order_direction": "one_direction", avoid
70
// this by using "order_direction": "two_direction" or "order_direction": "netout"
71
HTTP 422
72
{
73
"errors": {
74
"user": [
75
"have_another_direction_trade"
76
]
77
}
78
}
Copied!

Stop Order

Request
Response
1
POST /orders/
2
3
{
4
"order_type": "stop",
5
"product_id": "27",
6
"side": "buy",
7
"price": "120",
8
"quantity": "0.333",
9
"leverage_level": "25",
10
"trading_type": "margin",
11
"margin_type": "cross",
12
"funding_currency": "USD",
13
"order_direction": "netout",
14
"take_profit": "150",
15
"stop_loss": "100"
16
}
Copied!
1
HTTP 200
2
{
3
"id": "2279447577",
4
"order_type": "stop",
5
"quantity": 0.333,
6
"disc_quantity": 0.0,
7
"iceberg_total_quantity": 0.0,
8
"side": "buy",
9
"filled_quantity": 0.0,
10
"price": 120.0,
11
"created_at": 1612176682,
12
"updated_at": 1612176682,
13
"status": "live",
14
"leverage_level": 25,
15
"source_exchange": "QUOINE",
16
"product_id": "27",
17
"margin_type": "cross",
18
"take_profit": 150.0,
19
"stop_loss": 100.0,
20
"trading_type": "margin",
21
"product_code": "CASH",
22
"funding_currency": "USD",
23
"crypto_account_id": null,
24
"currency_pair_code": "ETHUSD",
25
"average_price": 0.0,
26
"target": "open",
27
"order_fee": 0.0,
28
"source_action": "netout_open",
29
"unwound_trade_id": null,
30
"trade_id": null,
31
"client_order_id": null
32
}
33
34
// Error when "side: "buy" and "price: "90" and "stop_loss": "100",
35
// avoid this by providing a stop_loss that is lower than 90.
36
HTTP 422
37
{
38
"errors": {
39
"order": [
40
"new_stop_loss_price_greater_than_price"
41
]
42
}
43
}
44
45
// Error when "side: "buy" and "price: "150" and "take_profit": "100",
46
// avoid this by providing a take_profit that is higher than 150.
47
HTTP 422
48
{
49
"errors": {
50
"order": [
51
"new_take_profit_price_less_than_price"
52
]
53
}
54
}
55
56
// Error when trading BTCJPY but account does not have enough JPY balance.
57
// If account has enough USD balance, provide "funding_currency": "USD"
58
/// to use USD to trade and avoid this error
59
HTTP 422
60
{
61
"errors": {
62
"user": [
63
"not_enough_free_balance"
64
]
65
}
66
}
67
68
// Error when trading BTCJPY and provided "margin_type": "isolated" and
69
// "funding_currency": "USD" (if have enough USD balance), avoid this by
70
// changing to "margin_type": "cross" or simply just removing "margin_type"
71
HTTP 422
72
{
73
"errors": {
74
"order": [
75
"isolated_feature_is_disabled_for_multi_currency"
76
]
77
}
78
}
79
80
// Error when not proving valid leverage levels //
81
HTTP 422
82
{
83
"errors": {
84
"leverage_level": [
85
"not_valid"
86
]
87
}
88
}
89
90
// Error when trying to place a short order but current long position exist
91
// and long position was an order with "order_direction": "one_direction", avoid
92
// this by using "order_direction": "two_direction" or "order_direction": "netout"
93
HTTP 422
94
{
95
"errors": {
96
"user": [
97
"have_another_direction_trade"
98
]
99
}
100
}
Copied!

Trailing-Stop Order

Request
Response
1
POST /orders/
2
3
// With 10% higher than market price //
4
{
5
"order_type": "trailing_stop",
6
"product_id": "27",
7
"side": "buy",
8
"quantity": "0.666",
9
"leverage_level": "2",
10
"trading_type": "margin",
11
"trailing_stop_type": "percentage",
12
"trailing_stop_value": "0.10"
13
}
14
15
// With absolute value of 100 higher than market price //
16
{
17
"order_type": "trailing_stop",
18
"product_id": "27",
19
"side": "buy",
20
"quantity": "0.666",
21
"leverage_level": "2",
22
"trading_type": "margin",
23
"trailing_stop_type": "price",
24
"trailing_stop_value": "100"
25
}
Copied!
1
// With 10% higher than market price
2
HTTP 200
3
{
4
"id": "2279447585",
5
"order_type": "trailing_stop",
6
"quantity": 0.666,
7
"disc_quantity": 0.0,
8
"iceberg_total_quantity": 0.0,
9
"side": "buy",
10
"filled_quantity": 0.0,
11
"price": 131.3312,
12
"created_at": 1612178876,
13
"updated_at": 1612178876,
14
"status": "live",
15
"leverage_level": 2,
16
"source_exchange": "QUOINE",
17
"product_id": "27",
18
"margin_type": "cross",
19
"take_profit": 0.0,
20
"stop_loss": 0.0,
21
"trading_type": "margin",
22
"product_code": "CASH",
23
"funding_currency": "USD",
24
"crypto_account_id": null,
25
"currency_pair_code": "ETHUSD",
26
"average_price": 0.0,
27
"target": "open",
28
"order_fee": 0.0,
29
"source_action": "manual",
30
"unwound_trade_id": null,
31
"trade_id": null,
32
"client_order_id": null
33
}
34
35
// With absolute value of 100 higher than market price
36
HTTP 200
37
{
38
"id": "2279447584",
39
"order_type": "trailing_stop",
40
"quantity": 0.666,
41
"disc_quantity": 0.0,
42
"iceberg_total_quantity": 0.0,
43
"side": "buy",
44
"filled_quantity": 0.0,
45
"price": 231.2,
46
"created_at": 1612178843,
47
"updated_at": 1612178843,
48
"status": "live",
49
"leverage_level": 2,
50
"source_exchange": "QUOINE",
51
"product_id": "27",
52
"margin_type": "cross",
53
"take_profit": 0.0,
54
"stop_loss": 0.0,
55
"trading_type": "margin",
56
"product_code": "CASH",
57
"funding_currency": "USD",
58
"crypto_account_id": null,
59
"currency_pair_code": "ETHUSD",
60
"average_price": 0.0,
61
"target": "open",
62
"order_fee": 0.0,
63
"source_action": "manual",
64
"unwound_trade_id": null,
65
"trade_id": null,
66
"client_order_id": null
67
}
68
69
// Error when trading BTCJPY but account does not have enough JPY balance.
70
// If account has enough USD balance, provide "funding_currency": "USD"
71
// to use USD to trade and avoid this error
72
HTTP 422
73
{
74
"errors": {
75
"user": [
76
"not_enough_free_balance"
77
]
78
}
79
}
80
81
// Error when trading BTCJPY and provided "margin_type": "isolated" and
82
// "funding_currency": "USD" (if have enough USD balance), avoid this by
83
// changing to "margin_type": "cross" or simply just removing "margin_type"
84
HTTP 422
85
{
86
"errors": {
87
"order": [
88
"isolated_feature_is_disabled_for_multi_currency"
89
]
90
}
91
}
92
93
// Error when not proving valid leverage levels
94
HTTP 422
95
{
96
"errors": {
97
"leverage_level": [
98
"not_valid"
99
]
100
}
101
}
102
103
// Error when trying to place a short order but current long position exist
104
// and long position was an order with "order_direction": "one_direction", avoid
105
// this by using "order_direction": "two_direction" or "order_direction": "netout"
106
HTTP 422
107
{
108
"errors": {
109
"user": [
110
"have_another_direction_trade"
111
]
112
}
113
}
Copied!

CFD/Infinity Orders Additional Body Parameters

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_profitmust 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_profitmust 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.

Limit Order

Request
Response
1
POST /orders/
2
3
// With Client Order ID //
4
{
5
"order_type": "limit",
6
"product_id": "27",
7
"side": "buy",
8
"price": "120",
9
"quantity": "0.333",
10
"leverage_level": "25",
11
"trading_type": "cfd",
12
"margin_type": "isolated",
13
"funding_currency": "USD",
14
"order_direction": "netout",
15
"take_profit": "150",
16
"stop_loss": "100",
17
"client_order_id": "7b41d04a-1551-455a-939c-81c41c365ad9"
18
}
19
20
// Ensures order is a maker//
21
{
22
"order_type": "limit_post_only",
23
"product_id": "27",
24
"side": "buy",
25
"quantity"