Orders API - split order by deleting line_items and creating new order with the deleted line_items

arieltlr
New Member
3 0 0

I am trying to help a client with pre-order business logic. When an order comes in with x items in stock and y items out of stock (set to continue selling when sold out), the client would like split the order into two shipments: 1 with y out of stock items and 1 with x in-stock items. 

I've been playing around with a private app and the API on a development store. It looks like using the orders API endpoint, if you remove a line_item from an order, the customer is automatically refunded for the line_item. Is there a way to avoid that if the line_item is added to a new order? I'd like to avoid refunding and then re-charging the customer throughout the process. 

The warehouse doing fulfillment is currently using admin/api/2021-04/orders.json. I might be able to convince them to use “"https://" & StoreName & ".myshopify.com/admin" & "/orders/" & OrderSid & "/fulfillments.json””  but that will take some development work on their end. If I can do it without getting their deve team involved that would be better. 

 

 

0 Likes
awwdam
Shopify Staff
Shopify Staff
92 10 4

Hey @arieltlr, some great questions here!

You might want to consider looking into the Fulfillment Order API if working with REST. There is also a great tutorial on this from an order management lens! - Cheers!

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
arieltlr
New Member
3 0 0

Hi @awwdam Thanks for looking at my questions! So it seems that the only way to accomplish this is through the fulfillment API.. is that correct?

0 Likes