Skip to main content

Place an Order

API URL: POST https://gateway-api-demo.s2f.projectx.com/api/Order/place

API Reference: /api/order/place

Description


Place an order.

Parameters


NameTypeDescriptionRequiredNullable
accountIdintegerThe account ID.Requiredfalse
contractIdstringThe contract ID.Requiredfalse
typeintegerThe order type:
1 = Limit
2 = Market
4 = Stop
5 = TrailingStop
6 = JoinBid
7 = JoinAsk
Requiredfalse
sideintegerThe side of the order:
0 = Bid (buy)
1 = Ask (sell)
Requiredfalse
sizeintegerThe size of the order.Requiredfalse
limitPricedecimalThe limit price for the order, if applicable.Optionaltrue
stopPricedecimalThe stop price for the order, if applicable.Optionaltrue
trailPricedecimalThe trail price for the order, if applicable.Optionaltrue
customTagstringAn optional custom tag for the order.Optionaltrue
linkedOrderIdintegerThe linked order id.Optionaltrue

Example Usage


Example Request

curl -X 'POST' \
'https://gateway-api-demo.s2f.projectx.com/api/Order/place' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"accountId": 465,
"contractId": "CON.F.US.DA6.M25",
"type": 2,
"side": 1,
"size": 1,
"limitPrice": null,
"stopPrice": null,
"trailPrice": null,
"customTag": null,
"linkedOrderId": null
}'

Example Response

{
"orderId": 9056,
"success": true,
"errorCode": 0,
"errorMessage": null
}