#abdhesh-rajput_api

1 messages ¡ Page 1 of 1 (latest)

hushed solarBOT
#

👋 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/1224578561101402202

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

upbeat havenBOT
burnt junco
frozen shard
#

but i want add_invoice_item paid successfully if my subscription trial is ended.
or in other words when my stripe subscription trial ended then i want add_invoice_item sucessfully

burnt junco
#

Do you mean that you only want the customer to be charged with one-time price only after trial ends, but not when they sign up?

burnt junco
frozen shard
#

So i need to create invoice after the subscrioption trial is ended ???

burnt junco
#

No. The invoice will be created automatically. The steps will be:

  1. After the trial ends, an invoice with draft status will be created automatically. Stripe will send invoice.created event to your Webhook endpoint
  2. While the invoice is in draft status, add one-time invoice item to the invoice created in Step 1 upon receiving invoice.created event
frozen shard
#

is there any other way i can do while creating stripe subscription ???

burnt junco
#

Another alternative is to:

  1. Create a subscription with trial
  2. After the first $0 invoice is created, add a pending invoice item to the customer: https://docs.stripe.com/api/invoiceitems/create
  3. When the trial ends, the new invoice will include the pending invoice item on the customer and charge with it
frozen shard
#

so after creating subscription webhook **invoice.created ** is created. after listing to invoice.created i need to create then i need to another invoice with pending status.
is this approach right???