Skip to content

Query all trades on an order by ID

Request

Get all fills for the order ID assigned by Integral returned in the coId or orderId field when the order was placed.

Security
SSO_TOKEN
Query
coIdstring, <= 255 charactersrequired

The unique ID assigned by you when your order was placed. Returned in response in the coId field.

Example:coId=OrderXEL278vv1
orderIdstring, <= 255 charactersrequired

The unique ID assigned by Integral when your order was placed. Returned in response in the orderId field.

Example:orderId=4820275011
JavaScript
const query = new URLSearchParams({
  coId: 'OrderXEL278vv1',
  orderId: '4820275011'
}).toString();

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

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

Responses

An array of trade objects. If an empty array, no trades were done for the given server order ID.

Bodyapplication/json
Array [
orderIdstring, <= 60 characters

Order ID.

tradeIdstring, <= 255 characters

Integral trade ID.

tradeTypestring, <= 20 characters

Trade type:

  • Spot
  • Outright
  • Swap
  • FwdFwd
  • NDF
  • NDFSwap
tenorstring, <= 20 characters

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
tradeDatestring, <= 20 characters

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

valueDatestring, <= 20 characters

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.

executionTimestring, <= 32 characters

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

makerboolean
  • 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).
orderSidestring, <= 10 characters

Side of the order from your perspective, either Buy or Sell.

statusstring, <= 32 characters

Status of the trade when the message was created:

  • Pending
  • Verified
  • Rejected
rejectReasonstring, <= 128 characters

The reason for trade rejection, if any.

symbolstring, <= 35 characters

Dealt instrument pair (currency, metal, energy, index, crypto), seven-character ISO code (for example, AUD/USD).

dealtInsstring, <= 17 characters

Dealt instrument, three-character ISO code (for example, AUD).

dealtAmountnumber, (double)

Amount of the dealt instrument or near-leg instrument.

settledAmountnumber, (double)

Amount of the settlement instrument.

baseAmountnumber, (double)

Amount of base instrument.

termAmountnumber, (double)

Amount of term instrument.

spotRatenumber, (double)

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

ratenumber, (double)

All-in rate.

orderTypestring, <= 20 characters

Type of order.

rateIdstring, <= 255 characters

ID of the originating rate, if any.

forwardPointsnumber, (double)

Forward points for outright trades and near leg of swaps.

swapPointsnumber, (double)

Swap points, if any.

customerAccountstring, <= 30 characters

Customer legal entity ID.

customerOrgstring, <= 30 characters

Customer org ID.

traderstring, <= 30 characters

Customer trader user who did the trade.

counterPartystring, <= 30 characters

Counterparty ID.

cptyLongNamestring, <= 128 characters

Counterparty name.

coverTradeIdsArray of strings

List of ID for trades that cover this trade, if any.

cptyTradeIdstring or null, <= 255 characters

Trade ID assigned by counterparty.

counterPartyAccountstring, <= 30 characters

Counterparty legal entity ID.

channelstring, <= 100 characters

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

farTenorstring, <= 20 characters

Far-leg tenor for swaps.

farFixingTenorstring, <= 20 characters

Far-leg fixing tenor for NDF swaps.

farFixingDatestring, <= 20 characters

Far-leg fixing date for NDF swaps in the format YYYY-MM-DD.

farValueDatestring, <= 20 characters

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

farSidestring, <= 10 characters

Side of the far leg for swaps.

farRatenumber, (double)

Far-leg rate for swaps.

farDealtAmountnumber, (double)

Far-leg amount in the dealt instrument for swaps.

farSettledAmountnumber, (double)

Far-leg amount in the settlement instrument for swaps.

farBaseAmountnumber, (double)

Far-leg amount in the base instrument for swap.

farTermAmountnumber, (double)

Far-leg amount in the term instrument for swaps.

farForwardPointsnumber, (double)

Far-leg forward points for swaps.

counterpartyALEIstring, <= 100 characters

LEI code for counterpartyA.

counterpartyBLEIstring, <= 100 characters

LEI code for counterpartyB.

externalRequestIdstring, <= 255 characters

The ID of the originating request for price from a system external to Integral.

requestIdstring, <= 255 characters

The ID of the originating request for price from Integral systems.

portfolioIdstring, <= 100 characters

Containing portfolio ID for batch trades and SSPs.

benchmarkRatenumber, (double)

Reference benchmark rate.

outrightobject

Forward pricing info for the trade.

farLegISINstring, <= 12 characters

Far-leg International Securities Identification Number for multi-leg trades.

nearLegISINstring, <= 12 characters

Near-leg International Securities Identification Number for multi-leg trades.

regulatoryobject

An object containing regulatory information.

feesnumber, (double)

Fees on the trade, if any.

initialSettledAmountnumber, (double)

The initial settled amount before any amendment.

notesstring, <= 255 characters

Any notes on the order entered by the order submitting user.

midMarketboolean

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

utistring, <= 150 characters

The Unique Trade Identifier if the trade was done in a SEF.

upistring, <= 50 characters

The Unique Product Identifier if the trade was done in a SEF.

isinLinkIdstring, <= 12 characters

International Securities Identification Number link ID.

customParametersobject(customParameters)

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

Contact your Integral Customer Engineer 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 customParameters property is 3500 characters, including all keys, values, and JSON syntax characters.

]
Response

One object per fill, each a complete trade with its own tradeId, so a partially filled order returns several.

[ { "orderId": "4821376492", "tradeId": "FXI9222972502", "tradeType": "Spot", "tenor": "SPOT", "tradeDate": "2022-08-16", "valueDate": "2022-08-18", "executionTime": "2022-08-16 08:24:13,239 +0000", "maker": false, "orderSide": "Sell", "status": "Verified", "symbol": "EUR/USD", "dealtIns": "EUR", "customerAccount": "Cust12LE", "customerOrg": "Cust12", "trader": "MD", "counterParty": "SOR4", "cptyLongName": "SOR4", "coverTradeIds": [], "cptyTradeId": "Exec-db08b0657900eb", "counterPartyAccount": "SOR4LE", "counterpartyALEI": "549300YLYOXGEYO4YK89", "externalRequestId": "FXI9222877130", "benchmarkRate": 0, "dealtAmount": 2000000, "settledAmount": 2372460, "baseAmount": 2000000, "termAmount": 2372460, "spotRate": 1.18623, "rate": 1.18623, "fees": 0, "initialSettledAmount": 2372460, "midMarket": false, "upi": "EUR_USD_SPOT", "uti": "MCQRZU5ST1INP9222972502", "customParameters": { … } }, { "orderId": "4821376492", "tradeId": "FXI9222972501", "tradeType": "Spot", "tenor": "SPOT", "tradeDate": "2022-08-16", "valueDate": "2022-08-18", "executionTime": "2022-08-16 08:24:15,882 +0000", "maker": false, "orderSide": "Sell", "status": "Verified", "symbol": "EUR/USD", "dealtIns": "EUR", "customerAccount": "Cust12LE", "customerOrg": "Cust12", "trader": "MD", "counterParty": "SOR4", "cptyLongName": "SOR4", "coverTradeIds": [], "cptyTradeId": "Exec-db08b064811338", "counterPartyAccount": "SOR4LE", "counterpartyALEI": "549300YLYOXGEYO4YK89", "externalRequestId": "FXI9222877130", "benchmarkRate": 0, "dealtAmount": 1000000, "settledAmount": 1186240, "baseAmount": 1000000, "termAmount": 1186240, "spotRate": 1.18624, "rate": 1.18624, "regulatory": { … }, "fees": 0, "initialSettledAmount": 1186240, "midMarket": false, "upi": "EUR_USD_SPOT", "uti": "MCQRZU5ST1INP9222972501" } ]