Overview
This guide explains how to submit buy or sell orders for assets in a user’s portfolio using the Investment Orders endpointPOST /investments/orders.
All order operations require M2M authentication with a bearer token and the
x-user-id header to specify which user’s orders to manage.Key differences between order types
- Buy orders: Specify
amount(monetary value to invest). You must verify the user has sufficient cash balance before submitting. - Sell orders: Specify
quantity(asset units to sell). You must verify the user has sufficient holdings before submitting.
Prerequisites
- Access to API endpoints
- M2M bearer token with required scopes
x-user-idheader (user identifier, MongoDB ObjectId format)
Buy order flow
Use this flow to purchase an asset for a user’s portfolio.1
Verify available cash
Before submitting a buy order, retrieve the user’s cash balance to ensure sufficient funds are available.Call
GET /cash to retrieve the available cash balance across all currencies.2
Build the buy order request
Create an order request with the asset ISIN and the monetary amount to invest.
3
Submit the buy order
Call
POST /investments/orders with optional query params:- paymentMethod:
cash(default) orgift - executeEtfOrdersInRealtime:
trueonly for users enabled for real-time ETF execution
4
Render the transaction in UI
The response is an
AssetTransaction with display-ready fields such as displayAmount, displayQuantity, executionWindow, fees, and nested orders.- Show execution window: Use
executionWindow.type(e.g., real-time or market-hours) andexpectedExecutionDatewhen provided. - Show fees: Display
fees.commission.amount,fees.fx.amount, etc., when present. - Show order summary: From
orders[0], readisin,side,status, anddisplayQuantity.
Successful submission returns HTTP 200 with a populated transaction object.
Sell order flow
Use this flow to sell an asset from a user’s portfolio.1
Verify portfolio holdings
Before submitting a sell order, retrieve the user’s portfolio holdings to ensure sufficient quantity of the asset is available.Call
GET /portfolios/{id} to retrieve holdings with asset details and quantities.2
Build the sell order request
Create an order request with the asset ISIN and the quantity to sell.
3
Submit the sell order
Call
POST /investments/orders with optional query params:- paymentMethod:
cash(default) orgift - executeEtfOrdersInRealtime:
trueonly for users enabled for real-time ETF execution
4
Render the transaction in UI
The response is an
AssetTransaction with display-ready fields such as displayAmount, displayQuantity, executionWindow, fees, and nested orders.- Show execution window: Use
executionWindow.type(e.g., real-time or market-hours) andexpectedExecutionDatewhen provided. - Show fees: Display
fees.commission.amount,fees.fx.amount, etc., when present. - Show order summary: From
orders[0], readisin,side,status, anddisplayQuantity.
Successful submission returns HTTP 200 with a populated transaction object.
Error handling
- 400 Bad Request: Validation or business rule violation (e.g., invalid amount, missing required field, invalid ISIN).
- 401/403: Authentication/authorization failures.
- 404 Not Found: Portfolio or related resource not found.
See also
- API Reference → Order Execution →
POST /investments/orders - API Reference → Cash →
GET /cash - API Reference → Portfolio →
GET /portfolios/{id}