Place Trade API
The Place Trade API allows you to execute trades on a specified portfolio. You can place market orders for immediate execution.
Endpoint
PUT /trade/{portfolioId}/{ticker}Authentication
All requests require the IdToken obtained from the authentication flow:
Authorization: Bearer <ID_TOKEN>
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| portfolioId | string | Yes | The portfolio ID where the trade will be executed (e.g., "default") |
| ticker | string | Yes | The stock ticker symbol (e.g., "AAPL", "GOOGL") |
Request Body
Common Fields (All Order Types)
| Field | Type | Required | Description |
|---|---|---|---|
| orderSide | string | Yes | Either "BUY" or "SELL" |
| orderType | string | Yes | Must be "MARKET" |
Order Types Overview
This API supports both BUY and SELL Market orders.
1. Market Buy
Use this to buy shares at the current market price, you want to invest a specific dollar amount.
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
| orderSide | string | Yes | Must be "BUY" |
| orderType | string | Yes | Must be "MARKET" |
| amount | number | Yes* | Dollar amount to invest |
2. Market Sell
Use this to sell a specific number of shares at the current market price immediately.
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
| orderSide | string | Yes | Must be "SELL" |
| orderType | string | Yes | Must be "MARKET" |
| quantity | number | Yes | Number of shares to sell |
Response Format
| Field | Type | Description |
|---|---|---|
| message | string | Always "Success" for successful orders |
| requestId | string | Unique identifier for this order - required for tracking and managing the order. |
Using the RequestId:
The requestId returned in the response is essential for managing your order. You will need it for:
- Check Trade Status - Monitor order execution and fill status
- Cancel Trade - Cancel pending orders
- Order Management - Track and reference this specific order
Store the requestId securely - You'll need it to manage this order throughout its lifecycle.