# Go live

> A checklist of seven checks to finish before your integration takes real payments in production.

Source: https://docs.tappay.mn/go-live/

Finish these seven checks in order before real [customers](https://docs.tappay.mn/glossary.md#customer) pay. Each one says what to do, why it matters and how to check it. Test the same flow first in the [sandbox](https://docs.tappay.mn/glossary.md#sandbox), as described in [Testing](https://docs.tappay.mn/testing.md).

## Production key {#production-key}

**What.** Use a [production](https://docs.tappay.mn/glossary.md#production) key that starts with `sk_live_`. It is a different key from your [sandbox](https://docs.tappay.mn/glossary.md#sandbox) key. Keep the [secret key](https://docs.tappay.mn/glossary.md#secret-key) only on your server. Each key has a `PRIMARY` and a `SECONDARY` slot, so you can replace a key without downtime.

**Why.** A sandbox key moves no real money. A secret key in a browser or a mobile app lets anyone create [payments](https://docs.tappay.mn/glossary.md#payment) in your name.

**How to check.** Read the key from your server's secret store. Confirm that it starts with `sk_live_` and that no browser or mobile code contains it. Then run one small payment as in the [checkout guide](https://docs.tappay.mn/guides/checkout.md).

## HMAC request signature {#hmac-request-signature}

**What.** Set the authentication method of your system to **API key + HMAC** (**Developers › API keys & webhooks**). The method is per system, so each request from that system carries the headers `TapPay-Signature`, `TapPay-Timestamp` and `TapPay-Nonce`. If the system uses **OAuth 2.0 Client Credentials**, call the API with `Authorization: Bearer <access_token>` from `/v1/oauth/token` instead. See the [API reference](https://docs.tappay.mn/reference.md) for the exact format.

**Why.** The [signature](https://docs.tappay.mn/glossary.md#signature) proves that a request came from you and was not changed on the way.

**How to check.** Send one signed request and one unsigned request. On a system that uses HMAC, TapPay rejects the unsigned one.

## IP allowlist {#ip-allowlist}

**What.** Add the public addresses of your servers to the IP restriction of your system (**Developers › API keys & webhooks** › system › IP restriction).

**Why.** A stolen key cannot be used from any other address.

**How to check.** Call the API from an address that is not on the list. TapPay rejects the request with [AUTH-018](https://docs.tappay.mn/errors.md#AUTH-018). Then call it from a listed server and confirm that it works.

## Webhook secret and endpoint {#webhook-secret-and-endpoint}

**What.** Give each [webhook endpoint](https://docs.tappay.mn/glossary.md#webhook-endpoint) its own [webhook secret](https://docs.tappay.mn/glossary.md#webhook-secret). Verify every webhook over the raw body. Subscribe the endpoint only to the [events](https://docs.tappay.mn/glossary.md#event) that you need, and replace a secret with [Rotate a webhook secret](https://docs.tappay.mn/reference/webhook-endpoints/rotate-secret.md).

**Why.** Without a verified signature, anyone can send fake events to your server. An endpoint that gets every event does extra work and sees data that it does not need.

**How to check.** Send a test event with a wrong signature and confirm that your server rejects it. Open the endpoint and confirm that its event list has only the events you handle. See the [webhook guide](https://docs.tappay.mn/guides/webhooks.md) and the list of events in [Events](https://docs.tappay.mn/concepts/events.md).

## Idempotency-Key on every POST {#idempotency}

**What.** Send an `Idempotency-Key` header with every POST request. Use a new unique value for each action, and the same value when you retry that action.

**Why.** A retry after a timeout then does not create a second [invoice](https://docs.tappay.mn/glossary.md#invoice) or a second [refund](https://docs.tappay.mn/glossary.md#refund). The same key with a different body returns `409`.

**How to check.** Repeat one POST with the same key and confirm that you get the same result. Read [Idempotency](https://docs.tappay.mn/concepts/idempotency.md) for the rules.

## Do not trust the redirect {#do-not-trust-the-redirect}

**What.** When a [checkout session](https://docs.tappay.mn/glossary.md#checkout-session) sends the customer back to your `returnUrl`, do not mark the order as paid. Confirm the result with a webhook or with a `GET` request, for example [Retrieve a checkout session](https://docs.tappay.mn/reference/checkout-sessions/get.md).

**Why.** A customer can open the return address by hand or close the browser before it loads. Only your own server check shows the real status.

**How to check.** Open your `returnUrl` without paying. Confirm that your order stays unpaid until the webhook or the `GET` request shows a successful payment. Check that every `returnUrl` and `cancelUrl` is `https://` or an app scheme — production rejects `http://` ([Return addresses](https://docs.tappay.mn/guides/checkout.md#return-urls)).

## SDK configuration {#sdk-configuration}

**What.** Set `TAPPAY_SECRET_KEY` to your production key `sk_live_`. Set `TAPPAY_SIGNING_SECRET` when HMAC request signatures are on. Keep the webhook secrets in `TAPPAY_WEBHOOK_SECRET`, and during a rotation pass both secrets as `secrets: [new, old]`. Do not set `baseUrl` or `TAPPAY_BASE_URL` in production.

**Why.** The [SDK](https://docs.tappay.mn/sdks.md) takes the environment from the key prefix, so a live key reaches production by itself. A base URL override can send live requests to the wrong host.

**How to check.** Start your server with the production settings and make one read call. Confirm that `TAPPAY_BASE_URL` is empty and that the key starts with `sk_live_`. See [SDK configuration](https://docs.tappay.mn/sdks/node.md#configuration).
