SIMPLIFIED ORDERS
Splits the order route into multiple routes for clearer error handling
1. Limit orders
HTTP Request Type: POST
Route:
/firestapi/orders/limitURL / Body Parameters:
Required:
security: "TESTJ"side: "B" (Buy) or "S" (Sell)qty: The quantity to buy or sell.price: The unit price.ordertype: "LMT" (Limit), "POST" (Post Only), "ICEBERG", "STOP"If
ordertype:"ICEBERG", displayqtyis required.If
ordertype:"STOP", stoppriceis 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.
2. Market orders
HTTP Request Type: POST
Route:
/firestapi/orders/marketURL / Body Parameters:
Required:
security: "TESTJ"side: "B" (Buy) or "S" (Sell)qty: The quantity to buy or sell.price: The unit price.
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