Skip to content

STP download

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 done trades

Request

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.

Security
SSO_TOKEN
Query
maxCountinteger

Max number of trades to download. If not specified, the default max number of trades is used (currently 50).

Default:50
Example:maxCount=20
GET
/v2/trades/stp/messages
JavaScript
const query = new URLSearchParams({maxCount: '20'}).toString();

const resp = await fetch(
  `https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/trades/stp/messages?${query}`,
  {
    method: 'GET',
    headers: {
      SSO_TOKEN: 'YOUR_API_KEY_HERE'
    }
  }
);

const data = await resp.text();
console.log(data);

Responses

A list of executed trades. An empty response indicates no executed trades available.

Bodyapplication/json
Array [
orderIdstring, <= 60 charactersrequired

Order ID. For cover trades, this is the cover order ID.

tradeIdstring, <= 255 charactersrequired

Integral trade ID.

coIdstring, <= 255 charactersrequired

Customer-supplied order ID.

eventstring, <= 50 charactersrequired

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 changes
tradeTypestring, <= 20 charactersrequired

Trade type:

  • Spot
  • Outright
  • NDF
  • Swap
  • FwdFwd
  • NDFSwap
tradeDatestring, <= 20 charactersrequired

Date the trade was initiated in the format YYYY-MM-DD.

valueDatestring, <= 20 charactersrequired

Value date in the format YYYY-MM-DD.

fixingDatestring, <= 20 characters

(NDF trades) Fixing date in the format YYYY-MM-DD.

fixingTenorstring, <= 20 characters

(NDF trades) Fixing tenor.

makerbooleanrequired
  • true: 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).
sidestring, <= 10 charactersrequired

Side of the order from the customer's perspective, either Buy or Sell.

statusstring, <= 20 charactersrequired

Status of the trade when the message was created. STP returns Verified and Canceled trades.

symbolstring, <= 35 charactersrequired

Dealt instrument pair (currency, metal, energy, index, crypto), for example AUD/USD.

currencystring, <= 10 charactersrequired

Dealt currency, for example AUD.

rateIdstring, <= 255 characters

May be omitted. ID of the originating rate for previously quoted (PQ) orders.

customerAccountstring, <= 30 characters

Settlement code when available.

customerOrgstring, <= 30 charactersrequired

Customer org ID.

userstring, <= 100 charactersrequired

Full name of the user who entered the trade.

counterpartystring, <= 30 charactersrequired

Counterparty ID.

counterpartyLongNamestring, <= 255 characters

Counterparty name.

counterpartyTradeIdstring or null, <= 255 characters

Trade ID assigned by counterparty.

counterpartyAccountstring, <= 30 characters

Counterparty settlement code when available.

channelstring, <= 100 characters

Workflow, app, and UI component that originated the request.

channelCategorystring, <= 50 characters

Category of trade origin or intent. Applicable when received by a taker.

  • GUI
  • API
  • COVER
  • HEDGE_RISK
tenorstring, <= 50 characters

May be omitted. Trade tenor.

  • Today: today
  • TOD: today
  • ON: overnight (today)
  • TN: tomorrow
  • SP: spot
  • SPOT: spot
  • SN: spot next (spot+1)
  • nD: a number of days after the current business date (for example, 1D, 2D, 10D)
  • nW: a number of weeks after the current business date (for example, 1W, 2W, 3W)
  • nM: a number of months after the current business date (for example, 1M, 2M, 3M)
  • nY: a number of years after the current business date (for example, 1Y, 2Y, 3Y)
  • nIMM: 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.
  • SnIMM: (spot + IMM) for swaps
  • TnIMM: (tomorrow + IMM) for swaps
farTenorstring, <= 50 characters

May be omitted. Far-leg tenor for swaps.

  • Today: today
  • TOD: today
  • ON: overnight (today)
  • TN: tomorrow
  • SP: spot
  • SPOT: spot
  • SN: spot next (spot+1)
  • nD: a number of days after the current business date (for example, 1D, 2D, 10D)
  • nW: a number of weeks after the current business date (for example, 1W, 2W, 3W)
  • nM: a number of months after the current business date (for example, 1M, 2M, 3M)
  • nY: a number of years after the current business date (for example, 1Y, 2Y, 3Y)
  • nIMM: 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.
  • SnIMM: (spot + IMM) for swaps
  • TnIMM: (tomorrow + IMM) for swaps
farFixingTenorstring, <= 50 characters

May be omitted. Far-leg fixing tenor for NDF swaps. Required if farFixingDate not specified.

  • Today: today
  • TOD: today
  • ON: overnight (today)
  • TN: tomorrow
  • SP: spot
  • SPOT: spot
  • SN: spot next (spot+1)
  • nD: a number of days after the current business date (for example, 1D, 2D, 10D)
  • nW: a number of weeks after the current business date (for example, 1W, 2W, 3W)
  • nM: a number of months after the current business date (for example, 1M, 2M, 3M)
  • nY: a number of years after the current business date (for example, 1Y, 2Y, 3Y)
  • nIMM: 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.
  • SnIMM: (spot + IMM) for swaps
  • TnIMM: (tomorrow + IMM) for swaps
farFixingDatestring, <= 20 characters

May be omitted. Far-leg fixing date for NDF swaps in the format YYYY-MM-DD. Required if farFixingTenor not specified.

farValueDatestring, <= 20 characters

May be omitted. Far-leg value date for swaps in the format YYYY-MM-DD.

farSidestring, <= 10 characters

May be omitted. Side of the far leg for swaps.

customerLEIstring, <= 100 characters

May be omitted. Customer LEI code.

counterpartyLEIstring, <= 100 characters

May be omitted. Counterparty LEI code.

upistring, <= 50 characters

May be omitted. Unique Product Identifier for SEF trades.

utistring, <= 150 characters

May be omitted. Unique Transaction Identifier for SEF trades.

usistring, <= 150 characters

May be omitted. Unique Swap Identifier for near leg of SEF swaps.

farUSIstring, <= 150 characters

May be omitted. Unique Swap Identifier for far leg of SEF swaps.

exchangestring, <= 30 characters

May be omitted. Exchange ID.

portfolioIdstring, <= 100 characters

May be omitted. For batch trades and SSPs, the containing portfolio ID.

parentUSIstring, <= 150 characters

May be omitted. Unique Swap Identifier for SEF swaps.

isNetboolean

Whether or not the trade was done to net another trade.

midMarketboolean

Whether or not the trade was done at the mid-market rate.

regulatoryobject

May be omitted. An object containing regulatory information.

benchmarkRatenumber, (double)

Reference benchmark rate.

farLegISINstring, <= 12 characters

May be omitted. Far-leg International Securities Identification Number for multi-leg trades.

nearLegISINstring, <= 12 characters

May be omitted. Near-leg International Securities Identification Number for multi-leg trades.

isinLinkIdstring, <= 12 characters

May be omitted. International Securities Identification Number link ID.

notesstring, <= 255 characters

May be omitted. Any notes on the order entered by the order submitting user.

executionTimestring, <= 32 charactersrequired

Date and time trade was done in the format yyyy-MM-dd HH:mm:ss,SSS Z.

dealtAmountnumber, (double)required

Amount of the dealt currency.

settledAmountnumber, (double)

Amount of the settlement currency.

baseAmountnumber, (double)required

Amount of base currency.

termAmountnumber, (double)required

Amount of term currency.

spotRatenumber, (double)required

Spot rate of the trade or near leg of the trade.

ratenumber, (double)required

All-in rate.

forwardPointsnumber, (double)

May be omitted. Forward points for outright trades and near leg of swaps.

swapPointsnumber, (double)

May be omitted. Swap points, if any.

farRatenumber, (double)

May be omitted. Far-leg rate for swaps.

farDealtAmountnumber, (double)

May be omitted. Far-leg amount in the dealt instrument for swaps.

farSettledAmountnumber, (double)

May be omitted. Far-leg amount in the settlement instrument for swaps.

farBaseAmountnumber, (double)

May be omitted. Far-leg amount in the base instrument for swap.

farTermAmountnumber, (double)

May be omitted. Far-leg amount in the term instrument for swaps.

farForwardPointsnumber, (double)

May be omitted. Far-leg forward points for swaps.

mifidBenchmarkRatenumber, (double)

May be omitted. Reference benchmark rate per MiFID II.

feesnumber, (double)

May be omitted. Fees on the trade, if any.

initialSettledAmountnumber, (double)

May be omitted. Initial settled amount before any amendment.

streamstring, <= 30 characters

May be omitted. ID of the stream that priced the trade.

midRatenumber, (double)

May be omitted. Spot or near-leg mid rate for swaps.

farMidRatenumber, (double)

May be omitted. Far-leg mid rate for swaps.

coverRatenumber, (double)

May be omitted. Rate of the trade that covered this trade.

coverSpotRatenumber, (double)

May be omitted. Spot rate of the trade that covered this trade.

coverForwardPointsnumber, (double)

May be omitted. Forward points of the trade that covered this trade.

coverFarRatenumber, (double)

May be omitted. Far-leg rate of the trade that covered this trade.

coverFarSpotRatenumber, (double)

May be omitted. Far-leg spot rate of the trade that covered this trade.

coverFarForwardPointsnumber, (double)

May be omitted. Far-leg forward points of the trade that covered this trade.

coverRiskManagementTypestring, <= 20 characters

Cover risk management type. Applicable when received by a maker.

  • COVER
  • NO_COVER
  • WAREHOUSE
spreadsobject

May be omitted. Spreads on the trade. Available to makers who have configured STP to include market rate and spreads.

bookNamestring, <= 30 characters

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.
  • empty = No-cover trades, unmanaged trades, desk trades.
coveredTradeIdstring, <= 255 characters

May be omitted. ID of the trade covered by this trade, if any.

coveredCounterpartystring, <= 30 characters

ID of the customer org that originated the trade with the broker.

isSyntheticboolean

May be omitted. Whether or not the symbol is a synthetic currency pair.

syntheticComponentstring, <= 10 characters

May be omitted. Component currency used to price the synthetic currency pair.

MT300Field72string, <= 210 characters

SWIFT MT 300 Foreign Exchange Confirmation, field 72 Sender to Receiver Information

customParametersobject, <= 3500 characters

Collection of parameters that are unique to your organization. The number of parameters, their keynames, and values are defined by you.

Contact your Integral Technical Account Manager to enable and configure custom parameters.

Your custom parameters are included in API responses and in STP trade download.

Custom parameters sent to Integral via API are stored in the database directly. No validation is performed.

The maximum size of the customParameter property is 3500 characters, including all keys, values, and JSON syntax characters.

]
Response
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" } ]