# How to replace accepted order

**URL:** <https://forum.alpaca.markets/t/how-to-replace-accepted-order/13377>\
**Category:** Random\
**Created:** [December 30, 2023, 6:15pm UTC](https://forum.alpaca.markets/t/how-to-replace-accepted-order/13377 "2023-12-30T18:15:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![abcd1423](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@abcd1423](https://forum.alpaca.markets/u/abcd1423)\
**Post date:** [December 30, 2023, 6:15pm UTC](https://forum.alpaca.markets/t/how-to-replace-accepted-order/13377/1 "2023-12-30T18:15:20Z")

</div>

I’m using the following Python code to replace an order: api.replace\_order(‘9c2933df-4dc7-4c18-8bd3-c2cab4804eee’,1,150,200,None,‘day’). But I get the error: alpaca\_trade\_api.rest.APIError: cannot replace order in accepted status. The order is open, accepted but not yet filled so why am I not allowed to replace the order? Is there an alternative if one tries to update stop and limit of an existing order?
