#abdhesh-rajput_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
What is the issue here? I can see that the one-time price using add_invoice_item has been paid successfully in https://dashboard.stripe.com/test/invoices/in_1P0jFtCz4DYWbcETDFizlQOA
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
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?
yes
Here's the guide on you can do it: https://docs.stripe.com/billing/invoices/subscription#adding-draft-invoice-items
To put it simply, after the trial ends, a new invoice will be created with draft status. Before the invoice is finalised, an one-time price can be added to the invoice. Alternatively, you can add pending invoice item to the customer before the trial ends
So i need to create invoice after the subscrioption trial is ended ???
No. The invoice will be created automatically. The steps will be:
- After the trial ends, an invoice with
draftstatus will be created automatically. Stripe will sendinvoice.createdevent to your Webhook endpoint - While the invoice is in
draftstatus, add one-time invoice item to the invoice created in Step 1 upon receivinginvoice.createdevent
is there any other way i can do while creating stripe subscription ???
Another alternative is to:
- Create a subscription with trial
- After the first $0 invoice is created, add a pending invoice item to the customer: https://docs.stripe.com/api/invoiceitems/create
- When the trial ends, the new invoice will include the pending invoice item on the customer and charge with it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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???