Discussing APIs and development related to customers, discounts, and order management.
Hello,
I'm looking for a way to retrieve, in the post-purchase extension, the discount codes that the customer entered. According to the docs, I have access to the 'initialPurchase' but it does not seem to contain the discount codes that were used. Do you know a way to retrieve them?
Thank you,
Simon
You'll have to leverage the Shopify API for that. Both the order and checkout APIs have that information.
Thank you for your answer.
But I don't understand how I can retrieve the order or checkout from the post-purchase extension, as I don't have access to the order id or checkout token in the Checkout::PostPurchase::Render and Checkout::PostPurchase::ShouldRender extension points.
I have access to the purchase reference id in inputData.initialPurchase but it seems useless to retrieve the corresponding order or checkout, isn't it?
(I specify that I do not store the orders on my side)
Simon
Hello,
I still can't find a way to access the order id (or checkout token) in the post purchase extension, in order to get the discount codes. Does anyone have a solution?
Thank you,
Simon
I'm dealing with the same issue, any solutions ?