In the Stripe Dashboard, a payment shows the original price and the price after a coupon was applied (including the Coupon id) under the "items" secion. However, when retrieving a payment via the API, there is no information about the applied discounts/coupons or the original price.
How can I check if a payment was done using a coupon code in the Stripe API?
The payment object doesn't seem to have any information on that. I'm referring to one-off payments, not subscriptions, where I get the coupon used in the invoice object.
In the Stripe Dashboard, a payment shows the original price and the price after a coupon was applied (including the Coupon id) under the "items" secion. However, when retrieving a payment via the API, there is no information about the applied discounts/coupons or the original price.
How can I check if a payment was done using a coupon code in the Stripe API?
The payment object doesn't seem to have any information on that. I'm referring to one-off payments, not subscriptions, where I get the coupon used in the invoice object.
You can find the applied coupons/discounts at the invoice Object level[1]. If there are many, you can expand[2] the discounts
field[3].
[1] https://docs.stripe.com/api/invoices/object#invoice_object-discount [2] https://docs.stripe.com/api/expanding_objects [3] https://docs.stripe.com/api/invoices/object#invoice_object-discounts