how to edit line items of the order through API?

Highlighted
Shopify Partner
8 0 1

Hello everyone, I want to change the line items of an order, and after hours of searching, I found several apps that could do that. However, I checked admin API, store API etc, all I found is that only notes/ address/ etc can be changed, but not line items (and not quantity/price). So I just wonder how did those apps can change shopify order? Is there anyway I can develop a private app so we can edit line items of orders? Thanks very much.

0 Likes
Highlighted
Shopify Expert
9871 100 1708

Line items on an Order can not be changed. You'd need to create a new Order. 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Highlighted
Shopify Partner
8 0 1

Thanks for reply! Yup, thats what I got after studing through the API doc...

But what really bugs me is that some app are able to do that, such as:

https://apps.shopify.com/order-editor

https://apps.shopify.com/order-editor-by-lion-apps

So I am wondering is there some API not listed, or some API are restricted to normal app developer?? Thanks.

 

 

0 Likes
Highlighted
New Member
3 0 0

For future readers..

 

It is possible to update line items of an existing order now using GraphQL

0 Likes
Highlighted
New Member
2 0 0

@MrRobot6629 wrote:

For future readers..

 

It is possible to update line items of an existing order now using GraphQL


This function is not yet documented. Have you experimented on your own to find that out?

 

https://shopify.dev/docs/admin-api/graphql/reference/mutation/orderupdate?api[version]=2020-07

0 Likes
Highlighted
New Member
3 0 0

Yes, I can confirm it works. I've implemented it in a store for one of my clients successfully.

 

One thing i found out is that you can't edit line items for order

- Created via API / Import

- Multi-currency orders

 

There might be more exceptions like this but this is what I've found out so far

0 Likes
Highlighted
New Member
1 0 0

Is it possible to change the price of an variant when adding it to (or edit) line items - at update DraftOrder or at update Order via REST or GraphQL API?

0 Likes
Highlighted
New Member
3 0 0

Not sure about the edit order item but i believe you can add line item to draft order with custom price

0 Likes