#nesh_invoice-pdf
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/1296505238983016448
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
nesh_invoice-pdf
@young scarab If you are using Checkout in mode: 'subscription' then you can't modify that Invoice, it's finalized, generated and sent before the Checkout Session completes.
What you can do is create a Customer first and set the right information inside invoice_settings[custom_fields] which should then reflect on that Subscription's Invoices
Yes I'm using subscription mode in checkout session.
Not sure if I understood your idea, but if it's on customer level for all invoices it won't work, since one customer can have multiple products subscribed to, each of them need to have different IDs on the invoices
Then that's sadly impossible right now. You could cheat and set it, go through Checkout, have it apply to the first Invoice and then unset it (and later update each Invoice)
But no other way sadly
sorry, I still don't get it. How to apply it to the first invoice and then unset it, and then update to each invoice.
I'm creating checkout session URL for each product separately with API and providing a link to user for a particular product. Where/how can I apply custom field to "first" invoice ?
I'm ok with workarounds, just don't understand your idea still
- Create a Customer and set the right
invoice_settings[custom_fields] - Create a Checkout Session
- Wait for the Checkout Session to complete, it will have the right
custom_fieldson the first Invoice - Unset
invoice_settings[custom_fields]on the Customer so that future Invoices don't have it - Listen for
invoice.createdfor future Invoices and set the relevantcustom_fieldseach time
I see, but the issue is that once invoice.created happend, invoice is not allowed to be edited at that moment, since it's status is not "draft"
therefore, step 5 is problematic, if that was possible I could listen for invoice.created event right away on very first one
sure, #5 is for future Invoices, Steps #1 through #4 are for the first Invoice
okay, but for future invoices as well, if I listen for invoice.created event and try to update it I receive this error
that error is about the Invoice being finalized though. Future Invoices that are related to a Subscription are not finalized instantly.
okay sorry, then I need to double check that. Is there a way I can continue this thread after I do my testing again and don't manage to accomplish the goal ?
we close threads quickly but you can start a new thread with your new question