BUG: Filled orders are cancellable (At least the API thinks)

The problem occurs on a paper trading account

What is the problem:
The API result of the cancel order API return 204 even if the order was filled and cannot be cancelled anymore. I never got anything else back from that endpoint. (The order itself stays filled if I check online)

Example request:

DELETE https://paper-api.alpaca.markets/v2/orders/66571186-97b2-4489-9813-752c7fd2c2ee

(This paper trade was filled yesterday - The cancel request was executed just now)


204 https://paper-api.alpaca.markets/v2/orders/66571186-97b2-4489-9813-752c7fd2c2ee (1152ms)

There is cleary something broken on your end

1 Like

@dhoehl Thank you for pointing this out. This does indeed seem to be a bug. When trying to cancel an paper order with a status filled it returns a 204. It should return a 422 according to the documentation. I’ve submitted an issue report to the Alpaca engineering team. Please let us know if you find other inconsistencies or errors like this in the future.