Update shipping costs for unfilfilled orders

Topic summary

A user needs to programmatically update shipping costs on unfulfilled orders when weights change after order creation, using a custom payment method.

Initial Solution Attempted:

  • The orderEditUpdateShippingLine GraphQL mutation was suggested but proved insufficient
  • This endpoint only updates shipping lines added during the current order edit session, not existing shipping lines on the order

Workaround Discovered:

  • Remove the existing shipping line using orderEditRemoveShippingLine
  • Add a new shipping line with updated costs using orderEditAddShippingLine
  • This two-step process effectively updates shipping costs on unfulfilled orders

Context:
The solution must work within a middleware connecting a BI tool to Shopify, ruling out third-party app integrations. The workaround was confirmed after the original responder encountered the same limitation.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Hello guys,

we use a custom payment method for our orders. However, sometimes the shipping weights change afterwards. Therefore, we want to automate the process and adjust the shipping costs/method via API. Is there a way to update the shipping costs for an unfulfilled order using the API? Independent of the payment. I can not find the right endpoint, can some help me please?

1 Like

Looks like this should work:

https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/orderEditUpdateShippingLine

If you’d like me to build out a workflow automation using our app mesa to do this, just let me know.

1 Like

Hey, thank you for your response.

I tried it but it seems that i can only update shippingLines that I added durring the orderEdit mutation but not the shipping that is currently on the order. “Updates a shipping line on the current order edit”.

Do you have a other idea?

Hmm - I could probably dig into it further and find a solution if you were interested in using our app mesa to implement this.

Unfortunately, I need this in a middleware between a BI tool and Shopify. So an app is unfortunately not an option. Nevertheless, I’ll keep the app solution in mind for other projects and get back to you when I have a suitable project for it.

1 Like

Gotcha what’s the BI tool?

Hey @Niklas_g - ironically I am now stuck on the same issue you were :rofl: Was expecting this to allow you to update the shipping line on the order but hitting a weird error message. Did you ever figure it out?

Figured it out - you have to do orderEditRemoveShippingLine and then orderEditAddShippingLine.