Book a trade
Goal
Book a trade done in another system.
You can then take advantage of Integral's advanced analytics, reporting, and credit management.
Prerequisites
- Your REST API app.
- Integral API login with trading permission.
- A trade done in another system.
Steps
Step 1: Login
Use the Login and get token endpoint.
See the related Login tutorial.
Your access token is in SSO_TOKEN
of the response header. Your token is valid for limited time.
Pass the SSO_TOKEN
cookie value with all of your subsequent API requests.
- https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/sso/login
- Payload
- JavaScript
application/json
{ "user": "apiUserId", "pass": "This is a long password!", "org": "apiOrganizationId" }
Response
application/json
{ "status": "OK", "errorCode": null, "responseTuples": null, "expiryTime": 1665490480729, "serverUTCTime": 1665490420730 }
Step 2: Book a trade
Use the Book a trade endpoint.
- https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/trades
- Payload
- JavaScript
application/json
{ "type": "Spot", "channel": "1", "clientRequestId": "req Spot 644", "counterparty": "BrokerOrg", "counterpartyAccount": "BrokerOrgLE", "counterpartyTrader": "BrokerOrgUser", "coverRate": 1.1234, "creditMode": 2, "creditValuationAdjustment": 1.44, "customerAccount": "CustOrg1le1", "customerOrg": "CustOrg1", "trader": "CustOrg1User", "dealtAmount": 2000000, "dealtIns": "USD", "note": "Notes on trade", "rate": 1.09706, "rateId": "2022-05-12-GBPUSD-SP-435cd558", "referenceId": "ref A4f2", "side": "SELL", "spotRate": 1.09696, "stp": true, "symbol": "GBP/USD", "tradeDate": "2022-05-12", "valueDate": "2022-05-17" }
Response
application/json
{ "tradeId": "FXI30501001", "createdTime": "2022-01-19 12:36:27,200 +0000", "clientRequestId": "req swap 1" }