# Authentication

Your merchant workspace has three keys. Find them under **View keys** in the merchant portal.

| Key | Looks like | Used for |
|---|---|---|
| Access key | `access-…` | Identifies your merchant account in every request. |
| Secret key | a long random string | Proves the request is yours. It's shown **once**, when you rotate it. |
| Webhook signing key | 64 hex characters | Checks that a webhook really came from Royal Pay. See [Webhooks](https://docs.royalpe.site/webhooks#verify-the-signature). |

## Sending the keys

Pay-in endpoints take the keys in the request: in the JSON body for `POST`, in the query string for `GET`.

```json title="POST body"
{ "accessKey": "YOUR_ACCESS_KEY", "secretKey": "YOUR_SECRET_KEY", "…": "…" }
```

```bash title="GET query"
https://api.royalpe.site/merchant/transaction-status?accessKey=YOUR_ACCESS_KEY&secretKey=YOUR_SECRET_KEY&transactionId=RP-7f3a9c21d84e5b02
```

Payout endpoints take them as the `accessKey` and `secretKey` **headers**. See [Payouts](https://docs.royalpe.site/payouts).

A wrong or missing key answers `401` with `Invalid access key or secret key`.

## Keeping keys safe

- Call the API **from your server only**. Never put the secret key in a web page, mobile app or URL your users can see.
- `GET` requests carry the keys in the URL, so keep your server's outgoing request logs private.
- **Rotate** the secret key in the merchant portal (**Rotate keys**) if it may have leaked. The old secret stops working at once. The access key and the signing key stay the same.
- Every call is over HTTPS. Plain HTTP is refused.

---

Source: https://docs.royalpe.site/authentication · All docs: https://docs.royalpe.site/llms-full.txt · Updated 2026-11-30
