API Documentation
1. Security (AES-256-ECB)
All API requests to our Gateway are secured using AES-256-ECB encryption. This ensures that sensitive data cannot be tampered with or read during transit.
How it Works
- You prepare your payload as a JSON object.
- You encrypt the JSON string using AES-256-ECB with your
secret_key. - You Base64 encode the encrypted bytes.
- You send the request as
token=YOUR_TOKEN&payload=ENCRYPTED_STRING
Encryption Code (Node.js Example)
const crypto = require('crypto');
const secretKey = 'YOUR_SECRET_KEY';
function encryptPayload(jsonPayload, secret) {
const cipher = crypto.createCipheriv('aes-256-ecb', secret, '');
let encrypted = cipher.update(jsonPayload, 'utf8', 'base64');
encrypted += cipher.final('base64');
return encrypted;
}
const payloadJSON = JSON.stringify({ amount: 100, order_id: '123' });
const encryptedPayload = encryptPayload(payloadJSON, secretKey);
Encryption Code (PHP Example)
$secretKey = 'YOUR_SECRET_KEY';
$payloadJSON = json_encode(['amount' => 100, 'order_id' => '123']);
$encryptedPayload = base64_encode(openssl_encrypt($payloadJSON, 'aes-256-ecb', $secretKey, OPENSSL_RAW_DATA));
2. Create Order API (Pay-in)
This API is used to create a payment link and redirect your users to the checkout page.
Endpoint: POST https://pay.paisapay.site/create_order.php
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Your unique API token |
payload | string | Yes | Base64 encoded AES-256 encrypted JSON string |
Payload JSON Structure (Before Encryption)
{
"order_id": "ORD_987654321",
"amount": "500.00",
"customer_mobile": "9876543210",
"udf1": "GAME_USER_123",
"redirect_url": "https://yourwebsite.com/payment_success"
}
Form Submission Example (HTML)
<form action="https://pay.paisapay.site/create_order.php" method="POST">
<input type="hidden" name="token" value="YOUR_TOKEN">
<input type="hidden" name="payload" value="ENCRYPTED_PAYLOAD_STRING">
<button type="submit">Pay Now</button>
</form>
3. Create Payout API
This API is used to programmatically send money to your customers' bank accounts from your wallet balance. Unlike Pay-in, this API returns a JSON response immediately.
Endpoint: POST https://pay.paisapay.site/create_payout.php
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | Your unique API token |
payload | string | Yes | Base64 encoded AES-256 encrypted JSON string |
Payload JSON Structure (Before Encryption)
{
"order_id": "PAYOUT_12345",
"amount": "2500.00",
"account_number": "01234567890",
"ifsc_code": "SBIN0001234",
"holder_name": "John Doe",
"bank_name": "State Bank of India"
}
Note: Minimum payout amount is 2000.
Response Format (JSON)
When you successfully hit this API, the response will be:
{
"status": "PENDING",
"order_id": "PAYOUT_12345",
"message": "Payout request queued successfully"
}
PENDING status means the request is successfully queued. Once the gateway processes and clears the payment, you will receive a Webhook callback at your registered callback_url with the SUCCESS or FAILED status, similar to Pay-ins.
4. Webhook Callbacks
When a payment (Pay-in) or a payout is successfully processed or failed, our system will send a POST request to your callback_url.
Callback Request Format
The webhook sends data via POST using URL-encoded form data:
| Parameter | Description |
|---|---|
token | Your API token (to identify the merchant) |
payload | The AES-256-ECB encrypted JSON payload containing the callback data |
Decrypted Callback JSON Format
{
"order_id": "WD_12345",
"amount": "500.00",
"status": "SUCCESS",
"payment_time": "2026-09-15 13:10:00",
"udf1": "GAME_USER_123"
}
Decryption Code (PHP Example)
<?php
$secretKey = 'YOUR_SECRET_KEY';
$payload = $_POST['payload'] ?? '';
$payload = str_replace(' ', '+', $payload); // Ensure Base64 is preserved
$decrypted = openssl_decrypt(base64_decode($payload), 'aes-256-ecb', $secretKey, OPENSSL_RAW_DATA);
$callback_data = json_decode($decrypted, true);
if ($callback_data) {
if ($callback_data['status'] === 'SUCCESS') {
// Update user balance in your system
}
echo "success"; // Important: Acknowledge the webhook
}
?>