Sopno Pay Developer Documentation
Integrate automated bKash, Nagad, Rocket, and Upay payments into your applications with zero hassle. Sopno Pay provides high-performance, drop-in compatibility with the UddoktaPay v2 standard.
If you are already using UddoktaPay's official PHP SDK, Laravel package, or WooCommerce plugin, simply set the API Base URL to https://sopnopay.pages.dev and enter your API Key.
Instant Auto Verification
SMS notifications are ingested in milliseconds to match TrxID and auto-complete transactions without manual review.
Fraud Protection
Built-in balance verification, duplicate TrxID guard, and timestamp integrity protect your business from fake SMS submissions.
Serverless Cloud Architecture
Powered by Cloudflare Global Edge with zero cold starts and 99.99% uptime for peak festival traffic.
Universal Plugins
Ready to integrate with WooCommerce, WHMCS, easy-to-use REST APIs, and instant webhook event notifications.
Authentication
Every API request made to Sopno Pay must authenticate using your unique API Key via the HTTP Header:
RT-UDDOKTAPAY-API-KEY: YOUR_API_KEY_HERE
Content-Type: application/json
Accept: application/json
Always keep your API Key secret on your secure backend server. Never expose it inside front-end client-side JavaScript, mobile app APKs, or public GitHub repositories.
Quickstart Guide
A standard payment flow consists of three straightforward steps:
- Create Session: Your backend sends a
POSTrequest to/api/checkout-v2with customer info and amount. - Redirect Customer: Redirect the customer to the returned
payment_urlto select their payment method and input their TrxID. - Verify & Credit: Receive the instant server-to-server Webhook notification, or call
/api/verify-paymentto verify before providing service.
Create Payment Session
Initialize a new payment checkout session and obtain the checkout redirect URL.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| full_name | string | Required | Customer's full name (e.g. Sohel Ahammad). |
| string | Required | Customer's valid email address. | |
| amount | number/string | Required | The amount to charge in BDT (e.g. 500). |
| redirect_url | string (url) | Required | The URL customer is redirected to after successful payment. |
| cancel_url | string (url) | Required | The URL customer is redirected to if they cancel checkout. |
| webhook_url | string (url) | Optional | Your server URL to receive real-time IPN Webhook updates. |
| metadata | object | Optional | Arbitrary key-value data to persist with invoice (e.g. {"order_id": "1002"}). |
curl -X POST https://sopnopay.pages.dev/api/checkout-v2 \
-H "Content-Type: application/json" \
-H "RT-UDDOKTAPAY-API-KEY: YOUR_API_KEY_HERE" \
-d '{
"full_name": "Rahim Ahmed",
"email": "rahim@example.com",
"amount": "500",
"metadata": {
"order_id": "ORD-9842"
},
"redirect_url": "https://yourwebsite.com/payment/success",
"cancel_url": "https://yourwebsite.com/payment/cancel",
"webhook_url": "https://yourwebsite.com/payment/webhook"
}'
Success Response (200 OK)
{
"status": true,
"message": "Payment session created",
"payment_url": "https://sopnopay.pages.dev/checkout?invoice=INV-66F12C9B8",
"invoice_id": "INV-66F12C9B8",
"amount": 500
}
Verify Payment
Verify the status and fetch complete details of any invoice using its invoice_id.
Request Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| invoice_id | string | Required | The unique Invoice ID returned by Checkout V2 (e.g. INV-66F12C9B8). |
curl -X POST https://sopnopay.pages.dev/api/verify-payment \
-H "Content-Type: application/json" \
-H "RT-UDDOKTAPAY-API-KEY: YOUR_API_KEY_HERE" \
-d '{
"invoice_id": "INV-66F12C9B8"
}'
Success Response: Completed Payment
{
"status": "COMPLETED",
"amount": "500",
"fee": "0",
"charged_amount": "500",
"full_name": "Rahim Ahmed",
"email": "rahim@example.com",
"payment_method": "bKash",
"sender_number": "01712345678",
"transaction_id": "BLA924KF8Q",
"date": "2026-10-06 14:32:10",
"metadata": {
"order_id": "ORD-9842"
}
}
Instant Webhook Notifications (IPN)
Whenever a customer completes payment on Sopno Pay, our engine immediately dispatches an HTTP POST request to your configured webhook_url.
Sopno Pay includes your RT-UDDOKTAPAY-API-KEY header in every webhook payload. Check that the incoming header matches your key before processing the order.
Webhook Payload Structure
{
"status": "COMPLETED",
"invoice_id": "INV-66F12C9B8",
"amount": "500",
"fee": "0",
"charged_amount": "500",
"payment_method": "bKash",
"sender_number": "01712345678",
"transaction_id": "BLA924KF8Q",
"date": "2026-10-06 14:32:10",
"metadata": {
"order_id": "ORD-9842"
}
}
Your webhook receiver script should respond with an HTTP status code 200 OK.
PHP & Laravel Code Examples
Complete drop-in code for standard PHP and Laravel frameworks:
<?php
$apiKey = "YOUR_API_KEY_HERE";
$apiEndpoint = "https://sopnopay.pages.dev/api/checkout-v2";
$data = [
"full_name" => "Rahim Ahmed",
"email" => "rahim@example.com",
"amount" => 500,
"metadata" => ["order_id" => "10023"],
"redirect_url" => "https://yourwebsite.com/payment/success.php",
"cancel_url" => "https://yourwebsite.com/payment/cancel.php",
"webhook_url" => "https://yourwebsite.com/payment/webhook.php"
];
$ch = curl_init($apiEndpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"RT-UDDOKTAPAY-API-KEY: " . $apiKey
]);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if (!empty($result['status']) && !empty($result['payment_url'])) {
// Redirect customer to Sopno Pay checkout
header("Location: " . $result['payment_url']);
exit;
} else {
echo "Error: " . ($result['message'] ?? 'Failed to create payment');
}
?>
Node.js & Express Examples
const express = require('express');
const app = express();
const API_KEY = "YOUR_API_KEY_HERE";
const API_URL = "https://sopnopay.pages.dev/api/checkout-v2";
app.post('/create-payment', async (req, res) => {
try {
const payload = {
full_name: req.body.name,
email: req.body.email,
amount: req.body.amount,
metadata: { order_id: req.body.orderId },
redirect_url: 'https://yourwebsite.com/payment/success',
cancel_url: 'https://yourwebsite.com/payment/cancel',
webhook_url: 'https://yourwebsite.com/payment/webhook'
};
const response = await fetch(API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'RT-UDDOKTAPAY-API-KEY': API_KEY
},
body: JSON.stringify(payload)
});
const data = await response.json();
if (data.status && data.payment_url) {
return res.redirect(data.payment_url);
}
return res.status(400).json({ error: data.message || 'Payment initiation failed' });
} catch (err) {
return res.status(500).json({ error: err.message });
}
});
Python Example
import requests
API_KEY = "YOUR_API_KEY_HERE"
API_URL = "https://sopnopay.pages.dev/api/checkout-v2"
headers = {
"Content-Type": "application/json",
"RT-UDDOKTAPAY-API-KEY": API_KEY
}
data = {
"full_name": "Rahim Ahmed",
"email": "rahim@example.com",
"amount": "500",
"metadata": {"order_id": "ORD-1234"},
"redirect_url": "https://yourwebsite.com/payment/success",
"cancel_url": "https://yourwebsite.com/payment/cancel"
}
response = requests.post(API_URL, json=data, headers=headers)
res_json = response.json()
if res_json.get("status"):
print("Redirect user to:", res_json.get("payment_url"))
else:
print("Error:", res_json.get("message"))
WordPress & WooCommerce Plugin
You can use standard UddoktaPay WooCommerce plugins directly with Sopno Pay:
- Install any UddoktaPay WooCommerce Gateway plugin in WordPress.
- Go to WooCommerce → Settings → Payments → UddoktaPay.
- In the API URL field, enter:
https://sopnopay.pages.dev/api/checkout-v2 - In the API Key field, paste your Sopno Pay API Key.
- Click Save Changes. Your store is now fully connected!
MFS SMS Automation
Sopno Pay matches incoming customer payments automatically by parsing bank & MFS transaction SMS messages from your Android phone:
Dual-SIM Support
Connect multiple SIMs simultaneously for separate bKash, Nagad, and Rocket numbers.
Anti-Fraud Balance Check
Calculates remaining balance differentials to stop counterfeit SMS scams instantly.
Connect Android App
Configure our Android SMS forwarder app on your transaction device:
| App Parameter | Recommended Value | Notes |
|---|---|---|
| Endpoint URL | https://sopnopay.pages.dev/home/add_data |
Webhook endpoint for incoming SMS ingestion. |
| Method | POST | Sends multipart/form-data or json logs. |
| Battery Optimization | Don't Optimize / Unrestricted |
Keeps foreground background service alive 24/7. |
Errors & Status Codes
| HTTP Status | Meaning | Common Solution |
|---|---|---|
200 OK |
Success | Request completed successfully. |
400 Bad Request |
Validation Error | Check missing parameters (e.g. amount, full_name, email). |
401 Unauthorized |
Invalid API Key | Verify that the RT-UDDOKTAPAY-API-KEY header contains a valid key. |
404 Not Found |
Invoice Not Found | The supplied invoice_id does not exist in the database. |
500 Server Error |
Internal Error | Ensure valid JSON request body. |