#pavle_invoice-template
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/1303035126501998624
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
My team won't know a ton about this since most/all of the invoice template stuff is controlled by the platform and we primarily focus on API stuff but can you share an example customer with the two invoices? One where it used the correct template and the other where it didn't
Hi hanzo yes definitely, here is an example customer: cus_R9mdVJgGTd99j4
What are the example invoice IDs?
Oh yes sorry these are the two invoices:
in_1QHT4kB8Sk5ZJAZiMTFNKFid
in_1QHT5IB8Sk5ZJAZitVvZEvQa
The customer has only one subscription with these two invoice templates
All good. Can you check the settings listed here and see if your template is configured correctly? - https://docs.stripe.com/invoicing/invoice-rendering-template?dashboard-or-api=dashboard#override-and-update-templates
It appears there is a priority order
Yes the main thing that confuses me here is why the first one is being created in our template, and the rest in Stripes default template
Without anything changing in the subscription/customer
We just "advanced time" and see that the invoice template has been changed
Its also hard to follow these priority, since some things can be done only via the Dashboard and some things only via the API
Hmm I'm seeing both the invoice use the same template underneath.
Can you share screenshots of the differences just to make sure I'm on the same page?
Sure one second
First template
Second template
The main difference is in the invoice lines, as we wanted to eliminate the "date-range" below each line
So we used CEL grouping in the first template
The second one is Stripes default invoicing template
If I dare to ask one more question I will be grateful to you indefinitely
We are also facing an issue with the finalization of the invoices, some invoices are immediately created and finalized, without the "finalization period" which we set to 4 hours
We wanted to use this time to update the subscription and/or the invoice based on the params that we have internally in our system
We noticed that the updates were being applied to the billing cycle in the future, for example a coupon for discounts:
After some investigation, we noticed that the invoice was created and immediatelly finalized for specific customers, without the finalization period. (event logs for customer cus_R7niGKjCbyCPVL)
We planned on going live about two weeks ago, and planned to use Stripe for all of our 200 customers, but we cannot proceed until we know what are our options
Thank you in advance!
pavle_invoice-template
@daring path You mentioned you used the API to assign templates. Can you share the exact code you used please?
Sure one second
const customer = await stripe.customers.create({ email: 'leon@dmaonline.de', name: 'invoice_test', address: { line1: 'Röntgenstr. 9', postal_code: '67133', city: 'MAXDORF', country: 'DE' }, invoice_settings: { rendering_options: { template: 'inrtem_1Q0BMoB8Sk5ZJAZiS98QQWCP', }, }, });
We have done this via simple node script
To create test users for us to be able to test things out
The subscription part:
const subscriptionParams = { currency: 'eur', customer: "cus_R9mdVJgGTd99j4", items: [ { "price": "price_1QFV7BB8Sk5ZJAZiU8H4lyPP", }, { "price": "price_1QA3sDB8Sk5ZJAZiNwNbI3Yx", }, { "price": "price_1QCo3TB8Sk5ZJAZiCvuKLE9G", }, ], default_tax_rates: ['txr_1PWCueB8Sk5ZJAZim2By7Jza'], payment_behavior: 'error_if_incomplete', proration_behavior: 'none', off_session: true, billing_cycle_anchor_config: { day_of_month: 1, hour: 5, minute: 0, second: 0, }, } subscriptionParams.collection_method = 'send_invoice' subscriptionParams.days_until_due = 7 subscriptionParams.payment_settings = { payment_method_types: ['customer_balance', 'card', 'giropay', 'paypal', 'sepa_debit', 'sofort'] }
Ack. Sorry that's so much context and code and I'm struggling to wrap my head around it. Invoice Templates are brand new and I've never seen anyone use them yes.
So okay, can you create a brand new Customer with the template that doesn't work and create one Subscription so I can have a look?
Yes certenly, cus_R9mdVJgGTd99j4 this is the customer I created specifically for this purpose
It has a subscription, with time advanced to December 30, 2024
It has two invoices, both with amount 0, that have 2 different templates
Why would the time advance matter exactly?
is it because of
every subsequent invoices are being created with Stripes default invoicing templates.
that you said?
Correct
Gotcha, so this looks like a real API bug unfortunately so the best approach will be to reach out to our support team for them to investigate
I have even tested it out without the time advance, it behaves the same
Oh ok thank you very much, sorry for the trouble!
I will send them an email abou this
I'll also try to reproduce and flag internally!
Thank you!
Do you have 2 more minutes to spare about the second question?
I reached to the collegues in the customer support team but did not get the response
About the finalization period
I don't really get that question either unfortunately
Thank you either way for everything!
I'm happy to answer, I just need you to be a bit more detailed about the issue