Test Version — This website is for demonstration purposes only
العربيةGet startedSign in
  1. Home
  2. Developers

Build the payment experience your way.

Simple REST APIs, clear Arabic documentation, and a sandbox you can start with in minutes.

Introduction

This page is illustrative documentation for demo purposes. API URLs, keys and responses are not real.

The RPAD PAY API works over HTTPS and accepts and returns JSON. Amounts are sent in the smallest currency unit (halalas), so for example 29900 means SAR 299.00.

EnvironmentBase URL
Sandboxhttps://sandbox.api.rpadpay.example/v1
Productionhttps://api.rpadpay.example/v1

Authentication

Send your secret key in the Authorization header as a Bearer token. Keep the secret key on your server only, never in front-end or app code.

KeyPrefixUsage
Public keypk_test_Front end and payment forms
Secret keysk_test_Server only

Create a payment

POST/v1/payments

Create a new payment and get a checkout_url to send the customer to the checkout page.

# Illustrative example – sandbox
curl -X POST https://sandbox.api.rpadpay.example/v1/payments \
  -H "Authorization: Bearer sk_test_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 29900,
    "currency": "SAR",
    "description": "Men's thobe",
    "callback_url": "https://shop.example/payments/callback",
    "metadata": { "order_id": "ORD-1042" }
  }' 

Response

{
  "id": "pay_8f2k19dq0x",
  "object": "payment",
  "status": "initiated",
  "amount": 29900,
  "currency": "SAR",
  "description": "Men's thobe",
  "checkout_url": "https://checkout.rpadpay.example/pay_8f2k19dq0x",
  "created_at": "2026-01-24T10:24:00+03:00",
  "metadata": { "order_id": "ORD-1042" }
}

Fields

FieldTypeDescription
amountintegerAmount in halalas (required)
currencystringCurrency code, e.g. SAR (required)
descriptionstringDescription shown to the customer
callback_urlstringRedirect URL after payment
metadataobjectYour own extra data

Recurring Payments

POST/v1/subscriptions

Create a subscription with an interval of day or week or month or year.

curl -X POST https://sandbox.api.rpadpay.example/v1/subscriptions \
  -H "Authorization: Bearer sk_test_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "customer_id": "cus_51ka", "amount": 9900, "interval": "month", "start_date": "2026-01-24" }' 

Webhooks

We notify your endpoint when a payment status changes. Always verify the signature in the X-Rpad-Signature.

// Illustrative webhook signature check
import crypto from "node:crypto";

app.post("/webhooks/rpad", express.raw({ type: "application/json" }), (req, res) => {
  const signature = req.header("X-Rpad-Signature");
  const expected = crypto
    .createHmac("sha256", process.env.RPAD_WEBHOOK_SECRET)
    .update(req.body)
    .digest("hex");

  if (signature !== expected) return res.status(400).send("invalid signature");

  const event = JSON.parse(req.body);
  if (event.type === "payment.paid") {
    // Update the order status in your system
  }
  res.sendStatus(200);
});
EventWhen it is sent
payment.paidWhen a payment succeeds
payment.failedWhen a payment fails
refund.createdWhen a refund is created
payout.completedWhen a payout completes

Payment statuses

StatusMeaningBadge
initiatedPayment created, waiting for the customerinitiated
paidPayment succeededpaid
failedPayment failedfailed
refundedAmount refundedrefunded
expiredPayment or link expiredexpired

Test cards

Use any future expiry date and any 3-digit CVV in the sandbox. Illustrative numbers only.

NetworkCard numberResult
mada4464 0400 0000 0007Successful payment
Visa4111 1111 1111 1111Successful payment
Mastercard5555 5555 5555 4444Successful payment
Visa4000 0000 0000 0002Declined by bank

Libraries & plugins

Node.js

npm i @rpadpay/node

Coming soon

Python

pip install rpadpay

Coming soon

Store plugins

Plugins for popular platforms.

Coming soon

Ready to integrate?

Get your sandbox keys now.

Create a demo account