#jeremy - subscription
1 messages ยท Page 1 of 1 (latest)
req_7rFXYxUcElPPJk
Above is a request for the subscription when the discount DOES apply to the plan.
This is one where the discount DOES NOT apply to the plan: req_XEKqWjmdKvazLR
Hi there ๐ apologies for the delay, please bear with me a moment while I get caught up on the context here.
One option is to find the coupon inside of the discount hash:
https://stripe.com/docs/api/discounts/object#discount_object-coupon
And then retrieve that coupon so you can check its applies_to details to see what products the coupon applies to and whether those are on the subscription:
https://stripe.com/docs/api/coupons/object#coupon_object-applies_to
If you want to look at how much a coupon/discount impacted a previous subscription payment, then you can locate that invoice (latest_invoice on the Subscription object is a good place to start) and look into its Line Items:
https://stripe.com/docs/api/invoices/object#invoice_object-lines
These objects have a discount_amounts field where they list the amount that each discount impacted the total amount by:
https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-discount_amounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Perfect! Thank you!!!
Any time!