Hi there-thanks for reaching out. To know more about creating and customizing your customer's order information along with order ID check out this link here: docs.stripe.com/payments/checkout/custom-success-page and after the payment session is completed, you can retrieve the OrderID from the Checkout Session object. The OrderID can be found under the Session's 'customer_details' object.
Is there a way to add a default value for the text field? For instance if a user wants an engraving and I already know their name from my database, it would be nice if it would already be written in the text field and they could modify it later on if they wanted to
@@jsteele-stripe I use text fields and I think it would be very useful for them specifically, but It would be nice for all types of fields such as dropdowns
Would really like to know if this is possible. Case: You have 5 sales people and you want to assign a Code to them. When a person makes a sale he can ask the customer to input this code in the custom field upon checkout. This would make it possible to track how a sales person is performing.
Great question Thomas-it's currently not possible to list or filter Checkout Sessions by custom fields. Instead, you can utilize a webhook and listen for checkout.session.completed events containing the custom field data from the session upon completion/payment.
@@OliverWittmannWilsmann Nop. I ended up moving my input field to another form. I believe Stripe doesn't have an option to validate custom fields, which is a shame.
@@StripeDev Thanks. I think that shows you how to enable it on the checkout stripe page. I am wondering how you did it like you have on the front page at 2:20 in the video
Is there a way to pass custom lineitems to display as labels on each product at checkout? I already have the data collected on the site itself and I'm trying to pass it to the stripe checkout screen.
Hi Nick-from our API reference, there's a URL where you can pull a full paginated list of line items if this is what you're looking to do: docs.stripe.com/api/checkout/sessions/line_items
@@jsteele-stripe Currently it supports text, numeric and dropdown but I would like to have checkbox input field and currently it allows maximum 3 fields but more than 3 custom fields should be allowed
@@jsteele-stripe Currently don't know the use case, but in the future, for some projects, if client wants to collect information then we can handle the situation I haven't used custom fields but if we can get custom fields' value in webhook then we can perform operations based on that data
@@shailendra-zealous Yep, the `checkout.session.completed` webhook event will contain the custom fields and values entered by customers on the payment page.
Hi there, I'm trying to retrieve that custom data setup via the payment link using a webhook. I've tried using the checkout session completed event but am only getting 2 of my three custom fields? Is there a way to change that?
Hey! You'll find explanations and sample code for this in our documentation here: docs.stripe.com/payments/checkout/custom-fields#create-session. Also, the code was written using our API documentation which provides everything you need to create a checkout session: docs.stripe.com/api/checkout/sessions/create.
Hi Jose! Custom fields are not available for Payment Element. Here are the customization options for Payment Element: stripe.com/docs/payments/customize-payment-element
I don't see the custom fields in the final pdf receipt. How to do that? (I see them in the checkout session but not in the final pdf result of the receipt)
@@StripeDev What I mean is the invoice receipt. You can add there some custom fields but I don't find a way to get the values completed by the user in the checkout session and pass them to the automatically generated invoice.
Hi there-just to clarify, are you using the top-level custom_fields for Checkout (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-custom_fields), or are you using invoice_creation.invoice_data.custom_fields (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-custom_fields)? Only the latter would show up on your Invoice. Also, could you provide an example Checkout Session ID for us to review? Thank you!
Is it possible to add the custom field to existing customers to save data which was sent by them from the past via mail to have a valid database in the end?
Is there any way for a webhook to validate and possibly reject something put into the custom field? eg. if a particular size is out of stock, asking them to choose another?
Hi John! It's not possible. Are you using Checkout / Payment Links in this case? For such a scenario, you would likely want some kind of real time request to your own backend server to check on the stock availability, this isn't something which Checkout Sessions is able to provide. You can however consider manual capture and performing all of that logic validation i.e. confirming that there's sufficient stock, updating inventory before capturing the payment.
@@StripeDev ok thanks, figured as much. Just wanted to be able to use Checkout without having to recreate the interface. We'll find a workaround, thanks for the response though.
@StripeDev What can be done in a case like this where we need to validate some user input, without having to implement something like Checkout, which you guys have already done? Collecting the user input before proceeding to Checkout? Or using something more advanced like Elements?
Hey Henry-good question! It's not currently possible to add a default value for custom fields, but we very much appreciate the suggestion and will be sure to pass it along.
Hey Kashif, yes-you have the option to export multiple metadata fields in reports: support.stripe.com/questions/customizing-your-reports. If you're looking for something more specific, please let us know-we're happy to help in any way that we can.
Hello Sir, I have a question about the custom_fields. How can I show the custom_fields data in the invoice? please let me know, it will help me a lot. Thanks in advance. by the way I am using next js (API)
@@StripeDev ok so when you call our webhook, i call the stripe api to update the custom field on the invoice but the invoice is locked because it s finalized. so now i guess i need to remove the "invoice_creation.enabled" when i create the checkout sessiion in the firts place. but can i create an draft invoice on a payment later on? (then i can update it and finalize it). which routes will i use? thanks
Hi Miko-it sounds like you need to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices so you can edit it before finalization. If that's the case, you'll want to make sure you pass auto_advance=false.
@@StripeDev ok so if i create my stripe checkout session with invoice_creation[enabled]=true, i am unable at that moment to tell it to auto_advance=false. so my only option it s to create a checkout session without invoice. then i need to make several api calls after my checkout session completed webhook. first i need to retrieve line items with v1/checkout/sessions/MY-ID/line_items then i need to make another call to create a draft invoice from nothing, this is the moment when i can pass the custom field form the checkout session. then i need to make other calls to v1/invoiceitems in order to fill my invoice with the rights products and quantity... then i need to pay my invoice with v1/invoices/MY-ID/pay with paid_out_of_band=true because it cannot be linked to an existing payment intent! this is a HUGE drag. do you have another way around? thank you
Hello! I use Stripe on Shopify and need to add an information field at checkout, is the process the same? I only have products registered on Shopify and I use stripe as a Gateway, thanks in advance my friend!
Thanks for reaching out-great question! You'll want to check with Shopify on this first-since they manage the integration, they might have different options or requirements to do this. They can help you get everything sorted out!
Hey Bryan, only up to two custom fields are allowed. We're sorry about the inconvenience here, but we'll be sure to note your request for updates moving forward.
Hey there-you can follow these steps to retrieve customer information from custom fields without code: -Go to your Stripe Dashboard. -On the left menu, click on "Customers". This will open a page with a list of all your customers. -Find the customer whose information you want to retrieve and click on their name. -On the customer's page, scroll down to the "Metadata" section. In this section, you'll find the custom fields that you or your developers might have saved. If you cannot find the Metadata section, it means that no custom fields were recorded for that specific customer.
This is great news. I love how Stripe is so innovative. I am trying to retrieve the customer facing promo code 'code' (or equivalent) in a web hook but been told its not possible with one off payments with the payment intent and checkout session events... wondering if there is work around here? Could i create a hidden custom field that copies the promo code field?? Any suggestion would be appreciated.
It should be possible to do this, just in case, have you checked our API reference to ensure you're retrieving it correctly? stripe.com/docs/api/promotion_codes/retrieve.
Hi Luz-you should be able to set up trigger updates from any successful payment, including from payment links: stripe.com/docs/cli/trigger#trigger-event. Are you running into any issues with this?
Hi there-thanks for reaching out. To know more about creating and customizing your customer's order information along with order ID check out this link here: docs.stripe.com/payments/checkout/custom-success-page and after the payment session is completed, you can retrieve the OrderID from the Checkout Session object. The OrderID can be found under the Session's 'customer_details' object.
Is there a way to add a default value for the text field? For instance if a user wants an engraving and I already know their name from my database, it would be nice if it would already be written in the text field and they could modify it later on if they wanted to
Not currently supported, but this is something we're thinking about. Would you want this specifically for text fields, or other field types too?
@@jsteele-stripe I use text fields and I think it would be very useful for them specifically, but It would be nice for all types of fields such as dropdowns
@@domi564Thanks for the feedback!
Is there a way to get all payments / subscriptions, where a custom field had a specific value?
Would really like to know if this is possible. Case: You have 5 sales people and you want to assign a Code to them. When a person makes a sale he can ask the customer to input this code in the custom field upon checkout. This would make it possible to track how a sales person is performing.
Great question Thomas-it's currently not possible to list or filter Checkout Sessions by custom fields. Instead, you can utilize a webhook and listen for checkout.session.completed events containing the custom field data from the session upon completion/payment.
Is it possible to add some kind of regex to thr custom field? I wish to validate data somehow. I'm using stripe hosted page.
you managed to do it?
@@OliverWittmannWilsmann Nop. I ended up moving my input field to another form. I believe Stripe doesn't have an option to validate custom fields, which is a shame.
Thank you for this. On your index.html you have a quantity option. Do you have a video the explains how to implement that?
Hi Matthew-we have some documentation on this here: docs.stripe.com/payments/checkout/adjustable-quantity.
@@StripeDev Thanks. I think that shows you how to enable it on the checkout stripe page. I am wondering how you did it like you have on the front page at 2:20 in the video
Thanks for the specifics Matthew-that's on the front end so unfortunately we don't have that to share.
Is there a way to pass custom lineitems to display as labels on each product at checkout? I already have the data collected on the site itself and I'm trying to pass it to the stripe checkout screen.
Hi Nick-from our API reference, there's a URL where you can pull a full paginated list of line items if this is what you're looking to do: docs.stripe.com/api/checkout/sessions/line_items
Thanks
Hope there will be more custom input types in the future
Interesting. What other kind of field types would you like to see supported?
@@jsteele-stripe Currently it supports text, numeric and dropdown but I would like to have checkbox input field and currently it allows maximum 3 fields but more than 3 custom fields should be allowed
@@shailendra-zealous Got it thanks! What's the use case for more than 3 fields? We've no plans to increase the limit beyond that.
@@jsteele-stripe Currently don't know the use case, but in the future, for some projects, if client wants to collect information then we can handle the situation
I haven't used custom fields but if we can get custom fields' value in webhook then we can perform operations based on that data
@@shailendra-zealous Yep, the `checkout.session.completed` webhook event will contain the custom fields and values entered by customers on the payment page.
Hi there, I'm trying to retrieve that custom data setup via the payment link using a webhook. I've tried using the checkout session completed event but am only getting 2 of my three custom fields? Is there a way to change that?
How did you get to the code page (in the 1;44 minutes of the video)? Thanks!
Hey! You'll find explanations and sample code for this in our documentation here: docs.stripe.com/payments/checkout/custom-fields#create-session.
Also, the code was written using our API documentation which provides everything you need to create a checkout session: docs.stripe.com/api/checkout/sessions/create.
Thanks this is very helpful, is there a way to add fields also in payment element, not only in checkout.
Hi Jose! Custom fields are not available for Payment Element. Here are the customization options for Payment Element: stripe.com/docs/payments/customize-payment-element
What if a customer picks multiple shirts but all different sizes ? anyway we could map each cart item to have the pick a size dropdown?
Hi Meggs-only up to two fields are allowed for custom fields currently.
Is it possible to pre-fill custom fields from the front end?
Hi Charlie! Unfortunately it's not possible to pre-fill custom fields.
I don't see the custom fields in the final pdf receipt. How to do that? (I see them in the checkout session but not in the final pdf result of the receipt)
Hi Stefan-these custom fields aren't automatically included in the receipt. You'd need to include them in the receipts: docs.stripe.com/receipts
@@StripeDev What I mean is the invoice receipt. You can add there some custom fields but I don't find a way to get the values completed by the user in the checkout session and pass them to the automatically generated invoice.
Hi there-just to clarify, are you using the top-level custom_fields for Checkout (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-custom_fields), or are you using invoice_creation.invoice_data.custom_fields (docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-custom_fields)?
Only the latter would show up on your Invoice. Also, could you provide an example Checkout Session ID for us to review? Thank you!
Is it possible to add the custom field to existing customers to save data which was sent by them from the past via mail to have a valid database in the end?
Hey! Metadata is a better fit for this use case. Check this out: stripe.com/docs/videos/developer-foundations?video=metadata
I know this is very basic.... how do I get to the code area for stripe? I'm just not seeing where that is for my product.
Hi there-we'd recommend checking out our quickstart guide for setting up your development environment: stripe.com/docs/development/quickstart
Is there any way for a webhook to validate and possibly reject something put into the custom field? eg. if a particular size is out of stock, asking them to choose another?
Hi John! It's not possible. Are you using Checkout / Payment Links in this case? For such a scenario, you would likely want some kind of real time request to your own backend server to check on the stock availability, this isn't something which Checkout Sessions is able to provide.
You can however consider manual capture and performing all of that logic validation i.e. confirming that there's sufficient stock, updating inventory before capturing the payment.
@@StripeDev ok thanks, figured as much. Just wanted to be able to use Checkout without having to recreate the interface. We'll find a workaround, thanks for the response though.
@StripeDev What can be done in a case like this where we need to validate some user input, without having to implement something like Checkout, which you guys have already done? Collecting the user input before proceeding to Checkout? Or using something more advanced like Elements?
Hi @StripeDev there some way to add default value for a custom field ? Thanks
Hey Henry-good question! It's not currently possible to add a default value for custom fields, but we very much appreciate the suggestion and will be sure to pass it along.
Thank you@@StripeDev awesome
is there a way to export custom field data in reports???????
Hey Kashif, yes-you have the option to export multiple metadata fields in reports: support.stripe.com/questions/customizing-your-reports.
If you're looking for something more specific, please let us know-we're happy to help in any way that we can.
How can i change the ground and shape on left side
Hi Ahmed-if this is for the Stripe-hosted checkout, then unfortunately, you're unable to customize that part.
Hello Sir, I have a question about the custom_fields. How can I show the custom_fields data in the invoice? please let me know, it will help me a lot. Thanks in advance. by the way I am using next js (API)
Hi Amit! Check out the docs here for adding custom fields to invoices: docs.stripe.com/invoicing/customize#custom-fields
@@StripeDev ok so when you call our webhook, i call the stripe api to update the custom field on the invoice but the invoice is locked because it s finalized. so now i guess i need to remove the "invoice_creation.enabled" when i create the checkout sessiion in the firts place. but can i create an draft invoice on a payment later on? (then i can update it and finalize it). which routes will i use? thanks
Hi Miko-it sounds like you need to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or automatically reconciling invoices so you can edit it before finalization. If that's the case, you'll want to make sure you pass auto_advance=false.
@@StripeDev ok so if i create my stripe checkout session with invoice_creation[enabled]=true, i am unable at that moment to tell it to auto_advance=false. so my only option it s to create a checkout session without invoice. then i need to make several api calls after my checkout session completed webhook. first i need to retrieve line items with v1/checkout/sessions/MY-ID/line_items then i need to make another call to create a draft invoice from nothing, this is the moment when i can pass the custom field form the checkout session. then i need to make other calls to v1/invoiceitems in order to fill my invoice with the rights products and quantity... then i need to pay my invoice with v1/invoices/MY-ID/pay with paid_out_of_band=true because it cannot be linked to an existing payment intent! this is a HUGE drag. do you have another way around? thank you
Just what i needed thank you
Hello! I use Stripe on Shopify and need to add an information field at checkout, is the process the same? I only have products registered on Shopify and I use stripe as a Gateway, thanks in advance my friend!
Thanks for reaching out-great question! You'll want to check with Shopify on this first-since they manage the integration, they might have different options or requirements to do this. They can help you get everything sorted out!
I have been wanting to sell a product with customization in mind. How can I add more than 2 Custom Fields?
Hey Bryan, only up to two custom fields are allowed. We're sorry about the inconvenience here, but we'll be sure to note your request for updates moving forward.
We've just increased the custom fields limit to 3. Let us know if that works for you!
How can I get checkout session custom fields if I only have invoice id?
I wanted to fetch the custom fields on the backend
Hi there. You can check this documentation about customizing invoices: stripe.com/docs/invoicing/customize.a
How can I retrieve the customer's information from custom fields without code?
Hey there-you can follow these steps to retrieve customer information from custom fields without code:
-Go to your Stripe Dashboard.
-On the left menu, click on "Customers". This will open a page with a list of all your customers.
-Find the customer whose information you want to retrieve and click on their name.
-On the customer's page, scroll down to the "Metadata" section. In this section, you'll find the custom fields that you or your developers might have saved. If you cannot find the Metadata section, it means that no custom fields were recorded for that specific customer.
This is great news. I love how Stripe is so innovative. I am trying to retrieve the customer facing promo code 'code' (or equivalent) in a web hook but been told its not possible with one off payments with the payment intent and checkout session events... wondering if there is work around here? Could i create a hidden custom field that copies the promo code field?? Any suggestion would be appreciated.
It should be possible to do this, just in case, have you checked our API reference to ensure you're retrieving it correctly? stripe.com/docs/api/promotion_codes/retrieve.
thnaks for this tutorial. But to retrieve these custom values after payment
Hey Luz. Here we show how to Retrieve custom fields: stripe.com/docs/payments/checkout/custom-fields#retrieve-fields
@@StripeDev Thanks
@@StripeDev Hello. Please I follewed and create payment link but can't retrieve detail from webhook
can't we receive webhook about paymentlinks ?
Hi Luz-you should be able to set up trigger updates from any successful payment, including from payment links: stripe.com/docs/cli/trigger#trigger-event.
Are you running into any issues with this?