Update order taxes after changing shipping address

Hello and thank you for helping out.

I am using Shopify (Plus) as my backend server, I would like to know if there is a way to update the taxes on a specific order when editing the shipping address.
Different counties have different tax rates, and some customers might change their shipping address to a different location in a different country. The ideal flow would be that after I update the shipping address on a specific order the taxes would automatically be re-calculated and reflected on the order, however, this is not the case and I am “stuck” with the first address tax calculation.

Is there a way to achieve that behavior through the admin api ( or any other way ).
I am using Shopify Plus if that makes any differences.

Thanks in advance,
Reuven F.

Hello? Shopify? This is rather important to us, too.

I have the same question. Currently, if you change the shipping address to another location the taxes do not update to reflect this new location.

Bumping. Also interested in this!

It’s not uncommon for us to have a customer who moved, or their browser auto-filled the wrong shipping address.

Right now the only option is to entirely cancel the order and have them re-order. This is a bad solution as:

  1. They may decide not to re-order after they’ve cancelled

  2. We are charged processing fees twice as these are not returned on a refund. Our AOV is $2,000 so this is quite a hit just for a silly address change.

Seems pretty simple just add something that:

  1. Recalculates the tax

  2. Suggests either that we need to refund the extra, or send an invoice for the additional

Shopify already has some very close logic that exists currently if there’s an order edit to the products, but nothing that recalculates tax.

This is a serious hole in the software. We also need a work around or fix for this issue ASAP Shopify.

This is sort of doable now.

https://community.shopify.com/post/2768632

I just figured out a workaround - I removed the item(s), and then added them back to the order. The sales taxes updated after that.

Which mutation did you use? I tried doing so using the setQuantity mutation but it doesn’t work on my side…

setting the quantity won’t do it. You have to remove the item entirely by setting it’s quantity to 0. So…

First, change the shipping address:

mutation orderUpdate($input: OrderInput!) {orderUpdate(input: $input) {order { email customer {id} } userErrors {field message}}}
    {"input": {"id": "gid://shopify/Order/12345","shippingAddress":{"address1":"1234 Main Street","city":"Anytown","company":"","provinceCode":"CA","zip":"12345","countryCode":"US","firstName":"John","lastName":"Smith","phone":"+15555551234"}}}

Then, open the order for editing:

mutation {orderEditBegin(id: "gid://shopify/Order/1234") {calculatedOrder{id totalOutstandingSet{shopMoney{amount currencyCode}} shippingLines {id price {presentmentMoney {amount currencyCode} shopMoney {amount currencyCode} } title } lineItems(first:140){nodes{id quantity variant{id idProduct:metafield(key:""kp_idproduct"",namespace:""products""){value}} title sku discountedUnitPriceSet{presentmentMoney{amount}}editableQuantity variantTitle  originalUnitPriceSet{presentmentMoney{amount}}calculatedDiscountAllocations{ discountApplication{allocationMethod, id, appliedTo}}}}} userErrors {field message}}}

Set all the line item quantities to 0:

mutation orderEditSetQuantity{orderEditSetQuantity(id:  "

Re-add all the variants:

```markup
mutation addVariantToOrder{orderEditAddVariant(id:  "gid://shopify/CalculatedOrder/

AllowDuplicates is important. It means, temporarily, you'll have a duplicate variant id in that order until you save it.

Remove the current shipping lines. If shipping is taxed, the current shipping needs to be removed and then re-added
For each shippingLine in shippingLines:

mutation {orderEditRemoveShippingLine(id: “<calculatedOrder.id>”, shippingLineId: “<shippingLine.id>”) {calculatedOrder {id shippingLines {id stagedStatus}} userErrors {field message code}}}


Add the new shipping line:

mutation {orderEditAddShippingLine(id: “<calculatedOrder.id>”, shippingLine: { title: “”, price: { amount: , currencyCode: USD }}) {calculatedOrder { id shippingLines {id stagedStatus title price {shopMoney {currencyCode amount}}}} userErrors {field message code}}}


Save the order:

mutation commitEdit{orderEditCommit(id:“<calculatedOrder.id>”,notifyCustomer:true,staffNote:“”){order{id totalOutstandingSet{shopMoney{amount currencyCode}} totalReceivedSet{shopMoney{amount currencyCode}} netPaymentSet{shopMoney{amount currencyCode}} lineItems(first:240){nodes{id quantity fulfillableQuantity title variant{id}}}} userErrors{field message}}}


Let me know if this all works for you.