# Book trade

Enter trades done in other systems.

Endpoint: POST /v2/trades
Version: 1.0.1
Security: SSO_TOKEN

## Request fields (application/json):

  - `type` (string, required)
    Trade type: Spot, Outright, Swap, NDF

  - `channel` (string, required)
    The workflow that originated the request. For reference in monitoring and reports. Values provided by Integral as applicable.
- 0 = API/CreditEntry.
- 1 = API/TradeEntry.

  - `clientRequestId` (string)
    ID of the book trade request assigned by you. Returned in the success response so that you can associate the request and booked trade.

  - `referenceId` (string)
    Free text for additional information and the ID, if any, assigned to the trade by the trade entry organization for their reference.

  - `note` (string)
    Any notes on the trade. These notes are sent via STP if the trade is eligible for STP (stp=true).

  - `counterpartyAccount` (string, required)
    Maker account ID (legal entity).

  - `counterparty` (string, required)
    Counterparty organization ID.

  - `counterpartyTrader` (string)
    Counterparty user ID. If not specified, the organization's default user as configured in the Integral system is used.

  - `customerAccount` (string, required)
    Customer legal entity ID.

  - `customerOrg` (string, required)
    Customer organization ID.

  - `trader` (string)
    Customer user ID. If not specified, the default user of the customer organization is used.

  - `dealtIns` (string, required)
    The dealt instrument, typically three-character ISO code (for example, AUD).

  - `dealtAmount` (number, required)
    Amount of the dealt instrument for the trade or near leg of swaps.

  - `baseAmount` (number)
    Amount of base instrument.

  - `termAmount` (number)
    Amount of term instrument.

  - `rate` (number, required)
    All-in rate to the precision of the currency pair’s quote convention. Trades with rates that are higher precision than allowed are rejected.

  - `side` (string, required)
    The side of the order from the customerOrg perspective, either BUY or SELL.

  - `symbol` (string, required)
    The dealt instrument pair (currency, metal, energy, index, crypto), seven-character ISO code (for example, AUD/USD).

  - `tradeDate` (string, required)
    Date the trade was initiated in the format YYYY-MM-DD.

  - `valueDate` (string, required)
    Value date for the trade or near leg of swaps in the format YYYY-MM-DD.

  - `fixingDate` (string)
    Fixing date for NDFs in the format YYYY-MM-DD.

  - `spotRate` (number)
    Spot rate of the trade or near leg of the trade. Required for outrights, swaps, and NDFs.

  - `forwardPoints` (number)
    Required for outrights, near leg of forward/forward swaps, and NDFs. Forward points for outrights and near leg of forward/forward swaps.

  - `coverRate` (number)
    All-in rate at which the trade or near leg was hedged by the trader in the market.

  - `farSide` (string)
    Required for swaps. BUY or SELL (case sensitive), the side of the far-leg dealt currency from the customerOrg perspective.

  - `farDealtAmount` (number)
    Required for swaps. Far-leg amount of the dealt instrument.

  - `farForwardPoints` (number)
    Required for swaps. Far-leg forward points.

  - `farRate` (number)
    Required for swaps. Far-leg all-in rate.

  - `farValueDate` (string)
    Required for swaps. Value date for the far leg of swaps in the format YYYY-MM-DD. Must be later than the near-leg value date in valueDate.

  - `farCoverRate` (number)
    All-in rate at which the far leg was hedged by the trader in the market.

  - `farFixingDate` (string)
    NDF far-leg fixing date in the format YYYY-MM-DD. Required if farFixingTenor not specified.

  - `bookName` (string)
    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.

  - `creditMode` (integer)
    How the trade is considered for credit by Integral:
- 0 = CreditCheck: Trade request is rejected if credit is not available.
- 1 = CreditOvershoot: Trade request is accepted even if credit is not available. Credit can overshoot the available limit.
- 2 = CreditIgnore: Credit is not taken.

  - `creditValuationAdjustment` (number)
    Credit valuation factor of customerOrg provided by counterparty.

  - `rateId` (string)
    ID of the originating rate, if any.

  - `stp` (boolean)
    If true or not included on the message, STP download is determined by the trade entry organization’s STP configuration. False overrides the organization’s settings and the trade is not sent via STP.

## Response 200 fields (application/json):

  - `tradeId` (string)
    The ID of the booked trade in Integral’s system.
    Example: "FXI30501001"

  - `createdTime` (string)
    The date and time (GMT) the trade was booked in the format yyyy-MM-dd HH:mm:ss,SSS Z.
    Example: "2022-01-19 12:36:27,200 +0000"

  - `clientRequestId` (string)
    ID book trade request assigned by you. Returned so that you can associate the request and booked trade.
    Example: "req swap 1"


## Response 400 fields

## Response 404 fields

## Response 500 fields
