The buyer sees the post purchase page after they have placed an order and can add a product to their existing order. I want to know the order Id of the edited order, so I can tag it with my app’s name.
I have not been able to find a way to get the order Id of the initial purchase. Need some help with this please!
I’m facing similar issues and I’m thinking of matching referenceIds between the shouldRender Input data and the order webhooks to get the order id but this feels more complicated than it should be, and I’m not even sure if it’ll work.
Once this is done, then on the server side you will need to subscribe to the order webhook and check for the “isUpsellOrder” metafield by calling the Order API’s metafields endpoint:
Thank you! I was confused about metafields too and this clears it up.
I should also mention I did some testing last night and it looks like the “referenceId” can be matched to the order webhook’s “checkout_token”. I’m not sure how consistent this is but I’ll be doing more testing today.
Did this end up being the final solution you landed on? Having trouble with this at the moment. Also curious how you were accessing the webhooks in the first place?