Symptoms
- You send a
PUTto update an existing order to change a quantity, price or option, and the order now shows two lines for the same product instead of one changed line. - The original line is untouched and a new line appears with the values you sent.
- Order totals go up instead of being adjusted, so the order no longer matches what the customer agreed to or what your ERP expects.
- Running the same update again adds yet another line.
- No error is returned. The request succeeds, which is why this often goes unnoticed until someone reviews the order or a reconciliation report.
Cause
The Update an Order endpoint (PUT /v2/orders/{order_id}) uses one field to decide whether a product entry is new or a change to an existing line: the order product id. BigCommerce's Update Order reference states that to add a product you omit the order product id, and to update a product you include it. If your payload leaves out id, the API treats the entry as a new line and adds it.
The most common way this happens is confusing two different IDs:
idon an order product is the "Numeric ID of this product within this order". It is created for each line item.product_idis the catalog product's ID. Sending onlyproduct_id(andvariant_idorproduct_options) describes which product to add, not which line to change.
Integrations that build the update payload from catalog data or from an ERP sales order line, rather than from the order's own line items, usually hit this. An older public Stack Overflow thread reports the same behaviour.
Resolution
- Stop retries first. If a job or queue is replaying the update, pause it so it does not keep adding lines while you fix the payload.
- Ask whether you need to touch products at all. If the integration only changes order status, send just
status_idin thePUTbody and leave theproductsarray out entirely. The reference describes the endpoint as a partial update: send only the fields you want to change. - Read the current lines. Call
GET /v2/orders/{order_id}/products(see the Get Order Products reference). Note each line'sid,product_id,variant_idandquantity. The default page size is 50, so page through results for large orders. - Map your change to the existing line. In the
PUTbody, include the order productidfor each line you are changing, plus only the fields you want to change. Per the reference, only the fields you send change. - Clean up the duplicate line. To remove the extra line, send its order product
idwithquantityset to0. The documentation notes the line stays on the order but no longer counts towarditems_totalor order totals. A negative quantity returns a 400 error naming the field, such asproducts[0].quantity, and the order is not changed. - Check discounts. The reference says that when you change a line's quantity, price, variant, product, options or gift wrapping, the API removes all discounts and promotions from that line item. Decide whether that is acceptable before editing paid or discounted orders.
- Verify the fix. Read the order and its products back. Confirm there is one line per product, the quantities are right, and
subtotal_inc_tax,total_tax,discount_amountandtotal_inc_taxmatch what you expect. Run the update a second time on a test order and confirm nothing new is added.
If the order still gains lines when you send a valid order product id, contact BigCommerce support with the store hash, order ID, the exact request body and the response.
How to prevent it
- Always build order edits from a fresh read of the order's line items, never from catalog or ERP line data alone.
- Store the BigCommerce order product
idagainst each ERP sales order line when the order first syncs, so later edits can target the right line. - Make the update idempotent: compare the desired state with the current lines and send only the differences.
- Test edits on a test order before using them on paid orders, and log the request and response for every order edit.
B2B and ERP considerations
In B2B, quantities often change after a sales rep or buyer reviews a purchase order. Because changed lines lose their discounts and promotions, a contract or price list discount applied at checkout may not survive an API edit. The reference advises syncing the order to any external system again after the update, so make sure your connector re-reads the order rather than assuming its own copy is correct.
If both your ERP and BigCommerce can edit orders, pick one system as the owner of line changes, so the two copies of the order do not drift apart.
Related problems to check
- A webhook creates duplicate orders or fulfillment actions
- An order webhook does not contain all order data
- A connector or import job hits API rate limits
Related articles
- An inventory API update succeeds but a read returns old stock
- An order webhook does not contain all order data
- Buy one get one discounts the wrong quantity or item
- A webhook creates duplicate orders or fulfillment actions
- BigCommerce implementation playbook
More in the BigCommerce knowledge base, including every article on Integrations and account operations.