Collect an address
To collect a customer’s billing address in a checkout session, pass the
billing_address_collection parameter when you create a Checkout session. You have to specify whether to always collect the billing address (
required) or only when it’s necessary (like for tax calculations) (
To collect a customer’s shipping address in Checkout, pass the
shipping_address_collection parameter when you create a Checkout session.
When you collect a shipping address, you must also specify which countries to allow shipping to. Configure the
allowed_countries property with an array of two-letter ISO country codes.
When the customer completes the session, the Checkout session object saves the collected shipping address on the
shipping_details property and includes it in the payload of the
checkout.session.completed webhook. You can also see shipping information in the Dashboard on the payment details page.
Collect a phone number
To collect a customer’s phone number in a checkout session, pass the
phone_number_collection parameter when you create a Checkout session.