# Purchase Keys

> The keys your own server signs purchase reports with, for payments outside the App Store: the Report URL to copy, every key with when it was made and last used, and making or revoking one.

Source: https://air.build/docs/screens/paywall/purchase-keys/

Purchase Keys lists the keys your app's own server uses to report purchases to [AirPayment](https://air.build/docs/screens/paywall/airpayment/), for payments the App Store doesn't see, such as WeChat Pay or Stripe. It shows the **Report URL** your server sends reports to and every key, revoked ones included, and it's where you make a new key or revoke one. Anyone in the Team can make and revoke keys.

A key's secret shows only once, when it's made, on [Save Your New Key](https://air.build/docs/screens/paywall/save-your-new-key/). This page never shows it.

## Open it

On the [AirPayment](https://air.build/docs/screens/paywall/airpayment/) tab, tap **Purchase Keys**: at the foot of the tab, or under AirPayment's page while it's waiting for the first purchase. The row shows "_n_ active" or "None active".

**iPhone**

On iPhone it opens as the next page; **Back** returns to the tab. On iPad beside the chat, it opens as a sheet; **Done** at the top right closes it.

**New Key** (with a **+**) sits in the bar at the bottom.

**Mac**

It opens as a sheet: **New Key** at the bottom left, **Done** at the bottom right. Return presses **Done**.

## What's on it

| Item | What it shows or does |
| --- | --- |
| **Report URL** | The address your server sends each purchase report to. Select it, or tap the copy button beside it. A long address is shortened in the middle; the copy button copies it whole. Under it: "Your server signs each purchase it reports with one of these keys, for payments outside the App Store such as WeChat Pay or Stripe." |
| **Keys** | Every key, newest first, revoked ones included. |
| **New Key** | Opens [New Purchase Key](https://air.build/docs/screens/paywall/new-purchase-key/). With the **+**, at the bottom on iPhone and iPad; a button at the bottom left on the Mac. Dimmed until the keys have loaded. |

While the page loads, the **Report URL** shows as a placeholder with no copy button, and two placeholder rows show under **Keys**.

### A key row

| Part | What it shows |
| --- | --- |
| Name | The name you gave the key. |
| Line under the name | When it was made and its state, side by side with a space between them, for example "Created 3 days ago" and "Last used 2 hours ago". A key never used says **Never used**; a revoked one says when, for example "Revoked yesterday". A narrow row keeps only the state. |
| **Revoked** | At the right, on a revoked key. |

Swipe a key left (iPhone and iPad), or touch and hold it (on the Mac, right-click), for:

| Item | What it does | When it shows |
| --- | --- | --- |
| **Copy Key ID** | Copies the key's ID. | In the menu, always |
| **Revoke** | Asks first. See [Revoke a key](https://air.build/docs/screens/paywall/purchase-keys/#revoke-a-key). | Keys not yet revoked |

## Make a key

1. Tap **New Key**.
2. Type a **Key Name** and tap **Create**. See [New Purchase Key](https://air.build/docs/screens/paywall/new-purchase-key/).
3. Copy the secret from [Save Your New Key](https://air.build/docs/screens/paywall/save-your-new-key/) to your server, then tap **Done**.

## Revoke a key

1. Swipe the key left, or touch and hold it (on the Mac, right-click), and choose **Revoke**.
2. The app asks **Revoke “_name_”?**: "Purchases reported with this key stop at once. Create its replacement first. This can’t be undone." Tap **Revoke Key**.

The key stays in the list, marked **Revoked**. Reports signed with it stop being accepted at once, so make its replacement and put it on your server first.

## Messages

| Message | What it means | What to do |
| --- | --- | --- |
| "No keys yet. Create one for a server hosted elsewhere." | The app has no purchase keys. | Tap **New Key** if your server takes payments. |
| A reason with **Try Again**, under **Keys** | The keys couldn't be read. | Tap **Try Again**. |
| A reason at the top of the page | Revoking a key failed. The key still works. | Try again. The reason goes away when you leave the page. |

Ask an Agent in the Project's chat to set up the server side: it sends each purchase to the **Report URL**, signed with the key.
