Alternative to `useApplyMetafieldsChange` when the target is not `purchase.checkout`

Hi there,

I’m trying to add a checkout ui extension to my app and I have to set the target to purchase.thank-you.block.render because I want to display it on the thank you page

This extension will render a simple form that reflects some customer metafield definitions (selected by the merchant). When the customer submit this form, the data will populate the customer metafields.

I’ve added the same exact form on the checkout section (target: purchase.checkout.block.render) and I’m able to save the metafields by using the useApplyMetafieldsChange hook (This hook will save the metafields on the order metafields. My app listen for the orders/create webhook, so I can update the customer metafields using the order metafields)

The problem is that I don’t have access to the useApplyMetafieldsChange on the thank you page extension.

Is using the app proxy the only way to do this? The sessionToken only guarantees the integrity of its claims, it does not guarantee the request itself originated from Shopify.

Hi Baggio,

From digging into this, it does look like you’ll need to an app proxy to handle the data submission and update the metafields on the server side after the checkout process is complete.