Saxo OpenAPI POST /trade/v2/orders/precheck
Checks an order without placing it and returns the expected costs, cash required and margin impact. Useful to show a cost preview before the user confirms.
Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.
Does not place an order. Saxo's page advises checking ErrorInfo on a 200 reply and also lists 503. ManualOrder does not appear in this call's parameter table. Saxo's parameter table for this call has no required or optional column; the required flags here are our reading of Saxo's descriptions and example request, not markers on Saxo's page. Method, path and parameter names were re-read on Saxo's reference page for this call on 12 Oct 2026 and agree with this record. That page does not mark which parameters are required, so the required flags here were not re-checked, and the mock reply was not compared field by field.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| AccountKeyrequired, not confirmed | body | string | Account to place the order on, from GET /port/v1/accounts/me. |
| Uicrequired, not confirmed | body | integer | Unique id of the instrument. |
| AssetTyperequired, not confirmed | body | string | The instrument's asset type. |
| BuySellrequired, not confirmed | body | string | Buy or Sell. |
| Amountrequired, not confirmed | body | number | Order size. |
| OrderTyperequired, not confirmed | body | string | Placeable order type, for example Market, Limit or Stop. |
| OrderPrice | body | number | Order price; optional for market orders. |
| OrderDurationrequired, not confirmed | body | object | Duration, for example DurationType DayOrder or GoodTillCancel. |
| ExternalReference | body | string | Your own reference, up to 50 characters. |
| Orders | body | array | Optional related take profit and stop orders, or an OCO order. |
| FieldGroups | body | array | Extra results to return, for example Costs and MarginImpactBuySell. |
The required marks on this page are this site's reading of secondary material, as the note above says. Which fields the API insists on is not confirmed on the provider's own reference.
Authentication headers
| Name | Type | Description |
|---|---|---|
| Authorizationrequired, not confirmed | string | OAuth 2.0 bearer access token. In SIM you can use a 24 hour token from the Saxo developer portal. Placeholder only: never paste a real token into this site. |
Request
Written from the method, path and parameters recorded on this page, against the demo host. Not executed against a live or demo account. Credentials are read from environment variables on your own machine and are never entered on this site. The request builder writes these same snippets, from the same record.
This call takes a request body. The samples send it as JSON with a Content-Type of application/json (in Python, passing json= sets that header) and a placeholder for each of the 7 body fields the record marks as required, a mark that is not confirmed. Each placeholder has to be replaced with a real value before the request can succeed.
Python
# Set SAXO_SIM_TOKEN as an environment variable first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: body fields OrderPrice, ExternalReference, Orders, FieldGroups.
import os
import requests
BASE_URL = "https://gateway.saxobank.com/sim/openapi" # the demo host
headers = {
"Authorization": "Bearer " + os.environ["SAXO_SIM_TOKEN"],
}
body = {"AccountKey": "...", "Uic": 0, "AssetType": "...", "BuySell": "...", "Amount": 0, "OrderType": "...", "OrderDuration": {}}
resp = requests.post(BASE_URL + "/trade/v2/orders/precheck", headers=headers, json=body, timeout=10)
resp.raise_for_status()
print(resp.json())JavaScript
// Set SAXO_SIM_TOKEN as an environment variable first. Never paste real values into code.
// Replace each {placeholder}, "..." and 0 with a real value before running.
// Optional and not shown: body fields OrderPrice, ExternalReference, Orders, FieldGroups.
// Run as a module, for example a .mjs file, on a Node version that has fetch built in.
const BASE_URL = "https://gateway.saxobank.com/sim/openapi"; // the demo host
const res = await fetch(BASE_URL + "/trade/v2/orders/precheck", {
method: "POST",
headers: {
"Authorization": "Bearer " + process.env.SAXO_SIM_TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify({"AccountKey": "...", "Uic": 0, "AssetType": "...", "BuySell": "...", "Amount": 0, "OrderType": "...", "OrderDuration": {}}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
console.log(await res.json());curl
# Set SAXO_SIM_TOKEN as an environment variable first. Never paste real values into code.
# Replace each {placeholder}, "..." and 0 with a real value before running.
# Optional and not shown: body fields OrderPrice, ExternalReference, Orders, FieldGroups.
curl -X POST "https://gateway.saxobank.com/sim/openapi/trade/v2/orders/precheck" \
-H "Authorization: Bearer $SAXO_SIM_TOKEN" \
-H "Content-Type: application/json" \
-d '{"AccountKey": "...", "Uic": 0, "AssetType": "...", "BuySell": "...", "Amount": 0, "OrderType": "...", "OrderDuration": {}}'Response
A mock response. The values are invented, so check field names against the official reference.
{
"_mock": true,
"PreCheckResult": "Ok",
"EstimatedCashRequired": 10,
"EstimatedCashRequiredCurrency": "EUR",
"Cost": {
"Commission": 1,
"ExchangeFee": 0,
"StampDuty": 0
},
"EstimatedTotalCost": 1,
"EstimatedTotalCostInAccountCurrency": 1,
"InstrumentToAccountConversionRate": 1,
"MarginImpactBuySell": {
"Currency": "EUR",
"InitialMarginBuy": 0,
"MaintenanceMarginBuy": 0
}
}Response schema, HTTP 200
Every field this site's OpenAPI file for Saxo OpenAPI declares for this response.
| Field | Type | Description |
|---|---|---|
| PreCheckResult | string | Not recorded |
| EstimatedCashRequired | number | Not recorded |
| EstimatedCashRequiredCurrency | string | Not recorded |
| Cost | object | Not recorded |
| Commission | number | Not recorded |
| ExchangeFee | number | Not recorded |
| StampDuty | number | Not recorded |
| EstimatedTotalCost | number | Not recorded |
| EstimatedTotalCostInAccountCurrency | number | Not recorded |
| InstrumentToAccountConversionRate | integer | Not recorded |
| MarginImpactBuySell | object | Not recorded |
| Currency | string | Not recorded |
| InitialMarginBuy | number | Not recorded |
| MaintenanceMarginBuy | number | Not recorded |
developer.saxochecked
Limits that apply at Saxo OpenAPI
| Limit | Value | Scope | Source |
|---|---|---|---|
| Headline limit | 120/min per session, per service group | session | developer.saxochecked |
Saxo API errors you may meet
- HTTP 409 (duplicate order)HTTP 409. An identical order was sent within a rolling 15 second window and was rejected.
- HTTP 426HTTP 426. Upgrade Required.
- HTTP 429HTTP 429. Rate limit exceeded: 120 requests per minute per session per service group, 1 order per second per session, or 10,000,000 per day per app.
- ActiveFollowerCannotDoManualTradeHTTP 400. Opening or closing a position is not allowed on an active strategy account.
- AlgoOrderTimeBeforeExchangeOpenHTTP 400. An algo order parameter carries a time before the exchange opens.
- AmountBelowMinimumLotSizeHTTP 400. The order size is below the exchange's minimum lot size.
All Saxo API error codes, including 137 more not listed here.