RRoyal Pay API docs
Menu

Authentication

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

KeyLooks likeUsed for
Access keyaccess-…Identifies your merchant account in every request.
Secret keya long random stringProves the request is yours. It's shown once, when you rotate it.
Webhook signing key64 hex charactersChecks 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.

POST body
{ "accessKey": "YOUR_ACCESS_KEY", "secretKey": "YOUR_SECRET_KEY", "…": "…" }
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.

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.