Broker API HubMenu

Alpaca status code

Alpaca status code: HTTP 422

The error, as text you can copy

HTTP 422
Kind
Status code
API
Alpaca

What does HTTP 422 mean on the Alpaca API?

Unprocessable. On POST /v2/orders the document gives it where input parameters are not recognised; on DELETE /v2/orders/{order_id} where the order's status is not cancelable; on DELETE /v2/positions where parameters are invalid.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Independent and unofficialdocs.alpaca.marketschecked

How do I fix HTTP 422?

For an order, compare every field with the record of POST /v2/orders: type and time_in_force are required, limit_price and stop_price depend on the type, and a price finer than the allowed decimals is rejected. For a cancel, read the order first: filled, canceled and expired orders cannot be cancelled.