Collect customer names
Collect business and individual names as first-class fields on Checkout.
You can enable name collection on the payment form to collect business or individual names from your customers. The information is available after the session is complete.
These first-class names are separate from the names collected within billing and shipping information, and always appear as top-level name fields on the payment form if enabled.
Checkout adds top-level name fields to the payment form within contact details.
Enable name collection
Create a Checkout Session while specifying name collection settings. To enable name collection, configure the name_collection object when creating a Checkout Session. You can collect business names, individual names, or both, and set each field as either required or optional based on your needs.
Command Line
Select a language
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
Note
When you set business name collection to required, express checkout and one-click buttons, such as Apple Pay, move to the bottom of the payment form or are disabled.
Retrieve the collected names
After the session, you can retrieve customers’ business or individual names from the resulting Account or Customer object, or from the Checkout Session object:
On the customer
Checkout saves collected names in the Account object’s identity.business_details.registered_name or display_name property.
You can access the names programmatically by either retrieving the Account object or listening for the v2.core.account.created webhook event.
{
"id": "acct_1Nv0FGQ9RKHgCVdK",
"object": "v2.core.account",
"applied_configurations": [
"customer",
"merchant"
],
"configuration": {
"customer": {},
"merchant": {}
},
...
"identity": {
"business_details": {
"registered_name": "Stripe, Inc.",
}
},
...
"display_name": "Jenny Rosen"
}
You can also view the customer names in the Dashboard.
On the Checkout Session
The customer’s names are also saved in the collected_information and customer_details hash of the Checkout Session object, under:
- collected_information.business_name and collected_information.individual_name
- customer_details.business_name and customer_details.individual_name
{
"object": {
"id": "cs_test_a1dJwt0TCJTBsDkbK7RcoyJ91vJxe2Y",
"object": "checkout.session",
...
"collected_information": {
"business_name": "Stripe, Inc.",
"individual_name": "Jenny Rosen"
},
...
"customer": "cus_id_of_new_customer",
"customer_details": {
...
"business_name": "Stripe, Inc.",
"individual_name": "Jenny Rosen",
"name": "Stripe, Inc."
},
...
}
}
After each successful Checkout Session, Stripe sends the checkout.session.completed event containing the Checkout Session object and collected values, which you can listen for in a webhook.
