#amanda688_best-practices
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- amanda688_best-practices, 44 minutes ago, 13 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255605032896954368
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello
Hi -- my other thread closed before I had a chance to discuss with the client and get back to it. I'm looking for any way to get a custom field on the FIRST invoice of a subscription without converting all our payment links/checkouts to API-driven
I can update objects via API, np, but the client wants to use the Dashboard to configure their checkouts
Yeah that's not possible.
You can't set custom fields for Invoices generated by a Subscription without updating the Invoices themselves via the API when they are in draft and the initial Invoice for a Subscription never has a draft period -- it is finalized immediately.
hmm, ok, and you can't regenerate the invoice, and you can't update the Customer object's invoice settings before the first invoice gets created
Ah! Sorry
I forgot about custom_fields on the Customer
That should certainly work as long as you set that prior to creating the Subscription
However, are you using Stripe Checkout here?
And attempting to collect these custom fields during the Checkout Session?
I'm using the checkout configured by the client via the Stripe UI. They don't want to use API-driven checkouts for most cases.
Oh right you said Payment Links
You can configure custom fields to collect in there, but I'm listening for the checkout.session.completed webhook, and immediately setting the Customer's invoice_settings.custom_fields to the data collected, but it appears that the first invoice is created before it gets updated.
Yes that's correct
Every other invoice works as expected
The first Invoice is created/finalized as soon as the Checkout Session is created
And if I'm understanding timing correctly, I guess I can't hook into the Checkout Session being created, because the user may not have filled in the field yet, is that correct?
Yeah you can't influence the Checkout Session at all
and I see that the Payment Link object also has invoice_creation.custom_fields but I think I run into the same issue, because I need the value for the field from the customer ๐คช
Correct you would need it ahead of time
hrm, I think I'm stuck then ๐
So there is one workaround
But
It won't look like your customer is buying a Subscription
So what you would do is create a one-time payment and use invoice_creation.invoice_data.custom_fields to set custom fields on that initial Invoice. You would also save the collected PaymentMethod for future use and then when you receive the Webhook for a successful payment you then create the Subscription with a trial period until the next desired billing time (and set the relevant custom_fields for that as well)
hmm, ok, it's good to know that that exists, but I worry a little bit about what language there might be on the checkout page surrounding a 1-time-payment
Yep would be a bit confusing as won't look like a Subscription
You could add some custom stuff perhaps to clarify that
yeah, that probably would not work for our clients ๐ซ
But overall that is the only workaround I can think of
I appreciate the help trying to figure this out
I think for now I'm just to tell them that we can't do it ๐
Yeah sorry can't think of any way to accomplish this