Why am I not seeing all of the discounts on the subscription_discount table?
It appears that certain discounts that our users have used for their subscription do not appear in the subscription_discount table.
As per Stripe's API documents, we only get the current discount of every object in the subscription. Stripe does not provide APIs to pull historical discounts applied on a particular subscription. Thus any previous discounts would be missing.
An example of this would be cus_xxxxx, who has redeemed 2 coupons.
- Coupon ID 12345: For a 3-month free period, which they have had (this can be seen in the invoice_discount table)
- Coupon ID abcde: For a 2-month free period, of which their first month is currently active.
In the subscription_discount table, I only see an entry for the last discount period, which was activated with the coupon code abcde.
If your connector was created on
Dec 2019 but the subscription discount of coupon with ID 12345 is for
July 2019.This is why you do not see this discount in the subscription_discount table and only the most current discount, abcde.
In this case, you need to gather the details from the invoice_discount table, which does store the historical information for discounts.