[Admin Api] Updating customer on order

brett_harper
New Member
1 0 0

I'm trying to figure out if there's a way to swap an order from one customer to another using the Admin Api after the order has been paid. The api docs for Order only mention how to remove a customer from an order, but makes no mention of how to attach a new one once that is done. I've tried updating the order via the "PUT /orders/{order_id}.json" endpoint by just swapping out the customer, and I've also tried removing the customer first and then adding the new one in 2 separate calls. Removing the customer works just fine, but trying to add one afterward just results in no change on the order (customer stays null).

The only workaround I've seen is to cancel the order & recreate it with the new customer info, but that could lead to other issues with inventory management & getting payment for the new order. It seems odd that this order mutation isn't allowed when other similar changes are: updating the info on a customer (via the "PUT /customers/{customer_id}.json" endpoint) or removing a customer from an order. Is there any way to accomplish this via the api that I may have overlooked? If not, are there any plans to add this functionality in the future?

0 Likes