alpaca-trade-api-python icon indicating copy to clipboard operation
alpaca-trade-api-python copied to clipboard

id vs order_id vs client_order_id

Open jabowery opened this issue 4 years ago • 0 comments

Part of the reason it's important to have off-hours API testing is the lack of clarity in both the API documentation and the API code comments.

An example is the inconsistent treatment of order IDs across calls. In the introduction to "Understanding orders" we find the statement:

Once an order is placed, it can be queried using the client-side order ID or system-assigned unique ID to check the status.

Of course, one wishes to do a lot more than merely "check the status" of an order eg replace, cancel, etc.

But a lot of places refer merely to "order_id" rather than "id" or "client_order_id" which would lead one to believe that in those places where "order_id" is the only name allowed in an argument list, one can provide either the id or the client_order_id and things will work fine. However, the exception string of some calls merely states "order not found: d5a3e1fa-e91a-421e-b212-22dd369caa63" which can be interpreted to mean either that the order is no longer available to be canceled, replaced or whatever, or that one has provided the id when the client_order_id was expected or vis versa.

Please clean this up!

jabowery avatar Mar 17 '21 17:03 jabowery