#shawon3719
1 messages ยท Page 1 of 1 (latest)
Which object(s) are you working with? An Invoice (in_xx) or a Payment Intent (pi_xxx)?
I've created a subscription. On my app, there's a process called download invoice. So I need the downloadable link. I've the invoice ID
Before confirming payment it gives me an invoice/receipt link. But is there anything that I can get that link anytime?
You can use the hosted_invoice_url field, which will take them to the HIP where they can pay and/or download the invoice/receipt PDFs: https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Otherwise, this field is just a direct URL to the invoice PDF: https://stripe.com/docs/api/invoices/object#invoice_object-invoice_pdf
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
not clear,
What's not clear? Have you tried using either of those fields? Do they not fulfil your needs?
Should I retrieve the invoice to get that link? As it's create automatically during a subscription creation
Yes, if you have the in_xxx ID
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok, let me try
Otherwise you can expand the latest_invoice field when creating the Subscription: https://stripe.com/docs/api/subscriptions/object#subscription_object-latest_invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And all those fields will be returned on create
Not on the Invoice object, no