# Royal Pay API

Royal Pay takes deposits from your users through a hosted checkout. You create a pay-in from your server, send the user to the checkout link, and Royal Pay tells your server the result by webhook.

| | |
|---|---|
| **API base URL** | `https://api.royalpe.site` |
| **Checkout** | `https://pay.royalpe.site/gateway/…`, a link you get for each pay-in |
| **Format** | JSON over HTTPS. Amounts are in rupees (INR), up to 2 decimals. |
| **Times** | ISO 8601, UTC (for example `2026-11-30T10:15:00.000Z`) |

## How a pay-in works

1. **Create** the pay-in from your server: [`POST /merchant/initial-payment`](https://docs.royalpe.site/payins/create). You get a `paymentUrl` and a `transactionId`.
2. **Redirect** your user to `paymentUrl`. The checkout shows a UPI QR, the UPI ID, app buttons, or bank details.
3. The user **pays** in their UPI app and uploads the payment screenshot. Royal Pay reads the UTR from it.
4. Royal Pay **verifies** the payment and sends your `webhookUrl` the result: `approved`, `rejected` or `cancelled`. See [Webhooks](https://docs.royalpe.site/webhooks).
5. You **credit** the user once, on `approved`. When you're unsure, ask [`GET /merchant/transaction-status`](https://docs.royalpe.site/payins/status).

## Quick start

```bash title="cURL"
curl -X POST https://api.royalpe.site/merchant/initial-payment \
  -H "Content-Type: application/json" \
  -d '{
    "accessKey": "YOUR_ACCESS_KEY",
    "secretKey": "YOUR_SECRET_KEY",
    "amount": 500,
    "orderId": "ORDER-10045",
    "userId": "USER-881",
    "webhookUrl": "https://shop.example.com/royalpay/webhook",
    "redirectUrl": "https://shop.example.com/deposit/done"
  }'
```

```json title="Response"
{
  "success": true,
  "message": "Payment URL generated successfully",
  "data": {
    "paymentUrl": "https://pay.royalpe.site/gateway/Xq3v9KfP2mZt7LbR8sWn4cYd1HgJ6aEu0oTi5kNp",
    "orderId": "ORDER-10045",
    "transactionId": "RP-7f3a9c21d84e5b02",
    "amount": 500,
    "status": "progress",
    "userId": "USER-881"
  }
}
```

## Pages

- [Authentication](https://docs.royalpe.site/authentication): your access key, secret key and webhook signing key.
- [Create a pay-in](https://docs.royalpe.site/payins/create), [Pay-in status](https://docs.royalpe.site/payins/status), [Submit a UTR](https://docs.royalpe.site/payins/manual-utr).
- [Webhooks](https://docs.royalpe.site/webhooks): payload, signature check, retries.
- [Hosted checkout](https://docs.royalpe.site/checkout): what your user sees, the secure session, cancellation.
- [Statuses](https://docs.royalpe.site/statuses), [Errors](https://docs.royalpe.site/errors), [Payouts](https://docs.royalpe.site/payouts), [Going live](https://docs.royalpe.site/going-live), [Changelog](https://docs.royalpe.site/changelog).

## For AI agents

These docs are plain HTML that reads without JavaScript. Every page is also available as Markdown: add `.md` to its address, or send `Accept: text/markdown`.

- [`/llms.txt`](https://docs.royalpe.site/llms.txt): an index of every page.
- [`/llms-full.txt`](https://docs.royalpe.site/llms-full.txt): all the docs in one Markdown file.
- [`/openapi.json`](https://docs.royalpe.site/openapi.json): the API as OpenAPI 3.1.

---

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