# Generate Codes

> The sheet that asks Apple for a batch of one-time codes under a code offer: how many, and the day they expire.

Source: https://air.build/docs/screens/developer/generate-codes/

Generate Codes asks Apple for a batch of one-time codes under one code offer. Each code works once. You choose how many and when they expire. Apple makes the codes, and you download them from App Store Connect, not from AirBuild.

## Open it

On an [Offer code page](https://air.build/docs/screens/developer/offer-code-page/), tap **Generate Codes**. It's the last row of **Codes** on iPhone and iPad, and a button under **Codes** on the Mac. It's dimmed while a batch is being made.

**Cancel** and **Generate** are in the sheet's top bar on iPhone and iPad, and at its bottom right on the Mac.

## What's on it

| Part | What it shows or does | Default |
| --- | --- | --- |
| **Codes** | How many codes to make, from 1 to 25,000. The stepper moves 50 at a time. | 100 |
| **Expires** | The day the codes stop working. The date is read in UTC. | 90 days from today |
| Footer | "Apple generates the codes and delivers them in App Store Connect for download, up to 25,000 at a time." |  |

## Generate the codes

1. Set **Codes** and **Expires**.
2. Tap **Generate**. The sheet closes at once and the request goes to Apple.
3. When Apple has made them, the batch shows under **Codes** on the [Offer code page](https://air.build/docs/screens/developer/offer-code-page/), for example "500 one-time codes".
4. Download the codes from App Store Connect.

**Generate** is never dimmed. Apple decides whether to take the count and date.

## Messages

| Message | When | What to do |
| --- | --- | --- |
| Apple's reason, above the codes on the [Offer code page](https://air.build/docs/screens/developer/offer-code-page/) | Apple refused the batch. | Fix what Apple names and open **Generate Codes** again. |
