Create Order
POST
https://api.sfox.com/v1/orders/:side
Create an order
Create order requests are rate limited to 60 requests per second per account.
Path Parameters
Body Parameters
Responses
201 Accepted & Created
{
"id": 2010135,
"side_id": 500,
"action": "Buy",
"algorithm_id": 201,
"algorithm": "Limit",
"type": "Limit",
"pair": "btcusd",
"quantity": 0.1,
"price": 36431,
"amount": 0,
"net_market_amount": 0,
"filled": 0,
"vwap": 0,
"filled_amount": 0,
"fees": 0,
"net_proceeds": 0,
"status": "Started",
"status_code": 100,
"routing_option": "WeightedExchange",
"routing_type": "NetPrice",
"time_in_force": "GTC",
"expires": null,
"dateupdated": "2023-11-17T20:52:40.000Z",
"date_added": "2023-11-17T20:52:40.000Z",
"client_order_id": "ea5c8afc-419a-447d-8188-659dce1a782a",
"user_tx_id": "ea5c8afc-419a-447d-8188-659dce1a782a",
"o_action": "Buy",
"algo_id": 201,
"algorithm_options": null,
"destination": ""
}
422 Rejected
// currency_pair not specified
{
"error": "invalid currency_pair: undefined"
}
// currency_pair speficied but not supported or does not exist
{
"error": "invalid currency_pair: btcusda"
}
Example Requests
curl -X POST \
-H 'Content-type: application/json' \
-H 'Authorization: Bearer <API_TOKEN>' \
--data '{ "quantity": 1,
"currency_pair": "btcusd",
"algorithm_id": 200,
"price": 20000 }' \
'https://api.sfox.com/v1/orders/buy'
const axios = require('axios');
axios({
method: 'post',
url: 'https://api.sfox.com/v1/orders/buy',
headers: {
'Authorization': 'Bearer <API_KEY>'
},
data: {
quantity: 1,
currency_pair: 'btcusd',
algorithm_id: 200,
price: 20000
}
}).then(response => {
console.log(response)
}).catch(err => {
console.error(err)
});
import requests
data = requests.post(
"https://api.sfox.com/v1/orders/buy",
headers={
"Authorization": "Bearer <API_KEY>",
},
data={
"quantity": 1,
"currency_pair":"btcusd",
"algorithm_id": 200,
"price": 20000
}
)
print(data)
Last updated