# asc marketplace

> asc marketplace commands: search details and webhooks for apps distributed through alternative app marketplaces.

Source: https://air.build/docs/cli/asc-marketplace/

`asc marketplace` is for alternative app marketplaces: the search details (catalog URL) of an app, and the webhooks App Store Connect calls for marketplace events. Packages, keys and domains for alternative distribution are on [asc alternative-distribution](https://air.build/docs/cli/asc-alternative-distribution/). 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` flags, which are explained there.

Notes that apply to the whole page:

- A flag marked "Required" is checked before any request; leaving it out exits `2`. Where `--app` is required, `ASC_APP_ID` can stand in for it.
- Commands that read, create or update print Apple's JSON, as described on [asc](https://air.build/docs/cli/asc/); `delete` commands print `id` and `"deleted": true`.

```sh
asc marketplace webhooks list
asc marketplace search-details view --app "1234567890"
```

| Subcommand | What it does |
| --- | --- |
| [search-details](https://air.build/docs/cli/asc-marketplace/#search-details) | Manage marketplace search details. |
| [webhooks](https://air.build/docs/cli/asc-marketplace/#webhooks) | Manage marketplace webhooks. |

## search-details

An app's marketplace search details: the URL of its catalog entry.

| Subcommand | What it does |
| --- | --- |
| [`search-details view`](https://air.build/docs/cli/asc-marketplace/#search-details-view) | View marketplace search details for an app. |
| [`search-details create`](https://air.build/docs/cli/asc-marketplace/#search-details-create) | Create marketplace search details for an app. |
| [`search-details update`](https://air.build/docs/cli/asc-marketplace/#search-details-update) | Update marketplace search details. |
| [`search-details delete`](https://air.build/docs/cli/asc-marketplace/#search-details-delete) | Delete marketplace search details. |

### search-details view

Shows an app's marketplace search details, including the ID that `update` and `delete` take.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`). Required. | — |

```sh
asc marketplace search-details view --app "1234567890"
```

### search-details create

Creates an app's marketplace search details and prints them.

| Flag | What it does | Default |
| --- | --- | --- |
| `--app` | The app ID (or `ASC_APP_ID`). Required. | — |
| `--catalog-url` | The marketplace catalog URL. Required. | — |

```sh
asc marketplace search-details create --app "1234567890" --catalog-url "https://example.com/catalog"
```

### search-details update

Changes the catalog URL and prints the updated search details.

| Flag | What it does | Default |
| --- | --- | --- |
| `--search-detail-id` | Marketplace search detail ID. Required. | — |
| `--catalog-url` | The new marketplace catalog URL. Required. | — |

`--catalog-url` is the only thing that can be changed, so without it the command refuses with `at least one update flag is required`.

```sh
asc marketplace search-details update --search-detail-id "ABC123" --catalog-url "https://example.com/catalog"
```

### search-details delete

Deletes marketplace search details.

| Flag | What it does | Default |
| --- | --- | --- |
| `--search-detail-id` | Marketplace search detail ID. Required. | — |
| `--confirm` | Confirms the deletion. Required. | `false` |

```sh
asc marketplace search-details delete --search-detail-id "ABC123" --confirm
```

## webhooks

The webhooks App Store Connect calls for marketplace events: an endpoint URL and the secret shared with it.

Apple has deprecated these marketplace webhook endpoints, so every `webhooks` command first prints `Warning: marketplace webhooks endpoints are deprecated in App Store Connect API.` on stderr. App webhooks are on [asc webhooks](https://air.build/docs/cli/asc-webhooks/).

| Subcommand | What it does |
| --- | --- |
| [`webhooks list`](https://air.build/docs/cli/asc-marketplace/#webhooks-list) | List marketplace webhooks. |
| [`webhooks view`](https://air.build/docs/cli/asc-marketplace/#webhooks-view) | View a marketplace webhook by ID. |
| [`webhooks create`](https://air.build/docs/cli/asc-marketplace/#webhooks-create) | Create a marketplace webhook. |
| [`webhooks update`](https://air.build/docs/cli/asc-marketplace/#webhooks-update) | Update a marketplace webhook. |
| [`webhooks delete`](https://air.build/docs/cli/asc-marketplace/#webhooks-delete) | Delete a marketplace webhook. |

### webhooks list

Lists the Apple team's marketplace webhooks and their endpoint URLs. No flags besides the shared ones.

```sh
asc marketplace webhooks list --paginate
```

### webhooks view

Shows one marketplace webhook.

| Flag | What it does | Default |
| --- | --- | --- |
| `--webhook-id` | Marketplace webhook ID. Required. | — |

```sh
asc marketplace webhooks view --webhook-id "ABC123"
```

### webhooks create

Creates a marketplace webhook and prints it.

| Flag | What it does | Default |
| --- | --- | --- |
| `--url` | The endpoint URL App Store Connect calls. Required. | — |
| `--secret` | The secret shared with the endpoint. Required. | — |

Pass the secret with `@env:NAME` or `@file:PATH` (see [asc](https://air.build/docs/cli/asc/#values-from-the-environment-or-a-file)) so it stays out of the command line and shell history.

```sh
asc marketplace webhooks create --url "https://example.com/webhook" --secret @env:WEBHOOK_SECRET
```

### webhooks update

Changes a webhook's endpoint URL, secret or both, and prints the webhook.

| Flag | What it does | Default |
| --- | --- | --- |
| `--webhook-id` | Marketplace webhook ID. Required. | — |
| `--url` | The new endpoint URL. | — |
| `--secret` | The new secret. | — |

Give `--url`, `--secret` or both; with neither, the command refuses with `at least one update flag is required`.

```sh
asc marketplace webhooks update --webhook-id "ABC123" --secret @env:WEBHOOK_SECRET
```

### webhooks delete

Deletes a marketplace webhook.

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

```sh
asc marketplace webhooks delete --webhook-id "ABC123" --confirm
```
