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

# Platform payment domains

> Register the websites your platform operates so Ionic Blocks can load on them for every connected merchant.

A payment domain is the origin of a website where customers enter payment
details. For example, `https://pay.example.com` is the origin of a payment page
at `https://pay.example.com/orders/123`.

Your platform owns the registration. The connected merchant receiving the
payment owns the PaymentIntent and its payment records.

For [Ionic Blocks with Connect](/guides/connect-blocks), register each platform
website once. Connected merchants with active connections and the required permissions can
use it with your platform publishable key. Direct merchant keys use the merchant's own web domain list.

## Register a website in the dashboard

1. Open your platform's **Connect** workspace.
2. Switch to **Sandbox** or **Live**. Each mode has its own list.
3. Open **Payment domains** and select **Add domain**.
4. Enter the website's origin, including `https://`, and save.
5. Check the stored origin in the table. Register additional subdomains separately.

Viewing the page requires `web_domains:read`; adding or removing an origin
requires `web_domains:write`.

## Register a website from your server

Use a platform secret key with `web_domains:write`. Your platform's Program must
allow that permission, the selected mode, and delegated API access. In
**Connect → API keys**, the **Payment domains** preset includes the read and
write permissions.

`IONIC_PLATFORM_SECRET_KEY` is your platform's secret key for the target mode.
Keep it on your server.

```bash theme={null}
curl https://api.ionicfi.com/v1/web_domains \
  -H "Authorization: Bearer $IONIC_PLATFORM_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"https://pay.example.com"}'
```

Send this request without `Ionic-Account`. The list belongs to your platform,
and domain requests that include the header are rejected.

To list registrations, send `GET /v1/web_domains` with a key that has
`web_domains:read`. To remove one, send `DELETE /v1/web_domains/{id}` with the
`wd_…` ID from the list and a key that has `web_domains:write`.

## Which origins to add

| Your payment page                          | Register                  |
| ------------------------------------------ | ------------------------- |
| `https://pay.example.com/checkout`         | `https://pay.example.com` |
| `https://app.example.com/customer/payment` | `https://app.example.com` |
| `http://localhost:3000/checkout`           | `http://localhost:3000`   |

Matching uses the exact origin: scheme, hostname, and port. Paths are dropped
on registration. `www.example.com` and `example.com` are separate hosts, and
wildcards are not supported. Public sites require HTTPS; HTTP is accepted for
loopback development origins such as `localhost`.

Register only websites your platform operates.

## Related settings

* **Payment domains** identify the websites used for payment collection.
* **Connect redirect domains** control where the authorization flow may return a user.
* **Apple Pay** has its own domain registration; see [Apple Pay](/guides/apple-pay).
* **Embedded checkout** uses the merchant's own
  [domain registration](/guides/embedded-checkout#1-register-your-websites-domain).

Removing a registration stops new Blocks sessions on that origin. Payments
already submitted complete normally.
