Data Formats
The OpenAPI will enforce input validation and rejects requests that are not providing data in correct formats with HTTP status code 400 - Bad Request.
Likewise, the API will deliver response data in a consistent manner according to the below data types.
JSON is currently the only supported content type. JSON objects are by nature fairly lenient, and in order to ensure consistency across the API most data types are only accepted in one or a few specific formats.
Simple Types
Type | Format | Accepted: | Rejected: | Example from OpenAPI |
---|---|---|---|---|
Integer |
| 123 4567 1000000 | "123" 4567.75 1,000,000 | "NetPositionsCount": 3 |
Decimal |
| 12.3015 4567.75 1000000.80 | "12.3015" 4567,75 1,000,000.80 | "DefaultSlippage": 0.01 |
String |
| "EURUSD" "TrailingStop" "NYSE_ARCA" | 'EURUSD' " " "123" | "Name": "NASDAQ OMX Copenhagen" |
Boolean |
| true false | True "false" | "MarketDataViaOpenApiTermsAccepted": false |
Enumerations |
| "FxSpot" "DayOrder" "dayorder" | "123" | "TradeLevel": "OrdersOnly" |
Derived Types
Type | Accepted Format(s) | Examples |
---|---|---|
AccountGroupKey | String | "X1JlUyeXTMK3mBxzd-D2UA==" |
AccountId | String | "9073876INET" |
AccountKey | String | "KMgyuRfY-yDoSzDmdK-HZQ==" |
Amount | Integer or Decimal | 2 2220745.77 |
AssetType | Enumeration | "FxSpot" |
ClientId | String | "9073876" |
ClientKey | String | "X1JlUyaXTMK3mBxzd-D2UA==" |
CountryCode | String - 2 upper case letters | "DK" |
Date | String - format: yyyy-MM-dd | "2018-11-01" |
ExchangeId | String | "NYSE_ARCA" |
LanguageCode | String - formatted as two lowercase letters and a two capital letters if applicable | "en" "en-US" |
OrderId | String | "84897763" |
Percentage | Decimal | 69.44 |
PositionId | String | "241551543" |
SectorId | Integer | 5 |
Symbol | String | "EURUSD" |
Uic | Integer | 21 |
UserId | String | "9073876" |
UserKey | String | "X1JlUyeXTMK3mBxzd-D2UA==" |
UtcDateTime | String - format: yyyy-MM-ddTHH:mm:ss.ffffffZ | "2019-10-08T08:41:23.770000Z" |