Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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?
Brett, did you ever work out a solution to this problem? I'm having the same issue.
No, we ended up just detecting the situation & informing our user that a change like that isn't supported through our app, then pointing them to the workaround mentioned above. We didn't feel comfortable recreating the order due to the inventory & payment issues I mentioned. It seems like Shopify doesn't have any interest in fixing this issue either, as everything I've found in Shopify's docs just points to the cancel & recreate workaround I mentioned.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025