# Prerequisites (Apple Pay)

Use this guide to prepare and configure Apple Pay with WHITELABEL.

- [**Apple Developer prerequisites**](#apple-pay-certificate-options): Depending on your certificate path, you may need to create a merchant ID and generate certificates/keys (Own), or register your merchant domains (WHITELABEL).
- [**WHITELABEL Dashboard setup**](#finish-in-the-dashboard): Add the Apple Pay connection, set up routing, and enable Apple Pay in Checkout Builder.

When finished, you'll be ready to [choose your integration path](#next-steps)  (SDK or Direct) for one-time and recurring payments.

## Apple Pay certificate options

In the WHITELABEL Dashboard, you will find three options for Apple Pay certificates:

- **WHITELABEL**: This option is for merchants who do not have an Apple Developer account or a mobile app (that is, they are web-only). In these cases, you must register your merchant domains in order to use WHITELABEL's certificates. [→ WHITELABEL certificates: register your merchant domains](#whitelabel-certificates-register-your-merchant-domains)
- **Own (manual)**: This option is for merchants who have an Apple Developer account and prefer to manage their own private keys. You generate and convert the certificates manually using Keychain Access and OpenSSL (Steps 2–9), then paste the PEM values into the WHITELABEL Dashboard. [→ Own certificates (manual)](#own-certificates-manual)
- **Own — WHITELABEL generates the CSRs**: This option is for merchants who have an Apple Developer account but don't want to generate private keys or run OpenSSL commands. WHITELABEL generates the Certificate Signing Requests for you, then you upload them to Apple and return the signed certificates. [→ Own certificates with WHITELABEL-generated CSRs](#own-certificates-with-whitelabel-generated-csrs)

## Own certificates (manual)

This path is for merchants who have an Apple Developer account and want to generate and manage their certificates manually using Keychain Access and OpenSSL.

### Step 1: Register a merchant identifier

<Note>
  If you're using VTEX as your e-commerce platform, you'll need to configure your Apple Pay Merchant ID. For detailed instructions, check out the [official VTEX documentation](https://developers.vtex.com/docs/guides/setting-up-merchant-id-in-apple-pay).
</Note>

In the Apple Developer dashboard:

1. Log in to [Apple Developer](https://idmsa.apple.com/IDMSWebAuth/signin?appIdKey=891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757&path=%2Faccount%2F&rv=1), go to **Certificates, Identifiers & Profiles**, then select **Register a new identifier**.
2. Choose **Merchant IDs**.
3. Enter a **Description** (for example, `Apple Pay Integration`) and an **Identifier** in the format `merchant.com.whitelabel.com.YourBusinessName`.

### Step 2: Generate a payment processing certificate

1. Create a new directory (for example, `Downloads/ApplePayFiles`) to store the certificate files.
2. Open **Keychain Access** on your Mac.
3. Go to **Keychain Access \> Certificate Assistant \> Request a Certificate From a Certificate Authority**.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image1.png)
</Frame>

4. Fill out the form:
   - **Email Address**: your email address
   - **Common Name**: a name for the certificate (for example, `John Doe ProcessingCertificate`)
   - **CA Email Address**: leave blank
   - Select **Saved to disk**
   - Check **Let me specify key pair information**
5. Click **Continue**, then save the file as `CertificateSigningRequestPaymentProcessingCertificate.certSigningRequest` in your working directory.
6. When prompted for key pair settings, use:
   - **Key Type**: Elliptic Curve (EC)
   - **Key Size**: 256-bit
   - **Algorithm**: ECDSA

### Step 3: Retrieve and convert the payment processing certificate

1. Go to the [Apple Developer Merchant ID list](https://developer.apple.com/account/resources/identifiers/list/merchant).
2. Select your Merchant ID and click **Create Certificate** under **Apple Pay Payment Processing Certificate**.
3. When prompted, answer **No** to "Will payments... be processed exclusively in China mainland?"
4. Upload the file `CertificateSigningRequestPaymentProcessingCertificate.certSigningRequest`.
5. Download the signed certificate as `apple_pay.cer` and save it to your directory.
6. Convert the certificate to PEM format:

```bash
openssl x509 -inform DER -in apple_pay.cer -out apple_pay.pem
```

### Step 4: Export the private key

1. In **Keychain Access**, find the key you created (for example, `John Doe ProcessingCertificate`).
2. Right-click and choose **Export**.
3. Export the key as a `.p12` file (for example, `JohnDoeProcessingCertificate.p12`) and save it to your working directory.
4. Set a strong password (you’ll use it in the next step).
5. Convert the `.p12` to a PEM-format private key:

```bash
openssl pkcs12 -in JohnDoeProcessingCertificate.p12 -nocerts -nodes | sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > ProcessingCertificatePrivateKey.pem
```

The private key will be stored in `ProcessingCertificatePrivateKey.pem`.

### Step 5: Upload the certificate and key to WHITELABEL

1. Open the [WHITELABEL Dashboard](https://dashboard.whitelabel.com/auth/login) **\> Connections \> Apple Pay \> Connect**
2. Enter the contents of `ProcessingCertificatePrivateKey.pem` to the **Payment processing key** field.
3. Enter the contents of `apple_pay.pem` into the **Payment processing certificate** field.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image2.png)
</Frame>

### Step 6: Generate a merchant identity certificate

1. Open **Keychain Access**, navigate to **Certificate Assistant \> Request a Certificate From a Certificate Authority**, and enter:

- **Email Address**: your email
- **Common Name**: for example, `John Doe MerchantIdentityCertificate`
- Leave **CA Email Address** blank
- Select **Saved to disk**

2. Save as `CertificateSigningRequestMerchantIdentityCertificate.certSigningRequest`.

### Step 7: Retrieve and convert the merchant identity certificate

1. Go to the [Apple Developer Merchant ID list](https://developer.apple.com/account/resources/identifiers/list/merchant).
2. Select your Merchant ID and click **Create Certificate** under **Apple Pay Merchant Identity Certificate**.
3. Upload the `CertificateSigningRequestMerchantIdentityCertificate.certSigningRequest` file.
4. Download the signed certificate as `merchant_id.cer` and save it.
5. Convert it to PEM:

```bash
openssl x509 -inform DER -in merchant_id.cer -out merchant_id.pem
```

### Step 8: Export the merchant identity private key

1. In **Keychain Access**, find the certificate created in step 6, for example, `John Doe MerchantIdentityCertificate`.
2. Right-click and export as `JohnDoeMerchantIdentityCertificate.p12`.
3. Set a strong password.
4. Convert the private key to PEM:

```bash
openssl pkcs12 -in JohnDoeMerchantIdentityCertificate.p12 -nocerts -nodes | sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > MerchantIdentityCertificatePrivateKey.pem
```

The private key will be available as `MerchantIdentityCertificatePrivateKey.pem`.

### Step 9: Upload the merchant identity certificate and key

1. Return to your Apple Pay connection in the [WHITELABEL Dashboard](https://dashboard.whitelabel.com/auth/login) and go to the **Certificates & domains** step.
2. Copy the contents of `MerchantIdentityCertificatePrivateKey.pem` and paste them into the **Merchant Identity key** field.
3. Paste the contents of `merchant_id.pem` into the **Merchant Identity certificate** field.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image3.png)
</Frame>

## Own certificates with WHITELABEL-generated CSRs

This option is for merchants who have an Apple Developer account but don't want to generate private keys, run OpenSSL commands, or paste PEM values into the Dashboard. WHITELABEL generates both Certificate Signing Requests (Payment Processing and Merchant Identity) for you. You upload them to Apple, download the signed .cer files Apple returns, and upload those .cer files back to WHITELABEL from the Apple Pay connection form.

**Where to find it:** In the WHITELABEL Dashboard, open your Apple Pay connection and go to the **Certificates & domains** step. When you are creating the connection, the step comes right after the credentials; on an existing connection, open it and go to the same step.

### Step 1: Enter your Apple Merchant ID

In the **Your Apple Merchant ID** field, enter the Merchant ID you registered in the Apple Developer Portal (for example, `merchant.com.example.app`).

<Note>
  Find your Apple Merchant ID in your Apple Developer Portal → Certificates, Identifiers & Profiles → Merchant IDs.
</Note>

### Step 2: Generate the Payment Processing CSR

Apple Pay requires two separate certificates. The Payment Processing Certificate is an ECC P-256 certificate used by Apple to encrypt the payment token your store receives.

<Note>
  Apple allows only one active Payment Processing certificate per Merchant ID.
</Note>

Click **Generate Payment Processing CSR**. WHITELABEL generates the signing request. Click **Download .csr file** to save it locally.

### Step 3: Generate the Merchant Identity CSR

The Merchant Identity Certificate is an RSA 2048 certificate used to authenticate your server to Apple via mTLS when starting an Apple Pay session on the Web.

<Note>
  Multiple active Merchant Identity certificates per Merchant ID are allowed.
</Note>

Click **Generate Merchant Identity CSR**. Click **Download .csr file** to save the second .csr locally.

### Step 4: Upload each .csr to Apple

Repeat these steps twice: once for the Payment Processing CSR, and once for the Merchant Identity CSR.

1. Go to [developer.apple.com](https://developer.apple.com) → **Certificates, Identifiers & Profiles**.
2. Select your Merchant ID.
3. Under **Apple Pay Payment Processing Certificate** (first pass) or **Apple Pay Merchant Identity Certificate** (second pass), click **Create Certificate**.
4. When prompted, answer **No** to "Will payments… be processed exclusively in China mainland?"
5. Upload the .csr file when prompted.
6. Download the .cer file Apple gives you.

You will end up with two .cer files: one for Payment Processing and one for Merchant Identity.

### Step 5: Set up the Apple Pay connection

1. In **Use certificates**, select **Own — WHITELABEL generates the CSRs**.
2. Pick your **Merchant Identifier** from the dropdown, pre-populated with the CSRs you generated.
3. Fill in **Display Name** and **Domain Name**.
4. Under **Payment Processing Certificate** → **Apple-issued .cer file**, click **Choose file** and select the .cer Apple issued for Payment Processing.
5. Under **Merchant Identity Certificate** → **Apple-issued .cer file**, click **Choose file** and select the .cer Apple issued for Merchant Identity.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image7.png)
</Frame>

## WHITELABEL certificates: register your merchant domains

Before the Apple Pay button can appear on your website, every domain that displays it must be registered. You have two options:

### Dashboard (recommended)

Register your domains directly in the WHITELABEL Dashboard: WHITELABEL registers each domain with Apple on your behalf.

Domains belong to the Apple Pay connection you register them on, so register them on the connection your routing sends Apple Pay payments to.

1. In the Dashboard, open that Apple Pay connection and go to the **Certificates & domains** step.
2. Open **Association file**, click **Download file**, and host its content on every domain you are about to register (see the warning below).
3. Click **Add domain**.
4. Enter the domains where the Apple Pay button will appear, **one per line** (up to 10 per connection). Each subdomain is registered separately: `example.com`, `www.example.com` and `checkout.example.com` are three domains.

<Warning>
  Before adding a domain, you must host the verification file on it as plain text (do not leave it as a downloadable file), using the following hosting path:

  `/.well-known/apple-developer-merchantid-domain-association`

  Keep the file hosted permanently. Apple re-checks it from time to time, and Apple Pay can stop working on a domain whose file is no longer reachable. A domain can host only one such file, so a domain registered with WHITELABEL's certificate cannot also be verified under your own Apple merchant ID.
</Warning>

5. Click **Add**. Each domain appears in the table with a status of **Verifying** while WHITELABEL completes registration with Apple.
6. When registration succeeds, the status changes to **Active**: the domain is ready to show Apple Pay. If it shows **Failed**, check that the file is reachable on that domain and use **Retry** on the row.

<Note>
  When you are creating a new connection, at least one domain must reach **Active** before you can move past the step, because Apple Pay cannot process a payment until a domain is registered and verified. Editing an existing connection is never blocked, so a connection whose domains fail later can still be corrected.

  With your own certificate there is no domain list in this step: you register your domains directly with Apple, under your own merchant ID.
</Note>

### API

Use the following endpoints to manage your domain registration. Register domain returns an `id` per domain: pass it as `domain_id` to check its status or to delete it.

- [Register domain](/reference/domains/register-domain): `POST /v1/payment-methods/domains`
- [Get domain](/reference/domains/get-domain): `GET /v1/payment-methods/{payment_method}/domains/{domain_id}`
- [Delete domain](/reference/domains/delete-domain): `DELETE /v1/payment-methods/{payment_method}/domains/{domain_id}`

The API reports the same states the Dashboard shows: `CREATED` is **Verifying**, `REGISTERED` is **Active**, `ERROR` is **Failed**, and `INACTIVE` is a deleted domain. Domain events are not sent by webhook: read the status in the Register domain response and call Get domain until it leaves `CREATED`.

<Warning>
  Apple allows 99 domain names per merchant identifier. WHITELABEL registers one identifier per Apple Pay connection, so a connection holds at most 99 domains, whether you add them in the Dashboard or through the API. Deleting a domain you no longer use frees its slot. If you expect more than 99 domains on one connection (for example, one domain per seller), contact WHITELABEL before you scale.
</Warning>

## Finish in the Dashboard

All three certificate paths, WHITELABEL, Own, and Own (WHITELABEL-generated CSRs), converge here to complete the setup in the WHITELABEL Dashboard.

### Step 1: Connect Apple Pay

1. Log in to your [WHITELABEL Dashboard](https://dashboard.whitelabel.com/connections).
2. Go to **Connections**, find **Apple Pay** in the provider catalogue and click **Connect**.
3. Provide a **Name** for the connection, select **Apple Pay** as **Payment method**, and in the **Use certificates** dropdown, select the option that matches your setup:
   - **WHITELABEL**: WHITELABEL manages the certificates on your behalf automatically. No additional certificate configuration is required.
   - **Own — paste PEM values** (manual): paste the PEM values you generated in the previous steps.
   - **Own — WHITELABEL generates the CSRs**: select this option, then generate the signing requests and upload the `.cer` files issued by Apple in the **Certificates & domains** step, as described in the [Own certificates with WHITELABEL-generated CSRs](#own-certificates-with-whitelabel-generated-csrs) section.
4. Click **Next**. The **Certificates & domains** step asks for what the certificate type you chose needs: your domains with WHITELABEL's certificate, your certificate setup with either own-certificate option.
5. Click **Next** again, then complete the two screens that follow: setup costs (optional) and accounts.
6. Click **Save**. Apple Pay will be added to your connections.

<Note>
  The certificate type cannot be changed once the connection exists, because what is attached to one type does not carry over to the other. To switch, create a new connection and point your routing at it.
</Note>

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image4.png)
</Frame>

### Step 2: Configure routing

Set up a new route to control how payments are processed through Apple Pay.

<Note>
  Visit the [Routing](/docs/routing) page for additional information on this step.
</Note>

1. In the [WHITELABEL Dashboard](https://dashboard.whitelabel.com/), navigate to the **Routing** section.
2. Find the **Apple Pay** connection. If you have not created a route for Apple Pay yet, it will be on the **Not published** tab.
3. Set up a new route by pressing **Setup** on your **Apple Pay** module (or **View** if the route is published) and then clicking on **Create new route**. Give the connection a name and click **Save**.
4. Add conditions to specify how payments should be routed through Apple Pay.
5. Add Apple Pay as the payment processor for this route to ensure that payments meeting the defined conditions are processed through Apple Pay.
6. **Publish** the route once all configurations are defined.

Here's a simple route processing all payments through Apple Pay.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image5.png)
</Frame>

### Step 3: Enable Apple Pay in Checkout Builder

<Note>
  Visit the [Checkout Builder](/docs/checkout-builder) page for additional information on this step.
</Note>

To make Apple Pay available to your end users, you have to enable it on the Checkout Builder:

1. In the [WHITELABEL Dashboard](https://dashboard.whitelabel.com/), navigate to the **Checkout Builder** section.
2. Locate the available **Payment methods** and enable **Apple Pay**. Click the three dots next to each method for additional options.
3. Click **Publish settings** to make Apple Pay available as a payment option for all transactions that meet the defined routing criteria.

<Frame>
  ![](/images/reference/prerequisites-apple-pay/image6.png)
</Frame>

<Note>
  If you plan to implement recurring payments, you will need to configure an additional URL in your Apple Pay connection where customers can manage their subscriptions (cancel, modify, etc.). This URL must be created and hosted by your merchant platform.
</Note>

## Next steps

After completing the Dashboard setup, choose your path to integrate via SDK or Direct:

- **SDK Integration**: [one-time](/docs/apple-pay-sdk-integration#one-time-payments-with-sdk) and [recurring](/docs/apple-pay-sdk-integration#recurring-payments-with-sdk)
- **Direct integration**: [one-time](/docs/apple-pay-direct-integration#one-time-payments)  and [recurring](/docs/apple-pay-direct-integration#recurring-payments-with-direct-api)