Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
    Overview
    Quickstarts
    Customize look and feel
    Collect additional information
      Collect physical addresses
      Charge for shipping
      Collect phone numbers
      Add custom fields
      Collect consent for promotional emails
    Collect taxes
    Dynamically update checkout
    Manage your product catalog
    Subscriptions
    Manage payment methods
    Let customers pay in their local currency
    Add discounts, upsells, and optional items
    Set up future payments
    Save payment details during payment
    Manually approve payments on your server
    After the payment
    Elements with Checkout Sessions API beta changelog
    Migrate from legacy Checkout
    Migrate Checkout to use Prices
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsBuild a checkout pageCollect additional information

Collect physical addresses

Learn how to collect billing and shipping addresses.

Copy page

Collect a billing address

By default, a Checkout Session only collects a customer’s billing address when necessary (for example, to calculate tax). To always collect a billing address, set billing_address_collection to required when you create a Checkout Session.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d billing_address_collection=required \ -d "automatic_tax[enabled]"=true \ -d mode=payment \ --data-urlencode success_url="https://example.com/success"

Collect a shipping address

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.

Command Line
cURL
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d billing_address_collection=required \ -d "shipping_address_collection[allowed_countries][]"=US \ -d "shipping_address_collection[allowed_countries][]"=CA \ -d "automatic_tax[enabled]"=true \ -d mode=payment \ --data-urlencode success_url="https://example.com/success"

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.

See also

  • Charge for shipping
  • Collect phone numbers
Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc