#dughall
1 messages ยท Page 1 of 1 (latest)
Good question, checking in to this. Is this a situation where there is info that you don't know until after the subscription payment succeeds? Or is this about subscriptions that already exist right now?
The subscription will be created once the checkout succeeds, the custom fields I need to add the the invoice are standard things that will be the same for all invoices.
If they are static for every invoice, is there a sreason that they can't be added to your account's invoice template?
So if I add that information to invoice template does that mean all emails generated by subscription invoices will use that template?
They should as far as I know
Unfortunately stripe doesn't seem to send invoices in test mode when a subscription checkout succeeds so no way to test it ๐ฆ
Yeah in test mode we restrict the emails that we send so that we don't spam people with them. We do send some emails if you provide the exact email that you use to log in to the account, but I forget if invoice emails are one of them.
That being said, you can send one-off emails and view the invoice PDFs in test mode
You can do this from the invoice's page in your dashboard: https://dashboard.stripe.com/test/invoices/in_12345
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It's not, I tried ๐ฆ
Or you can go to the URLs from the invoice object in your browser
https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
I will give it a try with the templates. I wasn't sure if those apply to all invoices or you have to pick them somehow manually and there is no option right now to pick a template for a subscription invoice on creation.
Apologies, I did not realize that multiple invoice templates were a thing. There at least was a time when there was just one for the whole account. Looking further in to this and will get back to you.
Thank you I appreciate it.
Ah I see, the invoice template functionality in the dashboard is different from what I was thinking of. Is this info that you can include as your defauly memo and/or footer
?
Because in that case that is an account-wide setting that you can do without invoice templates
Needs to be in the same spot you add custom invoice fields from the templates, right under company name.
Like this
Had to remove for doxxing reasons ๐
Do you know how you set that? That doesn't look like something that is set by the invoice templates that I see in the dashboard, for me it was only showing the ability to group line items.
Apologies, I know API settings but not a ton about how we actually render the PDFs
Here
Custom fields
Same as the API setting that is allowed only for one time payment
So you don't think there is a way to template that information for all invoices? A bit of a dealbreaker unfortunately.
I must think of a different way to send a correct invoice in email instead of the one generated automatically by stripe. Maybe a webhook event that sends the correct invoice format.
Ah, it looks like custom fields aren't settable account-wide or through Checkout, but you can set them on Customer objects https://stripe.com/docs/invoicing/customize#custom-field-inheritance
So if you set those fields on the Customer object, they should also go on subscription invoices
So when I create a customer I add these fields and they will be added in all invoices
That's some good stuff
I am 99% sure, testing this now
Okay, please let me know what happens
It works!
That's amazing, I owe you a big one
And then one last note is that it looks like you can set the memo from the create Checkout Session call but not other invoice fields https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-description
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Happy I could help!
Really big help, thanks a lot