Welcome to the Integral REST API reference.
Our REST API is for less latency-sensitive participants and has resource-oriented URLs, accepts JSON-encoded requests, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Contact Integral’s account management team to get connection details and credentials for access.
You can choose between two authentication methods:
An ID and password will be issued to you to generate and refresh/renew an access token. All REST API calls should pass this token to access authenticated services.
Users should use /v2/sso/login to get an access token. The access token is in SSO_TOKEN
of the response header. Your token is valid for a limited time.
To keep your session alive, you can renew your token with /sso/tokens/renew. If your token is expired, you are issued a new token.
In this authentication method, you must sign each API request with a 'secret'. The 'secret' and 'userId' are issued to you during set up.
All REST requests must contain following header information:
Header attribute | Description |
---|---|
Authorization | The base64-encoded signature. |
Date | A date and time as standard UTC string. |
Digest | SHA-256=base64(sha256(<body>)) If there is no request body, Digest should be set to the digest of a body of 0 length. |
type | Set to hmac . |
You must send an authorization header with the following parameterization:
credentials := "hmac" params
params := userId "," algorithm ", " headers ", " signature
userId := "username" "=" plain-string
algorithm := "algorithm" "=" DQUOTE (hmac-sha256) DQUOTE
headers := "headers" "=" plain-string
signature := "signature" "=" plain-string
plain-string = DQUOTE *( %x20-21 / %x23-5B / %x5D-7E ) DQUOTE
Parameter | Description |
---|---|
username | The ID of the credential. |
algorithm | Digital signature algorithm used to create the signature. You should use hmac-sha256 . |
headers | List of HTTP header names, separated by a single space character, used to sign the request. |
signature | Base64 encoded digital signature generated by the client. |
To generate the string that is signed with a secret, the client must take the values of each HTTP header specified by headers in the order they appear.
request-line
, then append the lowercase header name followed with an ASCII colon :
and an ASCII space ' '
.request-line
, then append the HTTP request line (in ASCII format), otherwise append the header value.\n
. The string must not include a trailing ASCII newline.You can set X-Request-ID
on the request's HTTP header to trace each API call. The system echos back this header in the response.
All Integral REST APIs use the following general status codes. See endpoints for specific codes.
HTTP code | HTTP status | Meaning |
---|---|---|
200 | OK | Successful submission. |
202 | ACCEPTED | Request accepted by the system. You are expected to make another API call. Refer to individual API sections and endpoints for subsequent action. |
400 | BAD REQUEST | There is an issue with request parameters. May have a message body that indicates the error. Refer to individual API sections and endpoints for specific errors. |
401 | UNAUTHORIZED | Your IntegralAPI user is not authorized. May have a message body that indicates the error. |
404 | NOT FOUND | The endpoint could not be found. Either your valid request did not return any results or your request was malformed. May have a message body that indicates the error. Refer to individual API endpoints to confirm that the endpoint URL and parameters are correct. |
500 | INTERNAL SERVER ERROR | Stop trading immediately and contact Integral Business Support with a complete error message and full details of the HTTP request and response. May have a message body that indicates the error. |
4xx and 5xx status codes may return a JSON response body with the message
parameter.
You determine the status of any call with a combination of:
200
and 404
).Use the following codes to interpret and act on status responses.
Reason code | Description |
---|---|
RequestValidationError.amount | Order size is invalid. |
RequestValidationError.CoIdNotSpecified | Client order ID not specified. |
RequestValidationError.DuplicateOrder | Order already exists for the given client order ID. |
RequestValidationError.TypeNotSpecified | Order type not specified. |
RequestValidationError.TIFNotSpecified | Time in force not specified. |
RequestValidationError.SideNotSpecified | Order side (buy or sell) not specified. |
RequestValidationError.CurrencyNotSpecified | Order dealt currency not specified. |
RequestValidationError.InvalidDealtCcy | Dealt currency is neither base currency nor term currency. |
RequestValidationError.SymbolNotSpecified | Symbol not specified. |
RequestValidationError.InvalidCurrencyPair | Symbol not valid or not supported by the system. |
RequestValidationError.SizeNotSpecified | Order size not specified. |
RequestValidationError.InvalidOrderQty | Order size not valid. |
RequestValidationError.InvalidPrice | Accepted price invalid. Zero is invalid price. |
RequestValidationError.BuySellMismatch | Buy/Sell side of the accepted price is incorrect. |
RequestValidationError.InvalidQuoteID | The rateId of the previously quoted (PQ) order is invalid. |
RequestValidationError.LegalEntitySetIncorrectly | Account field incorrect. |
RequestValidationError.OrderTypeNotSupported | Order type not supported. |
RequestValidationError.PriceMismatch | Accepted price not the same as previously quoted price. |
RequestValidationError.QuoteExpired | Rate associated with the rateId not found. It has expired. Price is no longer valid. |
RequestValidationError.tradingDisabled | Trading is disabled. |
https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/
The RFS/RFQ endpoints provide API access to two trading workflows:
You receive responses against your RFS and RFQ requests using the Query request response API and can choose to either accept the quote, withdraw your quote request, or you can allow the your request or quote to expire.
Request for Stream (RFS) workflow:
Request for Quote (RFQ) workflow:
Get executed trades that have not been downloaded before.
To get trades that have been previously downloaded, you must first call the Prepare trades to resend endpoint.
Get executed trades that have not been downloaded before. The default maximum number of trades returned is determined by the server. You should poll this endpoint until you receive an empty response indicating that there are no remaining executed trades available for STP download.
To get trades that have been previously downloaded, you must first call the Prepare trades to resend endpoint.
https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/trades/stp/messages
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/trades/stp/messages
No request payload
A list of executed trades. An empty response indicates no executed trades available.
Status of the trade so you can decide how to treat the download.
NEW
: Trade downloaded for the first time.RESEND
: A previously downloaded trade that is sent again with no changestrue
: Maker (the deal was initiated by submitting a request or from working the balance on an outstanding order).false
: Taker (the deal was initiated by taking a dealable price in the app).Side of the order from the customer's perspective, either Buy
or Sell
.
Status of the trade when the message was created. STP returns only Verified
trades.
Dealt instrument pair (currency, metal, energy, index, crypto), for example AUD/USD
.
May be omitted. ID of the originating rate for previously quoted (PQ) orders.
Category of trade origin or intent. Applicable when received by a taker.
GUI
API
COVER
HEDGE_RISK
May be omitted. Trade tenor.
Today
: todayTOD
: todayON
: overnight (today)TN
: tomorrowSP
: spotSPOT
: spotSN
: spot next (spot+1)D
: a number of days after the current business date (for example, 1D, 2D, 10D)W
: a number of weeks after the current business date (for example, 1W, 2W, 3W)M
: a number of months after the current business date (for example, 1M, 2M, 3M)Y
: a number of years after the current business date (for example, 1Y, 2Y, 3Y)IMM
: The next International Monetary Market (IMM) settlement date. IMM dates are the third Wednesday of the last month of every quarter (March, June, September, December). IMM
results in the next IMM date on or after the spot date. 2IMM
results in two IMM dates after the spot date.S
nIMM
: (spot + IMM) for swapsT
nIMM
: (tomorrow + IMM) for swapsMay be omitted. Far-leg tenor for swaps.
Today
: todayTOD
: todayON
: overnight (today)TN
: tomorrowSP
: spotSPOT
: spotSN
: spot next (spot+1)D
: a number of days after the current business date (for example, 1D, 2D, 10D)W
: a number of weeks after the current business date (for example, 1W, 2W, 3W)M
: a number of months after the current business date (for example, 1M, 2M, 3M)Y
: a number of years after the current business date (for example, 1Y, 2Y, 3Y)IMM
: The next International Monetary Market (IMM) settlement date. IMM dates are the third Wednesday of the last month of every quarter (March, June, September, December). IMM
results in the next IMM date on or after the spot date. 2IMM
results in two IMM dates after the spot date.S
nIMM
: (spot + IMM) for swapsT
nIMM
: (tomorrow + IMM) for swapsMay be omitted. Far-leg fixing tenor for NDF swaps. Required if farFixingDate
not specified.
Today
: todayTOD
: todayON
: overnight (today)TN
: tomorrowSP
: spotSPOT
: spotSN
: spot next (spot+1)D
: a number of days after the current business date (for example, 1D, 2D, 10D)W
: a number of weeks after the current business date (for example, 1W, 2W, 3W)M
: a number of months after the current business date (for example, 1M, 2M, 3M)Y
: a number of years after the current business date (for example, 1Y, 2Y, 3Y)IMM
: The next International Monetary Market (IMM) settlement date. IMM dates are the third Wednesday of the last month of every quarter (March, June, September, December). IMM
results in the next IMM date on or after the spot date. 2IMM
results in two IMM dates after the spot date.S
nIMM
: (spot + IMM) for swapsT
nIMM
: (tomorrow + IMM) for swapsMay be omitted. Far-leg fixing date for NDF swaps in the format YYYY-MM-DD
. Required if farFixingTenor
not specified.
May be omitted. Far-leg value date for swaps in the format YYYY-MM-DD
.
May be omitted. For batch trades and SSPs, the containing portfolio ID.
May be omitted. Far-leg International Securities Identification Number for multi-leg trades.
May be omitted. Near-leg International Securities Identification Number for multi-leg trades.
May be omitted. International Securities Identification Number link ID.
May be omitted. Any notes on the order entered by the order submitting user.
Date and time trade was done in the format yyyy-MM-dd HH:mm:ss,SSS Z
.
May be omitted. Forward points for outright trades and near leg of swaps.
May be omitted. Far-leg amount in the settlement instrument for swaps.
May be omitted. Forward points of the trade that covered this trade.
May be omitted. Far-leg spot rate of the trade that covered this trade.
May be omitted. Far-leg forward points of the trade that covered this trade.
Cover risk management type. Applicable when received by a maker.
COVER
NO_COVER
WAREHOUSE
May be omitted. Spreads on the trade. Available to makers who have configured STP to include market rate and spreads.
May be omitted. Only applicable to FX Yield Manager. If FX Yield Manager is used to manage positions, this is the name of the book, if any, to which the trade is entered.
A
= Cover trades, both customer trades and its cover trades.B
= Warehoused customer trades, FX Yield Manager hedging trades.ID of the customer org that originated the trade with the broker.
May be omitted. Component currency used to price the synthetic currency pair.
SWIFT MT 300 Foreign Exchange Confirmation, field 72 Sender to Receiver Information
STP download of trade to fill limit order request
[ { "orderId": "4820276016", "tradeId": "FXI9369258100", "tradeType": "Spot", "tradeDate": "2023-06-02", "valueDate": "2023-06-15", "maker": false, "side": "Buy", "status": "Verified", "symbol": "EUR/USD", "currency": "EUR", "customerAccount": "CustomerOrgle1", "customerOrg": "CustomerOrg", "user": "userName@CustomerOrg", "counterparty": "BrokerOrg1", "counterpartyLongName": "The Broker Org", "counterpartyAccount": "BrokerOrg1LE5", "coId": "8932452311944", "channel": "API/REST/ESP", "executionTime": "2023-06-02 18:31:01,301 +0000", "dealtAmount": 1000000, "settledAmount": 1097166.9, "baseAmount": 1000000, "termAmount": 1097166.9, "spotRate": 1.0971669, "rate": 1.0971669, "event": "NEW", "channelCategory": "API", "upi": "EUR_USD_SPOT", "uti": "1234567890AQUSUUINP9349138130" } ]
Set previously downloaded trades with tradeDate
within the specified date range as eligible for download. You must then call the Get trades endpoint to download the trades. The event
attribute on previously downloaded trades is always set to RESEND
.
Beginning tradeDate
of trades to reset for STP eligibility, inclusive, in the format yyyy-MM-dd HH:mm:ss,SSS Z
.
https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/trades/stp/resend
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/trades/stp/resend
{ "startDate": "2022-04-21 13:00:00,000 +0000", "endDate": "2022-04-22 13:00:00,000 +0000" }
Successful request. You must call the Get trades endpoint to download the trades.