Developer Hub & Integration Center

Sawariya Pay brings secure, robust, and lightning-fast transaction pipelines to your own external website or test environments. Integrates smoothly using standard HTML, JavaScript, Node.js, and PHP scripts.

💡 Hinglish Guide Available: If you are starting out, use our step-by-step interactive builder to auto-generate fully custom copy-pasteable integration codes.

Step-by-Step Website Integration Guide (Hindi & English)

Follow these simple steps to integrate Sawariya Pay payment services directly into your own custom business website.

1
Create Account & Register Merchant

Sabse pehle Sawariya Pay par free account banayein aur login kijiye.

Go to Sign Up page and fill out your business profile. Inside your merchant dashboard, your personal Merchant ID (User UID) will be displayed on the top headers.

2
KYC Status Completion

Apne Account ko activate karne ke liye KYC status verify karein.

In your sidebar, click on KYC Status. Submit your business name, PAN number, Aadhaar Details, and Bank account specification (for settling payments). Once approved, live payments are activated!

3
Generate API Keys

"API Keys & Devs" section se secure token generate karein.

Go to the API Keys & Devs tab in the merchant dashboard. Click on Generate New API Key. Copy your Client secret securely — you will use this key inside your authorization headers to secure server-to-server orders.

4
Configure Allowed Domain (Whitelisting)

Apni website ka address domain list me add karein.

Inside the API Keys section, you will see Merchant API Allowed Domain. Enter your exact website URL (e.g., example.com or localhost:3000). Sawariya Pay will secure your token and automatically prevent unauthorized websites from spoofing your checkout.

5
Setup Webhooks & Copy-Paste Embed Code

Callback Webhook configure karke dynamic copy-paste integrate kijiye.

Set your custom Webhook Alert Endpoint. Use our Interactive Code Builder below to instantly generate pre-filled code customized specifically with your Merchant Key, amount and metadata, then paste it straight into your source code!

Interactive Integration Builder & Code Generator

Apne custom values fill kijiye aur realtime me ready-to-use checkout script, PHP code aur API templates generate kijiye.

Paste this embed code inside your client-side website (e.g., index.html) to render the premium payment popup automatically.


                

Recommended (Best for Single-Page HTML/PHP Sites): Save this code as a single file, e.g., pay.php on your server. It embeds the pay button, hides your API credentials securely on the server, avoids CORS blocks, and handles signature verification all in one file!


                

Use this lightweight server-side PHP script inside your checkout callback (e.g. create-order.php) to initiate order tokenizations securely.


                

Securely create backend orders on a modern Node.js framework using Express.


                

Authentication Headers

All backend server-side requests must authorize operations using your custom Merchant API Keys. Authenticate requests by attaching the following header configuration:

Authorization: Bearer YOUR_MERCHANT_API_KEY

Create Order API

Generate a unique checkout transaction order. Always execute order creation server-side to secure billing metrics.

POST /api/create-order.php
Request Body Payload:
{ "merchantId": "your_uid_here", "amount": 1000.00, "customerName": "John Doe", "customerEmail": "john@example.com" }

Verify Signature API

Confirm payment success securely by validating checkout signatures with Razorpay's cryptographic keys.

POST /api/verify-signature.php
Request Body Payload:
{ "razorpay_order_id": "order_HjKsD9aHsD", "razorpay_payment_id": "pay_HjKsL90AsD", "razorpay_signature": "cryptographic_hash_from_popup_modal" }

Allowed Domains & Whitelisting Security

Domain Whitelisting is an essential safety feature of Sawariya Pay. When configured, our API servers will refuse checkout request handshakes coming from unauthorized origins.

For active development, make sure to include localhost or 127.0.0.1. For production launch, update this in your Profile Settings to your custom domain such as example.com.

Webhooks & Instant Payment Notifications

Instead of periodically polling payment states, configure webhooks to receive direct real-time notifications on your backend server script immediately after successful merchant payments.

Sawariya Pay triggers webhook events with the following JSON post parameters:

{ "event": "payment.captured", "merchantId": "merchant_817293", "amount": 500.00, "payment_id": "pay_PLKsD8AksD", "signature": "cryptographic_integrity_signature_hash" }