curl --request POST \
--url https://api.anchorage-staging.com/v2/trading/order \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"currency": "BTC",
"quantity": "100.00",
"symbol": "BTC-USD",
"timestamp": "2023-11-07T05:31:56Z",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"allocation": [
{
"quantity": "10000",
"subaccountId": "<string>",
"specLotId": "550e8400-e29b-41d4-a716-446655440000"
}
],
"limitPrice": "21005.5",
"subaccountId": "343b6c83-6d91-4f13-9982-2109abd2dbb0"
}
'import requests
url = "https://api.anchorage-staging.com/v2/trading/order"
payload = {
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"currency": "BTC",
"quantity": "100.00",
"symbol": "BTC-USD",
"timestamp": "2023-11-07T05:31:56Z",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"allocation": [
{
"quantity": "10000",
"subaccountId": "<string>",
"specLotId": "550e8400-e29b-41d4-a716-446655440000"
}
],
"limitPrice": "21005.5",
"subaccountId": "343b6c83-6d91-4f13-9982-2109abd2dbb0"
}
headers = {
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clOrderId: '6fb5fc79-0bb4-446d-82dd-d4687fb56a02',
currency: 'BTC',
quantity: '100.00',
symbol: 'BTC-USD',
timestamp: '2023-11-07T05:31:56Z',
accountId: '0e2b2f9d-8d10-4f1e-960b-28567255045f',
allocation: [
{
quantity: '10000',
subaccountId: '<string>',
specLotId: '550e8400-e29b-41d4-a716-446655440000'
}
],
limitPrice: '21005.5',
subaccountId: '343b6c83-6d91-4f13-9982-2109abd2dbb0'
})
};
fetch('https://api.anchorage-staging.com/v2/trading/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"orderId": "a94c8d75-6c9d-4903-95f3-5b0893e76cb7",
"execId": "3fb532c79-0bb4-446d-82dd-d4687fb56a02",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"symbol": "BTC-USD",
"side": "BUY",
"currency": "USD",
"counterCurrency": "BTC",
"orderType": "MARKET",
"orderStatus": "FILLED",
"avgPx": "21005.4",
"avgPxAllIn": "21006.00",
"orderQty": "10000.00",
"cumQty": "10000.00",
"counterQty": "0.4760680586896702",
"fee": "0.00001359805",
"feeCurrency": "BTC",
"counterQtyAllIn": "0.4760544606302961",
"transactTime": "2022-11-20T20:32:16.423Z"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Permissions required: Execute trades
Place an order, either Market or Limit, currently only FillOrKill is supported.
One of accountId or subaccountId must be specified but not both.
curl --request POST \
--url https://api.anchorage-staging.com/v2/trading/order \
--header 'Api-Access-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"currency": "BTC",
"quantity": "100.00",
"symbol": "BTC-USD",
"timestamp": "2023-11-07T05:31:56Z",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"allocation": [
{
"quantity": "10000",
"subaccountId": "<string>",
"specLotId": "550e8400-e29b-41d4-a716-446655440000"
}
],
"limitPrice": "21005.5",
"subaccountId": "343b6c83-6d91-4f13-9982-2109abd2dbb0"
}
'import requests
url = "https://api.anchorage-staging.com/v2/trading/order"
payload = {
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"currency": "BTC",
"quantity": "100.00",
"symbol": "BTC-USD",
"timestamp": "2023-11-07T05:31:56Z",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"allocation": [
{
"quantity": "10000",
"subaccountId": "<string>",
"specLotId": "550e8400-e29b-41d4-a716-446655440000"
}
],
"limitPrice": "21005.5",
"subaccountId": "343b6c83-6d91-4f13-9982-2109abd2dbb0"
}
headers = {
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Api-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clOrderId: '6fb5fc79-0bb4-446d-82dd-d4687fb56a02',
currency: 'BTC',
quantity: '100.00',
symbol: 'BTC-USD',
timestamp: '2023-11-07T05:31:56Z',
accountId: '0e2b2f9d-8d10-4f1e-960b-28567255045f',
allocation: [
{
quantity: '10000',
subaccountId: '<string>',
specLotId: '550e8400-e29b-41d4-a716-446655440000'
}
],
limitPrice: '21005.5',
subaccountId: '343b6c83-6d91-4f13-9982-2109abd2dbb0'
})
};
fetch('https://api.anchorage-staging.com/v2/trading/order', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"clOrderId": "6fb5fc79-0bb4-446d-82dd-d4687fb56a02",
"orderId": "a94c8d75-6c9d-4903-95f3-5b0893e76cb7",
"execId": "3fb532c79-0bb4-446d-82dd-d4687fb56a02",
"accountId": "0e2b2f9d-8d10-4f1e-960b-28567255045f",
"symbol": "BTC-USD",
"side": "BUY",
"currency": "USD",
"counterCurrency": "BTC",
"orderType": "MARKET",
"orderStatus": "FILLED",
"avgPx": "21005.4",
"avgPxAllIn": "21006.00",
"orderQty": "10000.00",
"cumQty": "10000.00",
"counterQty": "0.4760680586896702",
"fee": "0.00001359805",
"feeCurrency": "BTC",
"counterQtyAllIn": "0.4760544606302961",
"transactTime": "2022-11-20T20:32:16.423Z"
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Body
Parameters to place an order.
Unique client order ID.
"6fb5fc79-0bb4-446d-82dd-d4687fb56a02"
The currency in which order quantity is specified in.
"BTC"
Order type either MARKET or LIMIT
MARKET, LIMIT, RFQ, LIMIT_ALL_IN Order quantity in units of currency.
"100.00"
Order side, either "BUY" or "SELL".
BUY, SELL Symbol for the order, e.g. BTC-USD.
"BTC-USD"
Account ID for this order to book into.
"0e2b2f9d-8d10-4f1e-960b-28567255045f"
Order subaccount allocation
Show child attributes
Show child attributes
Limit price for the order, required for limit order
"21005.5"
Subaccount ID for this order to book into.
"343b6c83-6d91-4f13-9982-2109abd2dbb0"
Response
Successfully executed an order
Show child attributes
Show child attributes
Was this page helpful?