How to set metafield value after order payment?

Hello,

I created a metafield for the orders and i would like to set the value after the payment.

Is it possible to do this with an extension ?

I found that documentation : https://shopify.dev/docs/api/checkout-extensions/post-purchase/api#metafield

But when i generate an extension, post-purchase-ui is proposed instead of post-purchase.

Do you have an idea ?

Thanks a lot

Have you tried using Shopify Flow, it just might be the solution you are looking for here a link that you might find helpful

https://help.shopify.com/en/manual/shopify-flow/reference/actions/update-product-metafield

And If you want to make it more convenient please look at the bottom of this post.

Hello Ayan

Thank you for your response.

That could be a solution. https://help.shopify.com/en/manual/shopify-flow/reference/actions/update-order-metafield

No problem, If the solution works can you please mark it as an accepted solution so it could help people who later look at this post.