US Stocks Error Codes
The US Stocks APIs return errors in the standard error response. Codes from UDAPI1300 to UDAPI1323 are specific to US stocks. The APIs also return the common error codes, including UDAPI10005 when you exceed the US Stocks rate limits, and shared validation codes such as UDAPI1026 (instrument key is required).
Validation errors
These errors return HTTP 400. Fix the request before you retry.
| Error code | Description |
|---|---|
| UDAPI1300 | Invalid US instrument - The instrument_key is not in the US instruments file. |
| UDAPI1301 | This US stock is not tradable - The stock is listed but not currently tradable. |
| UDAPI1302 | Provide exactly one of quantity or amount - Send either quantity or amount, not both and not neither. |
| UDAPI1303 | Quantity must be greater than 0 with at most 9 decimal places. |
| UDAPI1304 | Fractional quantity is not allowed for this stock - The stock has fractionable: false. |
| UDAPI1305 | Amount must be greater than 0 with at most 2 decimal places. |
| UDAPI1306 | Amount orders are not allowed for this stock - Amount orders need a fractionable stock. |
| UDAPI1307 | Price must be greater than 0 for a limit order. |
| UDAPI1308 | Price is not allowed for a market order - Omit price or send 0. |
| UDAPI1309 | Price allows 2 decimal places at or above $1 and 4 below $1. |
| UDAPI1310 | Order value must be at least $1. |
| UDAPI1311 | Order size cannot exceed 999,999 - Applies to both quantity and amount. |
| UDAPI1323 | Order value cannot exceed $40,000. - Checked by Place Order when the value is fixed: an amount order, or a limit order at quantity × price. Not applied to estimates or the margin calculator. |
| UDAPI1313 | Quantity is required. |
| UDAPI1314 | Price must be greater than 0. |
| UDAPI1315 | Provide at least one order - The margin request instruments array is empty. |
Account and order errors
| Error code | HTTP status | Description |
|---|---|---|
| UDAPI1316 | 403 | US stocks is not activated for this account - Activate US stocks on your Upstox account. See how to start investing in US stocks with Upstox. |
| UDAPI100500 | 400 | US order was rejected - The US broker rejected a place or cancel request, or an estimate. The error message carries the broker's reason, for example insufficient funds or quantity. |
| UDAPI100040 | 400 | Cancel of already cancelled/rejected/completed order is not allowed - The order has already finished: complete, cancelled, cancelled_partially, failed, failed_partially or expired. |
| UDAPI100010 | 404 | Order not found - No US order exists with this order_id. |
| UDAPI1319 | 500 | The US order service did not confirm this request in time. Check your order book before retrying. - A place or cancel request timed out and may still have gone through. |
Service errors
These errors return HTTP 423. They are temporary, so retry after some time.
| Error code | Description |
|---|---|
| UDAPI1317 | US stocks order service is unavailable. Please try again later. |
| UDAPI1318 | US stocks trading is in its daily maintenance window. Please try again later. |
| UDAPI1320 | US stocks funds service is unavailable. Please try again later. |
| UDAPI1321 | Last traded price is unavailable for this US stock. Send a price or try again later. - Returned by the charges and margin APIs for a MARKET order. Send a price to use as a fallback. |
| UDAPI1322 | US market status is unavailable, so the order was not placed. Please try again later. - Returned by Place Order, which needs the market status to decide whether the order is an after-market order. |
Indian order API errors for US instruments
The Indian Place Order, Place Order V3, Place Multi Order and Place GTT Order APIs reject instruments they cannot route.
| Error code | Description |
|---|---|
| UDAPI1250 | This instrument's segment cannot be traded through this API. |
| UDAPI1251 | US stocks cannot be ordered through this API. Use the US order API instead. - Use the US Place Order API. |