#KarlS-Invoice
1 messages · Page 1 of 1 (latest)
It came through...
The other question: with invoices how do you discount with a PROMO code?
*with invoice items
I can only see that you can discount with a Coupon.
so you want to apply coupons to a specific set of products in the invoice?
Well, I'm confused because I was use to applying PROMO codes to subscriptions.
I don't see the equivalence with Invoice Items. I get that you have to discount the Invoice Item. I don't see a way to discount at the Invoice level.
Hmm, maybe you can tell me what you want to achieve with coupon?
That is just it, that is the confusion! With an invoice item, is the only way to offer a customer a discount with a Coupon or can you also .... WAIT .... THINKING ....
This article worth a read https://stripe.com/docs/billing/subscriptions/coupons
OK, but Subscriptions is not correct. I'm charging for Products, one-time paid.
What are Promotion Codes used for and can my customers use them when they pay for one-time products?
(not subscriptions)
Well you can apply coupon in many levels, such as customer, subscription, invoice and even invoice items.
OK, I didn't see where you can apply it on an invoice. Can you shed some light on this?
never mind. i found it.
Sure, https://stripe.com/docs/billing/subscriptions/coupons this doc a good starting point
For the record: I see no way to process or redeem a Promotion code, only a Coupon when processing discounts on invoices and invoice items. I wish you would verfiy that.
The difference between coupon and promo code is that coupon is merchant-facing, whereas promo-code is customer-facing.
So what's your use case here? you want your customer to enter a promo code when renewing the subscription?
Yes, I want my customer to enter a promo code, but not for a subscription, for their invoice that they are paying.
I see, I'm afraid the the hosted invoice page doesn't accept promo code.
I'm in the API and am not finding support for it either.
Ok, let me rephrase, you can add a coupon when creating an invoice and that discount will be automatically applied to the invoice. However, the invoice page doesn't support promo code, so that your customer can't enter a promo code in the invoice page to enjoy a discount.
Right, nor can you programmitically with the API apply a PROMO code anywhere for an invoice.
Actually you can, see https://stripe.com/docs/api/invoices/update#update_invoice-discounts-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I mean you can apply coupon to invoice.
Promo code is customer-facing, something that you customer need to input.
so the only thing you can do with the PROMO code is use it on the backend to find the COUPON code which you then use to discount the invoice.
Hmm, I'll say using coupon to apply discount to invoice.
see there difference with Subscriptions? Here it is:
SubscriptionCreateOptions.PromotionCode = <promotion code id>
you can also apply coupon to subscription https://stripe.com/docs/api/subscriptions/create#create_subscription-coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes! I'm just pointing out the differences is all. I am now resolving a PROMO code to a COUPON in my backend and applying to the invoice.
Thanks!
Cool! happy to help
Sure thing
Can you show me the code?
its a lot of code.
the relevant code will do
Walk me through with an example if you can
yep, hold on.
see this invoice in_1Kg1a5G30Vl6ne6Nuzvsd4yR
(assuming you are the only one who can see this, it is in test, but like the names are real)
Only Stripe engineers can see, so don't worry
i thought so
so I had something in my code that was throwing an exception.
after a couple of tries at fixing it, I got it fixed and on my last try the Payment was received and processed. well and you can see that the invoice line items were in multiples!
expecting..
in_1Kg1eyG30Vl6ne6NFHlvAMIi
OK, so your code added multiple invoice items but it suppose to add one item only, am I right?
yes. like i said, I was debugging something that was broke and on the 4th or 5th try it went through... is there a way to prevent these invoices drafts from lingering?
ok, I'd suggest you to finalize the invoice once you have added the item, so that this invoice cannot be changed anymore.
ok... how about if there is an unhandled code exception, can I invoke some sort of destroy or terminate on the invoice that is not yet finalized?
what kind of exception?
anything... even my own exception, so not stripe related.
I see a need to abandon any outstanding invoices at this point
You can use this API to delete a draft invoice https://stripe.com/docs/api/invoices/delete
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I'm able to reproduce the problem