> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apple Pay Integration Guide

> Learn how to enable Apple Pay on your site for Checkout

To enable Apple Pay on your site, follow these steps using the [Crossmint Developer Console](https://www.crossmint.com/console/apple-pay-domains).

## Prerequisites

1. **HTTPS Hosting**: Your site must be hosted on HTTPS to ensure secure transactions.
2. **Crossmint Account**: You need an active Crossmint developer account.

## Setup Instructions

### Step 1: Download the Verification File

1. Go to the [Apple Pay Domains](https://www.crossmint.com/console/apple-pay-domains) page in the Crossmint Console.
2. Click **Download file** to get the Apple Developer Merchant ID Domain Association file.

### Step 2: Host the Verification File

Host the downloaded file on your server at the following path:

```
https://[your-domain]/.well-known/apple-developer-merchantid-domain-association
```

<Accordion title="Example: Next.js App Router">
  **Option 1: Using the Public Folder**

  1. Create the `.well-known` folder inside your `public` directory.
  2. Place the downloaded file in `public/.well-known/` with the filename `apple-developer-merchantid-domain-association` (no extension).

  **Option 2: Using a Route**

  1. Create a folder at `app/.well-known/apple-developer-merchantid-domain-association/`
  2. Add a `route.ts` file with the following content:

  ```typescript route.ts theme={null}
  import { NextResponse } from "next/server";

  export async function GET() {
      return new NextResponse("PASTE_FILE_CONTENT_HERE", {
          headers: {
              "Content-Type": "text/plain",
          },
      });
  }
  ```

  Replace `PASTE_FILE_CONTENT_HERE` with the content of the downloaded verification file.
</Accordion>

<Accordion title="Example: Next.js Page Router">
  1. Create the `.well-known` folder inside your `public` directory.
  2. Place the downloaded file in `public/.well-known/` with the filename `apple-developer-merchantid-domain-association` (no extension).
</Accordion>

<Accordion title="Example: Vite">
  1. Create the `.well-known` folder inside your `public` directory.
  2. Place the downloaded file in `public/.well-known/` with the filename `apple-developer-merchantid-domain-association` (no extension).
</Accordion>

### Step 3: Verify Your Domain

1. Return to the [Apple Pay Domains](https://www.crossmint.com/console/apple-pay-domains) page in the Crossmint Console.
2. Enter your domain (e.g., `example.com` or `checkout.example.com`) in the input field.
3. Click **Verify domain**.

If verification succeeds, your domain will appear in the list of registered domains and Apple Pay will be enabled for that domain.

<Note>
  If verification fails, ensure the file is publicly accessible at the correct path. You can test by visiting `https://your-domain/.well-known/apple-developer-merchantid-domain-association` in your browser.
</Note>

## Local Testing

Using [ngrok](https://ngrok.com/) is recommended for local testing. Ngrok allows you to expose your local server to the internet securely.

1. Start ngrok with a fixed domain if possible for consistent testing.
2. Host the verification file on your local server.
3. Register the ngrok domain in the Crossmint Console.
4. Test Apple Pay on Safari (macOS) or any iOS device.

***

For further assistance, please contact our support team.
