# Going live

> What separates the test environment from live, and the checklist to run through before real players pay you.

## Where things stand

Your game works in `test`: payments are simulated, your data is disposable, and every studio can use it. `live` is the environment with **real players, real payments and real money**, and it is reserved for studios that Apilow has verified.

> [!NOTE]
> Because the key picks the environment, nothing you build in `test` has to change to go live. You change the keys your server and your game read, and you complete the checklist below. Most of it you can prepare while you are still testing.

## What changes between test and live

| | `test` | `live` |
|---|---|---|
| Who can use it | Every studio | Verified studios only |
| Payments | Simulated: the payment page offers « Payer » and « Refuser », and no money moves | Real payments, with VAT and receipts |
| Keys | `gc_sk_test_…` and `gc_pk_test_…`, created with the game | `gc_sk_live_…` and `gc_pk_live_…`, created after verification |
| Catalog | Yours to experiment with | A separate catalog: copy it from `test` in one click |
| Players, balances, orders | Disposable | Your real players. A `test` player does not exist in `live` and a balance never crosses over |
| Allowed origins | An empty list accepts every origin | An empty list **refuses every browser** |
| Webhook endpoints | Receive the events of simulated orders | Receive the events of real payments. Declare them again for `live` |

## The checklist

Go through these in order. Each step says where to do it.

| # | Step | Where |
|---|---|---|
| 1 | **Ask for verification.** Give your legal name or the name of your company, its number (optional for an individual), the country of its head office and the website of the studio or the game. Apilow sells your coins in its own name, so it needs to know who you are. An answer usually comes by e-mail within two business days. Only an owner or an administrator can ask. | « Paramètres » of the studio |
| 2 | **Finish the catalog in `test`.** Currencies, items and packs, and a full run of the [test plan](/docs/guides/testing). | The game |
| 3 | **Copy the catalog into `live`.** Packs arrive as **drafts**: nothing is on sale yet. | « Copier le catalogue de test » |
| 4 | **Review and publish the packs.** Check each price (VAT included), the stock and the sale window, then use « Publier ». | « Packs », environment `live` |
| 5 | **Create your live keys.** The secret key is shown once: store it in your server's secret manager. | « Clés d'API » |
| 6 | **List the allowed origins.** Every web page of your game that calls the client API, and where players return after a payment. Scheme and host only, with `https://`; no path and no wildcard. | « Réglages » |
| 7 | **Declare your webhook endpoints for `live`.** An endpoint only receives the events of its own environment. | « Webhooks » |
| 8 | **Switch the keys.** Your server reads the secret live key, your game the publishable live key. Nothing else in your code changes. | Your deployment |
| 9 | **Make a small real purchase, then refund it.** Check the balance, the receipt and the `order.fulfilled` and `order.refunded` events end to end. | Your game, then « Commandes » |

> [!TIP]
> Keep the test keys in your staging setup and the live keys in production. Nothing you create with a test key is ever visible with a live key, so a missing player or pack right after a switch usually means that the wrong key is loaded.

## Selling before you launch

If your game is not out yet, you can still sell in `live`. In « Réglages », under « Lancement », switch on **pre-order** and give an optional **launch date**: the shop presents purchases as pre-orders, receipts mention the date, and the coins wait on the player's wallet. This is how [founder packs](/docs/guides/founder-packs) work.

## What can go wrong

| You see | It means | Do this |
|---|---|---|
| `403 ENV_NOT_ENABLED` with a live key | Your studio is not verified, or its verification was withdrawn | Ask for verification in « Paramètres », or write to the address in your last e-mail from Apilow |
| The browser's calls to the client API are refused in `live` | The allowed origins list is empty or does not contain the page | Add the exact `https://` origin of the page in « Réglages », then reload |
| `VALIDATION_FAILED` with `ORIGIN_MISMATCH` on a browser checkout | The `successUrl` or `cancelUrl` does not have the origin of the page that opened the checkout | Build the URLs from the page's own origin |
| A pack is not on sale after the copy | Packs are copied as drafts | Review it, then use « Publier » in « Packs » |
| Events do not reach your server | The `live` endpoint is not declared, or is declared only for `test` | Add it in « Webhooks » for the `live` environment |

## Your studio's status

| Status | What it means for you |
|---|---|
| En attente de vérification | `test` is open. `live` is closed. |
| Vérifié | You can create live keys and sell. |
| Suspendu | The workspace is read-only and `live` is closed. Write to the support address shown in the dashboard. |

Apilow can also withdraw a verification: `live` closes, `test` stays open, and you can send a new request from « Paramètres ».

## Where next

- [Testing](/docs/guides/testing): the test plan to run before the copy.
- [Keys and environments](/docs/concepts/keys-and-environments): how a key picks the game and the environment.
- [Webhooks](/docs/guides/webhooks): events, signatures and retries.
- [Refunds](/docs/guides/refunds): what a refund takes back, and what a debt is.
