# Run your own app marketplace in the EU

> Have an Agent set the catalog address Apple uses to search your marketplace and the webhook Apple calls, after Apple has approved your marketplace app.

Source: https://air.build/docs/app-store/run-an-app-marketplace-in-the-eu/

An alternative app marketplace is an app that lets people in the European Union find and install other apps, outside the App Store. Apple's page says a marketplace is made of a marketplace app, a website people install it from, and a server. Your Agents set up the App Store Connect side: the address of your catalog, so Apple can show your marketplace's apps in search, and the webhook Apple calls.

> [!NOTE]
> A marketplace needs Apple's approval first. Apple's [Operating an alternative app marketplace in the EU](https://developer.apple.com/support/alternative-app-marketplace-in-the-eu/) page says Apple authorizes marketplace developers through the Alternative App Marketplace Entitlement, and that the Account Holder of your Apple Developer Program membership requests it after agreeing to the latest Apple Developer Program License Agreement. Your Agents can't request it.

AirBuild has no screen for this. You ask an Agent in the Project's chat, and it uses `asc marketplace` (listed in [asc: apps and App Store listing](https://air.build/docs/cli/asc-apps/#marketplace)). To look at it yourself, use App Store Connect on the web.

To offer only your own app from your website, you don't need a marketplace: see [Distribute your app from your own website in the EU](https://air.build/docs/app-store/distribute-from-your-website-in-the-eu/).

## Before you start

- Apple's entitlement, from the note above.
- A Project for the marketplace app. Apple's [Create a marketplace app](https://developer.apple.com/help/app-store-connect/managing-alternative-distribution/create-a-marketplace-app) help says a marketplace app must have a new iOS app record in App Store Connect. To start one, see [Make your first app](https://air.build/docs/get-started/first-project/) and [Create your app's App Store Connect record](https://air.build/docs/app-store/create-your-app-record/).
- What the app does. This page doesn't cover building the marketplace app or its server: describe what you want in the Project's chat. Apple's [Creating an alternative app marketplace](https://developer.apple.com/documentation/marketplacekit/creating-an-alternative-app-marketplace) explains the parts.

## Put the marketplace app on your website

Apple's help says a marketplace app can only be distributed from a website you own, which you add using the App Store Connect API, and that you submit the app for Notarization. Your Agents do both the same way as for an app you distribute from your website: see Register your domain and Send a version for Notarization in [Distribute your app from your own website in the EU](https://air.build/docs/app-store/distribute-from-your-website-in-the-eu/#register-your-domain).

Apple's help also says you can test the marketplace app with TestFlight's internal testing, but not with external testers. See [Share a beta with TestFlight](https://air.build/docs/app-store/test-with-testflight/).

## Make your catalog searchable

Apple's [Creating an alternative app marketplace](https://developer.apple.com/documentation/marketplacekit/creating-an-alternative-app-marketplace) says people can find apps on your marketplace with Spotlight search if you keep a list of your apps at a place Apple knows. In `asc`, your marketplace app's search details have one field, the catalog URL, which the help calls "Marketplace catalog URL".

Ask in the marketplace app's Project chat, for example:

```text
Set our marketplace's catalog URL to https://example.com/catalog.
```

The Agent runs `asc marketplace search-details create` for the marketplace app, with the address as `--catalog-url`. To check, ask "What catalog URL does our marketplace have?" The Agent reads it with `search-details view`.

To change the address later, the Agent uses `search-details update`. To remove it, it uses `search-details delete`, which runs only with `--confirm`, so the Agent asks you first.

## Give Apple your webhook

The marketplace webhook is an address on your server that Apple calls, and a secret you choose. It isn't tied to one app: the command doesn't take one. Ask with your own address, and your server's secret in place of `YOUR_SECRET`, for example:

```text
Add a marketplace webhook at https://example.com/apple/marketplace with the secret YOUR_SECRET.
```

The Agent runs `asc marketplace webhooks create` with the address (`--url`) and the secret (`--secret`). Both are needed. To check, ask "Which marketplace webhooks do we have?" The Agent lists them with `marketplace webhooks list`, each with its address. `asc` doesn't show the secret again, so keep your own copy on your server.

> [!NOTE]
> The secret you type stays in the chat, where everyone in it can read it. To keep it out, save it in your Team's **Passwords** and tell the Agent its title instead: the Agent reads it with [password-book](https://air.build/docs/cli/password-book/) and passes it straight to `--secret`. The same goes for a new secret when you change it. See [Save logins for Agents](https://air.build/docs/agents/save-logins-for-agents/#add-a-login-yourself). The Passwords screen says: "Everyone on the Team and all of its Agents can see these. A value filled into a preview stays there as plain text. Save test accounts only, not personal accounts or production keys."

> [!WARNING]
> Every `asc marketplace webhooks` command prints "Warning: marketplace webhooks endpoints are deprecated in App Store Connect API." They still run. For notifications about an app, App Store Connect's app webhooks have event types for alternative distribution: see [Get webhook events from Apple at your server](https://air.build/docs/app-store/get-webhook-events-from-apple/).

| Ask | `asc` |
| --- | --- |
| "Change the marketplace webhook's address to …" | `marketplace webhooks update --url` |
| "Change the marketplace webhook's secret." | `marketplace webhooks update --secret`. Put the new secret on your server too. |
| "Remove the marketplace webhook." | `marketplace webhooks delete`, only with `--confirm`, so the Agent asks you first. |

## Get other developers' apps

`asc` has no command for this side. Apple's [Manage distribution on an alternative app marketplace](https://developer.apple.com/help/app-store-connect/managing-alternative-distribution/manage-distribution-on-an-alternative-app-marketplace) help says each developer shares their Developer ID with you, you give them a marketplace token, and they add your marketplace in App Store Connect and choose which of their apps it can distribute. They then send you each version's package, or let Apple notify you.

## Questions

**Can I do this in AirBuild?**

No. AirBuild has no screen for marketplaces. Ask an Agent, or use App Store Connect on the web.

**The Agent warns that marketplace webhooks are deprecated.**

`asc` prints that warning with every `asc marketplace webhooks` command, and the command still runs. App Store Connect's app webhooks can tell your server about alternative distribution packages: see [Get webhook events from Apple at your server](https://air.build/docs/app-store/get-webhook-events-from-apple/).

**The Agent says at least one update flag is required.**

There was nothing to change. Say the new catalog address, or the new webhook address or secret.

**Apple refused the catalog address or the webhook.**

The Agent shows Apple's reason, for example after "marketplace search-details create: failed to create:" or "marketplace webhooks create: failed to create:". The `asc` help doesn't say what Apple checks, so start from Apple's message.
