Listing Product Pairs
Tradable product pairs are returned by List Products. This endpoint’s response includes all enabled products for a given portfolio, along with crucial details such as minimum/maximum order increments and order book precision. This can be used to validate order parameters, ensure compliance with product constraints, and power trading interfaces or workflows.- Java
- .NET
- Go
- Python
- CLI
- TS/JS
Creating a Trade
Trading via the Prime REST API is conducted through the Create Order endpoint. When an order is created, the product (for example,BTC-USD) and the portfolio ID must be specified. The portfolio ID determines which trading balance will be used for debits and credits, and can be obtained from List Portfolios or from the URL of the Prime web UI.
Any order algorithm supported in the Prime UI is also available through the Create Order API. Prime supports specifying orders in both base units (e.g., “10 ETH”) and quote units (e.g., “100,000 USD of ETH”).
- Java
- .NET
- Go
- Python
- TS/JS
- CLI
Tracking an order
When an order is successfully created, the API returns an order ID. This ID can be used to check the current status or attempt to cancel the order. There are multiple ways to track order status:- Orders WebSocket: Subscribe to real-time updates for order status and fills via the Orders Websocket
- Get Order by ID: Poll the Get Order by ID endpoint to retrieve detailed information about the order, including price and quantity details.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
Order Fills
An order can be split into multiple fills. Each fill contains specific details, such as venue that executed the fill. These fills are all tied to the same order ID.- List Order Fills: List Order Fills retrieves fills specific to a given order ID.
- List Portfolio Fills: List Portfolio Fills retrieves all latest fills across a portfolio, which can also be subsequently filtered
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
Cancelling an order
If an order is still open, a cancellation may be attempted via Cancel Order. Note that a cancellation request does not guarantee a successful cancellation because the order status could change at any time (e.g., it may fill before the cancel request is processed).- Java
- .NET
- Go
- Python
- CLI
- TS/JS