Ideally I would like to fetch the amount the customer has paid for shipping, and apply it as a discount to the post-purchase product offer if the customer accepts the offer and the total price exceeded the free shipping threshold.
As far as I can tell, it’s not available. My workaround was to fetch it via the admin API, but I’m not sure if that’s possible without knowing the order ID which doesn’t seem to be available.
I found a workaround using the shopify web pixel checkout_started event. This event gives you a checkout token which also aligns with an ID that you receive in the post-purchase event. This can then be used to cross-match more information that the checkout_started web pixel event gives you. You just have to store some data from the checkout_started event to the user in your database, and then fetch that data from the post-purchase extension side of the app. It would probably require some intermittent polling of the database to retrieve it as there will be two seperate operations running at once, but it should work ok.
I haven’t actually done it yet though but it seems reasonable enough.