#thereallyrealgotti
1 messages · Page 1 of 1 (latest)
Hi there, so you want your customer to pay the outstanding invoices, is this the correct understanding?
If a plan isn't currently active, I want the client to pay his subscription, and then receive a subscrition number, so I can store it for further ado.
*for future use... (Sorry, english isn't my first language, I misused "further ado"...)
No worries. You can get subscription's latest invoice, and send your customer to the hosted_invoice_url (https://stripe.com/docs/api/invoices/object?lang=python#invoice_object-hosted_invoice_url) where they can make a payment.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay, let me get this straight.
I can bill using Invoice.create. It will give me, in the response, the subscription number in "subscription", which I can in turn put in my database. If it's not paid, which it probably won't, it will give me hosted_invoice_url, so I can redirect the person to this webpage. Am I right, so far?
hosted_invoice_url will always be present regardless whether it's paid. In order to check whether the invoice is paid, you'd need to check invoice status (https://stripe.com/docs/api/invoices/object#invoice_object-status) or listen to invoice.paid event in your Webhook (https://stripe.com/docs/billing/subscriptions/webhooks#active-subscriptions)
Or I can just check if the subscription is active with the number it’ll give in invoice create? With retrieve subscription?
The subscription doesn't set to canceled or unpaid immediately if the invoice is not paid. The subscription status depends on your Manage failed payments setting in the Dashboard: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
In general, we'd recommend to check the status of latest_invoice to check whether it's paid. The subscription will only change based on your subscription settings in the Dashboard
I see. Food for my dreams… Time to go to sleep… thanks for your help, it’s very appreciated. I’ll open a new thread, if I need anymore help in that matter, after testing tomorrow… thanks again… ☺️