Docs

Log into read the version of docs relevant to your site.

How to retrieve a coupon Id from the subscription_created webhook event?

Problem Statement

You want to retrieve the coupon ID from the subscription_created webhook event.

Solution

In the subscription_created event, the coupon ID can be found as the entity_id under invoice >> discounts. Here's a sample for your reference.

"discounts": [{ "object": "discount", "entity_type": "document_level_coupon", "description": "$50 off", "amount": 5000, **"entity_id": "$50OFF"** }]

Was this article helpful?