#ledevfoufoufou

1 messages ยท Page 1 of 1 (latest)

compact pollenBOT
#

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.

noble steeple
#

Hi ๐Ÿ‘‹ I'm going to need more context on what you're referring to.

cinder geode
#

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 ?

noble steeple
#

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.

cinder geode
#

Why the invoice is finalized ? the subscription has incomplete status ?

#

the elements form are not submit

noble steeple
#

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?

cinder geode
#

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

noble steeple
#

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.

cinder geode
#

existing a method to finalize invoice only when the subscription status return succeeded ?

#

maybe a parameter when I create subscription

noble steeple
#

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.

cinder geode
#

If I cancel the subscription, do I absolutely have to cancel the invoice?

#

and create a new stripe.elements({clientScret}) ?

noble steeple
#

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).

cinder geode
#

is it possible to void invoice and create a new invoice with customer_id and subscription_id ?

noble steeple
#

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

cinder geode
#

void the invoice, cancel the subscription

noble steeple
#

Was there a question that you were trying to ask with your most recent message?