#ekko123

1 messages ยท Page 1 of 1 (latest)

round patrolBOT
mellow thicket
#

Discount doesn't support retrieval API

#

Can you share what you would like to achieve?

plain parrot
#

We handle "checkout.session.completed" webhook in our system and update order data, after that we send out our custom receipt. For the receipt we would like to add name of the used discount code. We have tried achieving this by handling "customer.discount.created" webhook and updating that data to the order object.

But we have potential issue where discount webhook comes after session complete webhook.

mellow thicket
#

You can do the retrieval call after receiving the checkout.session.completed event

plain parrot
#

This fixes our problem!! Sorry to bother you with something that is clearly stated in documentation, don't know how I missed the expand flag... ๐Ÿ˜…

Thank you so much!! ๐Ÿ‘

mellow thicket
#

No problem! The expand flag on the discounts is not that obvious. We are happy to help ๐Ÿ˜„

echo shale
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!