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.