Execute a spot trade with ESP rates, from login and requesting rates to downloading the done trade.
- Your REST API app.
- Integral API login with trading permission.
- Your organization provisioned with at least one provider who streams ESP spot prices.
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
{ "user": "apiUserId", "pass": "This is a long password!", "org": "apiOrganizationId" }
Use the Get spot rate by symbol endpoint.
See the related Get spot prices tutorial.
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/rates/spot
- Payload
- JavaScript
No request payload
Use the Place order endpoint.
See the related Place an order (limit) tutorial.
To get your order status, you must query your order. After the initial success/fail response, status updates are not pushed to you.
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/orders
- Payload
- JavaScript
{ "coId": "8932452311944", "type": "Limit", "side": "Buy", "symbol": "EUR/USD", "currency": "EUR", "size": 1000000, "price": 1.0971678, "timeInForce": "IOC" }
To get your order status, you must query your order. After the initial success/fail response, status updates are not pushed to you.
Use the Query order (server ID) endpoint.
The diagram shows the values returned in the status
field in the response.
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/orders/{id}
- Payload
- JavaScript
No request payload
Use the Get trades endpoint.
The endpoint returns all executed trades that have not been downloaded before.
Use the orderId
from the 202 response when you placed the order to get your trade from the array of returned trades.
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/trades/stp/messages
- Payload
- JavaScript
No request payload