#anzhurov
1 messages · Page 1 of 1 (latest)
You can see which promotion code was applied via the expandable discounts array on the object: https://stripe.com/docs/api/invoices/object#invoice_object-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@royal marten it doesn't help
discounts contain coupon only, not promotion code
Should be a promotion_code field on the expanded Discount object: https://stripe.com/docs/api/discounts/object#discount_object-promotion_code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
@royal marten it's null
Because I create invoice with coupon applied, not promo code
Yep, you can't create an Invoice with a promotion code directly – they're user facing
What you're trying to do doesn't make sense. A Coupon can have multiple promotion codes
I do the following
create invoice with promo code
get invoice and show use which promo code was applied to that invoice
I can do that with invoice auto-generated for subscription
I know I can't determine what promo was aplied because I pass coupon during invoice creation, but why can I pass promo directly ? @royal marten
That doesn't make sense though. How can you know which promotion code was used if one wasn't used?
Exactly, but why can't I apply promo code ? I can go with coupon only for invoice
It just doesn't work today unfortunatel
Promotion codes are using facing (i.e. your customer inputs them in your checkout flow)
Doesn't really make sense for you apply them directly on Invoice creation – that's what the Coupon is for
Ok then why I can do that for subscription ?? What the difference
Yeah, I don't know why that's supported. I guess because you're more likely to create a Subscription in a checkout flow and therefore may want to collect a promo code from your customer?
During invoice creation I also collect promo code from my customer
But in sub case I just apply that during creation
In invoice case, I have to define coupon by promo passed and then apply coupon
Isn't it strange behaviour ?
It's not strange no. It's just not supported. I'd recommend filing feedback via support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Great product