Skip to content

Go live

View as Markdown

Finish these seven checks in order before real customers pay. Each one says what to do, why it matters and how to check it. Test the same flow first in the sandbox, as described in Testing.

Production key

What. Use a production key that starts with sk_live_. It is a different key from your sandbox key. Keep the 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 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.

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 for the exact format.

Why. The 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

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. Then call it from a listed server and confirm that it works.

Webhook secret and endpoint

What. Give each webhook endpoint its own webhook secret. Verify every webhook over the raw body. Subscribe the endpoint only to the events that you need, and replace a secret with Rotate a webhook secret.

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 and the list of events in Events.

Idempotency-Key on every POST

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 or a second 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 for the rules.

Do not trust the redirect

What. When a 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.

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).

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 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.