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. |
Sending the keys #
Pay-in endpoints take the keys in the request: in the JSON body for POST, in the query string for GET.
{ "accessKey": "YOUR_ACCESS_KEY", "secretKey": "YOUR_SECRET_KEY", "…": "…" }https://api.royalpe.site/merchant/transaction-status?accessKey=YOUR_ACCESS_KEY&secretKey=YOUR_SECRET_KEY&transactionId=RP-7f3a9c21d84e5b02Payout endpoints take them as the accessKey and secretKey headers. See 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.
GETrequests 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.