alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
143 stars 13 forks source link

/v2/orders/order_id 422: Unprocessable #135

Closed pererasys closed 3 years ago

pererasys commented 3 years ago

Docs say it should only return a 404, I've also tried sending the request with order_id in query params but that didn't work either.

Am I doing something wrong?

Error response: "response": { "url": "https://paper-api.alpaca.markets/v2/orders/some_order_id?nested=false", "status": 422, "statusText": "Unprocessable Entity", "body": { "code": 40010001, "message": "order_id is missing" } }

jerwheaton commented 3 years ago

Hi @pererasys A 422 error status code is returned if the {order_id} segment of the URL isn't a valid identifier. You should be able to retrieve a list of your orders by querying the endpoint GET /v2/orders?status=all, and use the id field from the response there in a request to get information on a single order.

pererasys commented 3 years ago

Got it, they might wanna update the docs, I was expecting a 404