#ledevfoufoufou
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ledevfoufoufou, 33 minutes ago, 25 messages
- ledevfoufoufou, 22 hours ago, 21 messages
Hi ๐ I'm going to need more context on what you're referring to.
Hi, I try to add coupon or discount_id to latest invoice to a subscription because the amount of first invoice is false
but response is invalid array
is it because the invoice is finalized ?
You shouldn't get an invalid array error because the Invoice is finalized, that error typically indicates the structure of the content of your request is not correct.
However, if the Invoice is finalized, then you're correct that you won't be able to apply a coupon or discount to it.
Why the invoice is finalized ? the subscription has incomplete status ?
the elements form are not submit
The Invoices created by Subscription are typically automatically advanced through their lifecycle if not intervened with.
Since you mentioned the Subscription is in an incomplete status, I'm guessing that you're referring to the first Invoice created by a Subscription?
Can you share the ID of the Invoice from your testing, that will help give me a better understanding of what you're doing?
in_1O8NAQJsUJztFB3FCe3ZvnIf
there is a initial coupon when the invoice is create. Because the first month is free. But I want change the coupon.
when I change on subscription the next invoice is true with the good amount, but the first invoice not change
Yup, that's expected. The first Invoice of a Subscription is automatically finalized when the Subscription is created. So the Invoice you're referring to isn't expected to pick up the change to the Subscription's coupon that you're making, that is only expected to apply to Invoices created in the future.
Taking a step back, what is your desired flow here?
Like it sounds like you're creating a Subscription with a Coupon, deciding that is not correct, then trying to adjust the Invoice that was created when the Subscription was created. If it's the first Invoice for a Subscription, it may be easiest to void the Invoice, cancel the Subscription, and create a new one without the Coupon.
existing a method to finalize invoice only when the subscription status return succeeded ?
maybe a parameter when I create subscription
Nope, it's not possible to process a payment for an Invoice before they're finalized, which is why they immediately finalize when creating Subscriptions.
If I cancel the subscription, do I absolutely have to cancel the invoice?
and create a new stripe.elements({clientScret}) ?
You don't have to, but if you're not going to process a payment for the Invoice then it may be smoother to void it so you don't have to worry about it accidentally getting paid later (through something like the Customer Portal).
is it possible to void invoice and create a new invoice with customer_id and subscription_id ?
Yes, you can create Invoice Items for a specific Subscription:
https://stripe.com/docs/api/invoiceitems/object#invoiceitem_object-subscription
Then when creating an Invoice you can also use the subscription parameter there so the Invoice only pulls in pending invoice items associated with that specific Subscription:
https://stripe.com/docs/api/invoices/create#create_invoice-subscription
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.
void the invoice, cancel the subscription
Was there a question that you were trying to ask with your most recent message?