# asc merchant-ids

> asc merchant-ids commands: create, list, update and delete Apple Pay merchant IDs and create and list their certificates.

Source: https://air.build/docs/cli/asc-merchant-ids/

`asc merchant-ids` manages the Apple Pay merchant IDs of the connected Apple team and their Apple Pay certificates. Picking an Apple team, output, pagination, `--confirm` and exit codes work as described on the [asc](https://air.build/docs/cli/asc/) page; the flag tables below leave out `--output`, `--pretty`, `--limit`, `--next`, `--paginate` and the `--fields` / `--…-fields` flags, which are explained there.

Notes that apply to the whole page:

- `--merchant-id` is the merchant ID's resource ID from `asc merchant-ids list` (its `data[].id`), not the `merchant.…` identifier.
- A flag marked "Required" is checked before any request; leaving it out exits `2`.
- Commands that read or change a merchant ID or certificate print Apple's JSON, as described on [asc](https://air.build/docs/cli/asc/).

| Subcommand | What it does |
| --- | --- |
| [list](https://air.build/docs/cli/asc-merchant-ids/#list) | List merchant IDs. |
| [view](https://air.build/docs/cli/asc-merchant-ids/#view) | View a merchant ID by ID. |
| [create](https://air.build/docs/cli/asc-merchant-ids/#create) | Create a merchant ID. |
| [update](https://air.build/docs/cli/asc-merchant-ids/#update) | Update a merchant ID. |
| [delete](https://air.build/docs/cli/asc-merchant-ids/#delete) | Delete a merchant ID. |
| [certificates](https://air.build/docs/cli/asc-merchant-ids/#certificates) | Manage merchant ID certificates. |

## list

Lists the Apple team's merchant IDs, optionally filtered and sorted.

| Flag | What it does | Default |
| --- | --- | --- |
| `--identifier` | Only these identifiers, such as `merchant.com.example`, comma-separated. | — |
| `--name` | Only these names, comma-separated. | — |
| `--sort` | `name` or `identifier`, with `-` for descending. | — |
| `--include` | Adds related resources: `certificates`. | — |
| `--certificates-limit` | Caps included certificates per merchant ID (1–50). Needs `--include certificates`. | — |

`--certificate-fields` and `--certificates-limit` are refused without `--include certificates`. `--next` can't be combined with `--limit`, `--certificates-limit` or the filter, sort, include or fields flags: the `links.next` URL already carries them.

```sh
asc merchant-ids list --identifier "merchant.com.example"
```

## view

Shows one merchant ID.

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required. | — |
| `--include` | Adds related resources: `certificates`. | — |
| `--certificates-limit` | Caps included certificates (1–50). Needs `--include certificates`. | — |

```sh
asc merchant-ids view --merchant-id "ABC123" --include certificates
```

## create

Creates a merchant ID and prints it.

| Flag | What it does | Default |
| --- | --- | --- |
| `--identifier` | The merchant identifier, such as `merchant.com.example`. Required. | — |
| `--name` | A name for the merchant ID. Required. | — |

```sh
asc merchant-ids create --identifier "merchant.com.example" --name "Example Store"
```

## update

Renames a merchant ID, or clears its name, and prints it.

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required. | — |
| `--name` | The new name. Required unless `--clear-name` is given. | — |
| `--clear-name` | Clears the name instead. | `false` |

Give `--name` or `--clear-name`, not both.

```sh
asc merchant-ids update --merchant-id "ABC123" --name "Example Store"
```

## delete

Deletes a merchant ID and prints `id` and `"deleted": true`.

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required. | — |
| `--confirm` | Confirms the deletion. Required. | `false` |

```sh
asc merchant-ids delete --merchant-id "ABC123" --confirm
```

## certificates

The Apple Pay certificates of a merchant ID.

| Subcommand | What it does |
| --- | --- |
| [`certificates list`](https://air.build/docs/cli/asc-merchant-ids/#certificates-list) | List certificates for a merchant ID. |
| [`certificates view`](https://air.build/docs/cli/asc-merchant-ids/#certificates-view) | View certificate relationships for a merchant ID. |
| [`certificates create`](https://air.build/docs/cli/asc-merchant-ids/#certificates-create) | Create a certificate for a merchant ID. |

### certificates list

Lists the certificates of a merchant ID, with their attributes.

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required unless `--next` is given. | — |
| `--certificate-type` | Only these certificate types, such as `APPLE_PAY`, comma-separated. | — |
| `--display-name` | Only these display names, comma-separated. | — |
| `--serial-number` | Only these serial numbers, comma-separated. | — |
| `--certificate-id` | Only these certificate IDs, comma-separated. | — |
| `--sort` | `displayName`, `certificateType`, `serialNumber` or `id`, with `-` for descending. | — |
| `--include` | Adds related resources: `passTypeId`. | — |

`--pass-type-fields` is refused without `--include passTypeId`. `--next` can't be combined with the filter, sort or include flags.

```sh
asc merchant-ids certificates list --merchant-id "ABC123" --certificate-type APPLE_PAY_MERCHANT_IDENTITY
```

### certificates view

Prints only the IDs of a merchant ID's certificates (relationship linkages), without their attributes.

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required unless `--next` is given. | — |

```sh
asc merchant-ids certificates view --merchant-id "ABC123"
```

### certificates create

Creates an Apple Pay certificate for a merchant ID from a certificate signing request (CSR) and prints the new certificate. The same command is available as `asc certificates create` with `--merchant-id` (see [asc certificates](https://air.build/docs/cli/asc-certificates/)).

| Flag | What it does | Default |
| --- | --- | --- |
| `--merchant-id` | Merchant ID. Required. | — |
| `--certificate-type` | `APPLE_PAY`, `APPLE_PAY_MERCHANT_IDENTITY`, `APPLE_PAY_PSP_IDENTITY` or `APPLE_PAY_RSA`. Required. | — |
| `--csr` | Path to an existing CSR file. Required unless `--generate-csr` is given. | — |
| `--generate-csr` | Makes a new private key and CSR first and uses that CSR. | `false` |
| `--key-out` | Where to write the private key (PEM). Required with `--generate-csr`. | — |
| `--csr-out` | Where to write the CSR (PEM). Required with `--generate-csr`. | — |
| `--common-name` | CSR subject Common Name (CN). | `asc` |
| `--email` | CSR subject email address. | — |
| `--organization` | CSR subject organization (O). | — |
| `--organizational-unit` | CSR subject organizational unit (OU). | — |
| `--country` | CSR subject country (C). | — |
| `--key-type` | Key type for the generated key: `rsa`. | `rsa` |
| `--key-size` | RSA key size in bits for the generated key. | `2048` |
| `--force` | Overwrites existing files at `--key-out` and `--csr-out`. | `false` |

Notes:

- Give `--csr` or `--generate-csr`, not both. `--key-out`, `--csr-out`, the CSR subject flags, `--key-type`, `--key-size` and `--force` only work with `--generate-csr`.
- The flag checks run before `--generate-csr` writes anything, so a command refused for its flags leaves no key or CSR behind. Once written, the files stay even if Apple then refuses the certificate.
- The certificate Apple returns pairs with the private key behind the CSR: keep that key out of the repository and logs.

```sh
asc merchant-ids certificates create --merchant-id "ABC123" --certificate-type APPLE_PAY_MERCHANT_IDENTITY --generate-csr --key-out "./signing/merchant.key" --csr-out "./signing/merchant.csr"
```
