This component is deprecated. See below for guidance about what to use instead.
Payment Form: Cookbook

Programmatically Register Multiple Domains for Apple Pay


The "Square Payment Form" is deprecated. Please use the Web Payments SDK to take payments on a web client.

Enable Apple Pay in multiple domains by registering domains programmatically with Square.

Before you start Permalink Get a link to this section

Programmatically register multiple domains Permalink Get a link to this section

You can use the RegisterDomain endpoint to activate multiple domains and subdomains.

Bulk registering domains can save you time if you are using SqPaymentForm as part of a platform where payments are processed on multiple subdomains. For example, you might be building a shop platform (, where sellers can create their own shops and take payments ( and All these individual subdomains need to be registered to enable Web Apple Pay with Square.

To programmatically register a client domain:

  1. Download Square's copy of Apple's merchant domain verification file.

  2. Host the verification file at: https://{CLIENT DOMAIN}/.well-known/apple-developer-merchantid-domain-association.

  3. Use the RegisterDomain endpoint of the Square Apple Pay API to register and validate the domain.

The following example registers

Register Domain
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
curl \
  -X POST \
  -H 'Square-Version: 2021-05-13' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "domain_name": ""

The response JSON:

  "status": "VERIFIED"