Place an at-best order and query its progress through the order workflow.
This guide uses the at-best order type: you submit the order to get done at the best rate available. Your priority is trade execution over price.
- Your REST API app.
- Integral API login with trading permission.
- Your organization provisioned with at least one provider who streams RFS 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 Place order endpoint.
You must send the following with your order:
type=AtBest
timeInForce=FOK
valueDate
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": "1685730661", "type": "AtBest", "side": "Buy", "symbol": "USD/INR", "currency": "USD", "size": 1000000, "priceType": "NDF", "timeInForce": "FOK", "org": "CustomerOrg", "valueDate": "2023-06-15" }
To get your order status, you must query your order. After the initial success/fail response, status updates are not pushed to you.
Use one of the following endpoints:
The diagram shows the values returned in the status
field in the response and their context in the order workflow.
- Mock server
https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/orders/{id}
https://3ac93db9-6290-458d-9482-0dc0a0e9607a.remockly.com/v2/orders/{id}
const id = '4820276016';
const resp = await fetch(
`https://docs.fxinside.net/_mock/openapi/integral-api-reference/rest/v2/orders/${id}`,
{
method: 'GET',
headers: {
SSO_TOKEN: 'YOUR_API_KEY_HERE'
}
}
);
const data = await resp.text();
console.log(data);