The OpenAPI offers a /precheck
endpoint in the Trading service group that allows clients to simulate what would happen if an order was sent in to /trade/v2/orders
. This precheck endpoint triggers all the logic that would be applied if a "real" order was received, short of actually placing it.
To precheck an order, send a POST
request to the /trade/v2/orders/precheck
endpoint with the exact same body that would otherwise be sent to the /orders
endpoint, and include "FieldGroups": ["Costs"]
to add trade costs data to the response. For instance, to precheck an order to buy 10 shares of Apple Inc. at market on the default account of the client, send the below request:
POST /trade/v2/orders/precheck
{
"Uic": 211,
"AssetType": "Stock",
"BuySell": "Buy",
"Amount": 10,
"OrderType": "Market",
"FieldGroups": ["Costs"],
"ManualOrder": true
}
The response will contain, amongst other things, a "Cost"
field with trade costs details:
"Cost": { "Commission": 2.50, "ExchangeFee": 0, "StampDuty": 0 }
For orders that do not immediately get executed (like limit and stop orders), the costs data will be included, but only applies once the order triggers.
Note: trade costs returned by the /precheck
endpoint depend on client configuration. The above example is not representative.
More Resources