ORDERS
This section provides the REST API endpoints for managing orders in the Fundamental Interactions market center technology API. The API allows subscribers to perform various operations related to orders, including retrieving all orders, retrieving a specific order, and adding a new order.
Endpoints
1. Get User Orders
HTTP Request Type: GET
Route:
/firestapi/orders
URL / Body Parameters:
Required:
userid
- The user ID for whom the orders are being retrieved.
Optional:
security
- The security symbol to filter orders.fromtime
- Unix time in milliseconds since the epoch (January 1, 1970).
Info: This endpoint returns all orders of a certain user. It will return a maximum of 1000 records.
HTTPS Body Example:
json
WS Example:
json
2. Get Order by Reference Number
HTTP Request Type: GET
Route:
/firestapi/orders/:refno
URL / Body Parameters:
:refno
- The reference number of the order.Info: This endpoint returns the details of one order.
HTTPS Body Example: N/A
WS Example:
json
3. Add New Order
HTTP Request Type: POST
Route:
/firestapi/orders/addorder
URL / Body Parameters:
Required:
security
: "TESTJ"side
: "B" (Buy) or "S" (Sell)qty
: The quantity to buy or sell.price
: The unit priceordertype
: "LMT" (Limit), "POST" (Post Only), "ICEBERG", "STOP", "MKT" (Market)If
ordertype:"ICEBERG", displayqty
is required.If
ordertype:"STOP", stopprice
is required.tif
: "GTC" (Good Till Cancelled), "IOC" (Immediate Or Cancel), "GTT" (Good Till Time), "FOK" (Fill Or Kill), "DAY" (Day)tif: "GTT"
If set to GTT we also need inputexptime
Info: Adds a new order.
HTTPS Body Example:
json
WS Example:
json
Example Implementation in Express.js
Here's an example of how you might implement these endpoints in an Express.js application:
javascript
This example sets up the specified routes using Express.js and handles retrieving user orders, retrieving an order by reference number, and adding new orders. It includes necessary validations and error handling for the endpoints.
Last updated