Re: [Admin Api] Updating customer on order

Can Admin Api be used to change order's customer after payment?

brett_single
Shopify Partner
4 0 5

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?

Replies 2 (2)

Kieron
Excursionist
39 0 1

Brett, did you ever work out a solution to this problem? I'm having the same issue.

brett_single
Shopify Partner
4 0 5

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.