Missing something basic in retrieving by client order ID?

Hi guys - seeing some answers to this for v2, but need to use v1 at the moment. I’m trying to get order data from client order ID (that I’ve set) for a specific user.

Here’s my python request:

params = {"client_order_id": "id_here"}

r = requests.get(BASE_URL + "/v1/trading/accounts/account_here/orders", auth=auth, params=params)

For some reason, this is giving me an empty object, despite this order existing for the user. Am I missing something in the syntax?

Your final URL should look like

https://api.alpaca.markets/v2/orders:by_client_order_id?client_order_id=XXXX

and in this case, you’ll receive your order.

1 Like