Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer tools
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
Build an advanced integration
Build an in-app integration
Payment methods
Add payment methods
Manage payment methods
    Payment method support
    Payment method support for platforms and marketplaces
    Register payment method domains
    Dynamic payment methods
    Dynamic payment methods
    A/B testing payment methods
    Payment method rules
    Payment method configurations
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
HomePaymentsManage payment methods

Register domains for payment methods

Register domains to use payment methods (including Link, Apple Pay, and Google Pay) in Elements or Checkout's embeddable payment form.

Copy page

For certain payment methods, you must register every web domain that shows the payment method if your integration uses Elements or Checkout’s embeddable payment form. This includes registering top-level domains and subdomains. For example, if you have the domain yourdomain.com and subdomains like shop.yourdomain.com and www.yourdomain.com, this guide explains how to register them.

After you register a domain, that domain is ready for use with other payment methods that you might enable in the future.

The following payment methods require registration:

  • Google Pay
  • Link
  • PayPal
  • Amazon Pay
  • Klarna
  • Apple Pay

Apple Pay and merchant validation

The Apple Pay documentation describes their process of “merchant validation," which Stripe handles for you behind the scenes. You don’t need to create an Apple Merchant ID or CSR. Instead, follow the steps in this guide.

Testing

You also need to register domains for testing. When testing locally, you can use a tool such as ngrok to get an HTTPS domain. You can either register in a sandbox, or register in live mode and the domain will also be registered in sandboxes automatically. Remember to register your domains in live mode before going live.

Register your domain

To register a domain, do the following:

Command Line
cURL
curl https://api.stripe.com/v1/payment_method_domains \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d domain_name="example.com"

Repeat for all domains that you need to register.

Using an iframe

  • When using an iframe, its origin must match the top-level origin, except in Safari 17+. Two pages have the same origin if the protocol, host (full domain name), and port (if specified) are the same for both pages.
  • When using a cross-origin iframe in Safari 17+ you must specify the allow=“payment” attribute. To enable Apple Pay, you must also register the source domain that the iframe loads.

Manage your domain

Using the PaymentMethodDomain API you can do the following:

  • Retrieve a domain.
  • See a list of all of your domains.
  • Enable or disable a domain. If a domain is disabled, the payment methods no longer appear in Elements or Checkout’s embeddable payment form on that domain.

This sample shows how to disable a domain:

Command Line
cURL
curl https://api.stripe.com/v1/payment_method_domains/{{PAYMENT_METHOD_DOMAIN_ID}} \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d enabled=false

Register your domain while using Connect

Connect platforms must register all domains where Elements or Checkout’s embeddable payment form displays the payment methods listed above. The domain where the charge is being run needs to be registered for the user running the charge.

If the platform creates direct charges, use your platform’s secret key to authenticate the request and set the Stripe-Account header to your connected account’s Stripe ID.

If the platform creates destination charges or separate charges and transfers, use your platform’s secret key to authenticate the request and omit the Stripe-Account header.

Learn more about Making API calls for connected accounts.

Command Line
cURL
curl https://api.stripe.com/v1/payment_method_domains \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -H "Stripe-Account:
{{CONNECTED_ACCOUNT_ID}}
"
\ -d domain_name="example.com"
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