#Jonecon
1 messages ยท Page 1 of 1 (latest)
@fervent hull let's chat here!
For context: We are trying to integrate the payment element, which requires a payment intent to be made at the start of the transaction, but in our flow a user is able to apply a discount code at any time.
๐ Taking over this thread
If the current invoice is already finalised and paid, then coupon won't be applied in the current invoice and will only be applied to the next one
You may use credit notes for discounts if the invoice is already finalised: https://stripe.com/docs/invoicing/dashboard/credit-notes
Ok and I can see that when a subscription creates an invoice its set to finalised instantly.
Is there any way to stop that behaviour or is credit notes the recommended route here?
Can you share the invoice ID (in_xxx) that is finalised immediately?
If the invoice is the first one of the subscription, it will be finalised immediately.
If the invoice is the recurring one, then it will be in draft status for an hour when your Webhook server returns 200 for invoice.created event: https://stripe.com/docs/billing/subscriptions/webhooks#successful-invoice-finalization
Regardless which one, the invoice will be finalised automatically
Sorry was doing a transaction for an new ID
Do you still need that ID? So no way to keep this invoice in draft for longer on the initial subscription? Keep in mind this is before the user has confirmed purchase, like while they're still setting up payment information.
That won't be possible if the collection_method is set to charge_automatically, first invoice will always be finalised immediately. Alternatively, you can only create subscription when coupon is collected from the customer; or apply credit invoice on the finalised invoice
Ok, thank you for the help ๐