# Playground

> Send real requests to the sandbox from the documentation with Try it, and see the webhooks they trigger in the webhook inbox.

Source: https://docs.tappay.mn/playground/

## Try it {#try-it}

Every API reference page has a **Try it** panel under the endpoint. It builds the request from the API schema: path, query, headers and body. It suggests an `Idempotency-Key` for you, and it shows the same request as curl.

Try it only reaches the [sandbox](https://docs.tappay.mn/glossary.md#sandbox). It never sends a request to [production](https://docs.tappay.mn/glossary.md#production), and production keys never appear on these pages.

After a request, the panel shows the status, the response headers and the body. An error response links to its code on the [errors page](https://docs.tappay.mn/errors.md). The panel then watches for about 30 seconds and lists the [events](https://docs.tappay.mn/glossary.md#event) your request created, with their delivery status.

## Modes {#modes}

| Mode | Where | Key |
| - | - | - |
| Your sandbox key | Sandbox merchant portal | Your sandbox session. You do not paste a key. |
| Your sandbox key | This site and the production merchant portal | Your sandbox sign-in. Use **Sign in to the sandbox** once. |
| Your own key | Everywhere | A `sk_test_` key that you paste. It stays in the page's memory only. |

The panel never stores a key in the browser, in the address or in logs. The curl example shows a placeholder key, or your own key when you paste one.

If an admin turned on required request signing for your sandbox merchant, the browser cannot sign for you. Use **Your own key** and paste your signing secret too. The panel then signs each request in the browser.

## Sign in to the sandbox {#sandbox-sign-in}

The sandbox has its own merchant portal and its own login. Choose **Sign in to the sandbox** in Try it. After you sign in, you come back to the same page.

Your first switch to the sandbox creates a sandbox merchant with a [secret key](https://docs.tappay.mn/glossary.md#secret-key) and a [publishable key](https://docs.tappay.mn/glossary.md#publishable-key). The portal shows both keys once, so save them. Each production merchant has one sandbox merchant, which the merchant team shares.

TapPay deletes a sandbox that you have not used for 90 days (the `docs.sandbox_inactive_days` setting). The audit log stays. If you switch to the sandbox again after that, you get a new sandbox merchant.

## Webhook inbox {#webhook-inbox}

Each sandbox merchant gets a hosted [webhook endpoint](https://docs.tappay.mn/glossary.md#webhook-endpoint) called the webhook inbox. TapPay sends events to it like to any other endpoint.

The inbox checks the [signature](https://docs.tappay.mn/glossary.md#signature) of each message with the same rules as your server should. It records whether the signature is valid and, if not, why: missing, mismatch or expired.

Open **Developers › Webhook inbox** in the sandbox merchant portal to see each message with its headers, body and signature result. You can also read it with the API at [`GET /v1/sandbox/webhook-inbox`](https://docs.tappay.mn/reference/sandbox/webhook-inbox.md).

The inbox keeps the last 200 valid messages and the last 20 invalid ones. If you delete or disable the inbox endpoint, choose **Restore inbox endpoint** on the same page.

## Rate limit {#rate-limit}

Sandbox requests, including Try it, use the same rate limit as production. The default limit is 60 requests per minute (the `api_rate_tier` setting). Above it, TapPay returns `429` with a `Retry-After` header.

## Next steps {#next-steps}

- [Test cards](https://docs.tappay.mn/glossary.md#test-card) and the [simulator](https://docs.tappay.mn/glossary.md#simulator): [Testing](https://docs.tappay.mn/testing.md)
- Verify webhook signatures on your server: [Webhooks](https://docs.tappay.mn/guides/webhooks.md)
