calculateChangeset() isn't calculating shipping of added items - Is it meant to?

Topic summary

Issue: In post‑purchase offers, calculateChangeset (PostPurchaseRenderApi) updates item price and taxes when using add_variant, but does not adjust shipping charges despite items increasing shipping tiers.

Reproduction: Tested with multiple shipping rate ranges (by weight) and an added variant expected to bump the shipping rate. Also replicated on a fresh Remix template app following Shopify’s post‑purchase guide, and on another store—shipping lines remained unchanged.

Docs vs. behavior: Shopify docs/examples imply calculateChangeset computes shipping and taxes automatically. This has led to confusion about whether shipping is handled by Shopify or must be added manually.

Current understanding: Both participants report the same behavior. The most recent update concludes developers likely need to compute shipping themselves and include an add_shipping_line change (i.e., explicitly add a shipping line to the changeset). No implementation details were provided yet.

Status: No confirmed official resolution; documentation clarity is in question. Action item for developers: plan to calculate shipping and add shipping lines manually until clarified by Shopify.

Summarized with AI on December 28. AI used: gpt-5.

I’m developing a post-checkout offer app and, from my understanding of the docs, it seems that calling 'calculateChangeset’ from the 'PostPurchaseRenderApi’ should handle any extra shipping costs that may be required for the customer to pay. It is adding the item cost to the order, adding appropriate tax, but shipping is not being added if its required.

I have tested this by setting up various shipping rates that cover different weight ranges, and and adding an item (in the post-checkout offer) that would cause a bump in the shipping rate being charged.

I am passing in the variant with the ‘add_variant’ type, along with the variantId and quantity, as follows:

const changes = [
    {
      type: "add_variant",
      variantID: variantId,
      quantity: 1,
    }
  ]

I see that there is a ‘add_shipping_line’ type that you are able to add to the changes, but I’m assuming that’s not needed for the shipping to be calculated from the added item?

The docs/example of the post-purchase checkout extension leads me to believe the shipping is automatically calculated with no need to pass in the ‘add_shipping_line’ object in the change set.

Happy to be corrected about my understanding of this.

I have tested this on a freshly installed app (Remix template & following the post purchase guide), on a different store with various shipping rates, and it’s still returning the same result of no updated shipping lines.

Having a similar issue. Does Shopify calculate the shipping or we have to do this manually?

In the doc its a bit unclear if it happens automatically from Shopify’s side or not - https://shopify.dev/docs/apps/build/checkout/product-offers/post-purchase/start-building#compute-shipping-and-taxes-using-calculatechangeset

@Danh11 Were you able to figure this out?

I came to the conclusion that you’ve got to work it out yourself and apply the shipping lines. I’m on my phone so I can’t remember details, but there would be a method of some sort that allows you to add a shipping line. I’m not sure how complicated it is as I haven’t implemented it myself yet.

1 Like