#leanvitale_api

1 messages ¡ Page 1 of 1 (latest)

regal lionBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1296775417021333546

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

paper zinc
#

Invoices passes from draft to open to paid

#

Can you share an invoice Id to udnerstand how are you integrating invoice exactly ?

elfin wasp
#

Sure, v

#

in_1QBCvDIgOV9hDoPXBfoF9rkO

#

I try to apply this code when the invoice is created:
const resp = await this.stripeAccount.invoices.update(invoiceID, {
discounts: [{ coupon: 'DexDrzp7' }],
})

#

And the API return:
StripeInvalidRequestError: Paid invoices can't be updated

paper zinc
#

Ah I see, this is an invoice generated from a Subscription

#

it's the first invoice so it's immediatly paid

#

you need to pass the discount at the same request that creates the Susbcription

elfin wasp
#

Ah oka!

#

And how can I advance the time to force this subscription to be charged again?

paper zinc
elfin wasp
#

Thanks!!