Check if Stripe Payment was made with a discountcoupon - Stack Overflow

admin2025-05-02  2

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.

Share Improve this question asked Jan 2 at 13:15 JonasJonas 7,91416 gold badges57 silver badges123 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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

转载请注明原文地址:http://www.anycun.com/QandA/1746118123a91918.html