Edit line item price on completed order through API

Edit line item price on completed order through API

brandon_k
Shopify Partner
8 0 2

Hello,

 

We've used a custom app to create Orders as a way to import our historical data, and use the Shopify store as the single source of all orders throughout our history. Upon review of some of these orders, we've identified some incorrect prices on order line items (not a problem with Shopify - it was our source data at the time of import), and we need to update the incorrect values to have the proper price.

 

How can we update the price of order line items through API?

 

I've reviewed the documentation for the GraphQL order mutations, and there doesn't appear to be any way to change the price. The closest option would be to apply a discount to bring down any prices that are too high. This isn't ideal, and would leave us stuck with any prices that are too low.

 

I've also tried using the Admin REST API to simply update the order with a body like this:

{
    "order": {
        "line_items": [
            {
                "id": 1234564789,
                "price": "50.00"
            }
        ]
    }
}

but this did not update the price of the line item in the order.

 

Any help here would be greatly appreciated.

Reply 1 (1)

brandon_k
Shopify Partner
8 0 2

To follow up on this, for anyone else in a similar situation: There did not appear to be any way to accomplish this by updating the order. In the end, I implemented a process of

- create a new order with the applicable information from the existing order

- ensure that the order items have the correct values set

- copy everything else possible like notes, customer, address, etc.

- ensure the new order was fulfilled, copying in applicable data when possible like tracking information

- delete the original order

 

Hopefully this will help some others in this situation.