# Collect customer names Collect business and individual names as first-class fields on Checkout. # Full hosted page > This is a Full hosted page for when payment-ui is stripe-hosted. View the full page at https://docs.stripe.com/payments/checkout/name-collection?payment-ui=stripe-hosted. 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* (First-class fields are prominent input fields that appear at the top level of the payment form and API, rather than being grouped within other sections such as billing or shipping details) 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. ![First-class name fields in the embedded form](https://b.stripecdn.com/docs-statics-srv/assets/preview.d9469cc97e1794c04837c664c0cda4bb.png) 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](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-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. ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "<>:" \ -d mode=payment \ --data-urlencode "success_url=https://example.com/success" \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1" \ -d "name_collection[business][enabled]=true" \ -d "name_collection[individual][enabled]=true" \ -d "name_collection[individual][optional]=true" ``` > 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](https://docs.stripe.com/api/v2/core/accounts/object.md) or [Customer](https://docs.stripe.com/api/customers/object.md) object, or from the *Checkout Session* (A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. After a successful payment, the Checkout Session contains a reference to the Customer, and either the successful PaymentIntent or an active Subscription) object: ### On the customer #### Accounts v2 Checkout saves collected names in the `Account` object’s [identity.business_details.registered_name](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-identity-business_details-registered_name) or [display_name](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-display_name) property. You can access the names programmatically by either [retrieving the Account object](https://docs.stripe.com/api/v2/core/accounts/retrieve.md) or listening for the [v2.core.account.created](https://docs.stripe.com/api/v2/core/events/event-types.md#v2_event_types-v2.core.account.created) *webhook event* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests). ```json { "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" } ``` #### Customers v1 Checkout saves collected names in the `Customer` object’s [business_name](https://docs.stripe.com/api/customers/object.md#customer_object-business_name) or [individual_name](https://docs.stripe.com/api/customers/object.md#customer_object-individual_name) property. You can access the names programmatically by either [retrieving the Customer object](https://docs.stripe.com/api/customers/retrieve.md), or listening for the [customer.created](https://docs.stripe.com/api/events/types.md#event_types-customer.created) *webhook event* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests). The Customer object’s [name](https://docs.stripe.com/api/customers/object.md#customer_object-name) is also set to the `business_name` or `individual_name`, in that order. ```json { "object": { "id": "cus_HQmikpKnGHkNwW", "object": "customer", ... "name": "Stripe, Inc.""business_name": "Stripe, Inc." ..."individual_name": "Jenny Rosen" ... } } ``` You can also view the customer names in the [Dashboard](https://dashboard.stripe.com/customers). ### 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](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-business_name) and [collected_information.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-individual_name) - [customer_details.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-business_name) and [customer_details.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-individual_name) ```json { "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](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) event containing the Checkout Session object and collected values, which you can listen for in a *webhook* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests). # Full embedded page > This is a Full embedded page for when payment-ui is embedded-page. View the full page at https://docs.stripe.com/payments/checkout/name-collection?payment-ui=embedded-page. 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* (First-class fields are prominent input fields that appear at the top level of the payment form and API, rather than being grouped within other sections such as billing or shipping details) 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. ![First-class name fields in the embedded form](https://b.stripecdn.com/docs-statics-srv/assets/preview.d9469cc97e1794c04837c664c0cda4bb.png) 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](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-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. ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "<>:" \ -d mode=payment \ --data-urlencode "return_url=https://example.com/return" \ -d ui_mode=embedded_page \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1" \ -d "name_collection[business][enabled]=true" \ -d "name_collection[individual][enabled]=true" \ -d "name_collection[individual][optional]=true" ``` > 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](https://docs.stripe.com/api/v2/core/accounts/object.md) or [Customer](https://docs.stripe.com/api/customers/object.md) object, or from the *Checkout Session* (A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. After a successful payment, the Checkout Session contains a reference to the Customer, and either the successful PaymentIntent or an active Subscription) object: ### On the customer #### Accounts v2 Checkout saves collected names in the `Account` object’s [identity.business_details.registered_name](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-identity-business_details-registered_name) or [display_name](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-display_name) property. You can access the names programmatically by either [retrieving the Account object](https://docs.stripe.com/api/v2/core/accounts/retrieve.md) or listening for the [v2.core.account.created](https://docs.stripe.com/api/v2/core/events/event-types.md#v2_event_types-v2.core.account.created) *webhook event* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests). ```json { "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" } ``` #### Customers v1 Checkout saves collected names in the `Customer` object’s [business_name](https://docs.stripe.com/api/customers/object.md#customer_object-business_name) or [individual_name](https://docs.stripe.com/api/customers/object.md#customer_object-individual_name) property. You can access the names programmatically by either [retrieving the Customer object](https://docs.stripe.com/api/customers/retrieve.md), or listening for the [customer.created](https://docs.stripe.com/api/events/types.md#event_types-customer.created) *webhook event* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests). The Customer object’s [name](https://docs.stripe.com/api/customers/object.md#customer_object-name) is also set to the `business_name` or `individual_name`, in that order. ```json { "object": { "id": "cus_HQmikpKnGHkNwW", "object": "customer", ... "name": "Stripe, Inc.""business_name": "Stripe, Inc." ..."individual_name": "Jenny Rosen" ... } } ``` You can also view the customer names in the [Dashboard](https://dashboard.stripe.com/customers). ### 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](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-business_name) and [collected_information.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-individual_name) - [customer_details.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-business_name) and [customer_details.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-individual_name) ```json { "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](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) event containing the Checkout Session object and collected values, which you can listen for in a *webhook* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests).