Alpaca status code
Alpaca status code: HTTP 403
What does HTTP 403 mean on the Alpaca API?
Forbidden. On POST /v2/orders the Trading API document gives it for insufficient buying power or shares. On the Market Data API the FAQ gives it for a request that is unauthenticated, wrongly authenticated or not permitted by the subscription, and the getting started page shows it as the reply to GET /v2/account sent with no credentials.
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.
How do I fix HTTP 403?
On an order: check buying_power (non_marginable_buying_power for crypto) and the position before sending. On any call: check both headers are present and belong to the host you are calling; on data calls check the feed is one your plan allows.