Pakistan (PKR ₨)
India (INR ₹)
Bangladesh (BDT ৳)
United States (USD $)
UAE (AED د.إ)
1. Pay-In / Cashier Checkout API
GET / POST Redirect
Redirect customer to our cashier endpoint. Supports EasyPaisa, JazzCash, All Commercial Banks & Raast QR:
https://pay.moklopay.com/pay/
| Parameter | Type | Requirement | Description |
|---|---|---|---|
mch_id | String | Required | Your Merchant ID (e.g. YOUR_MCH_ID) |
amount | Number | Required | Pay-In amount in PKR (e.g. 1000) |
order_id | String | Required | Unique order serial generated on your platform |
channel | String | Required | ep (EasyPaisa), jz (JazzCash), bank (All Banks QR) |
notify_url | String | Required | Your server webhook URL to receive payment confirmation |
return_url | String | Optional | Customer return page after payment completion |
PHP Pay-In Redirect Example
<?php
$mch_id = 'YOUR_MCH_ID';
$endpoint = 'https://pay.moklopay.com/pay/';
$params = [
'mch_id' => $mch_id,
'amount' => 1000.00,
'order_id' => 'ORD' . date('YmdHis') . rand(100, 999),
'channel' => 'ep', // Options: 'ep', 'jz', 'bank'
'notify_url' => 'https://yourwebsite.com/backend.php',
'return_url' => 'https://yourwebsite.com/return.php'
];
header("Location: " . $endpoint . "?" . http_build_query($params));
exit;
?>
Pay-In Webhook Receiver (backend.php)
PHP Webhook Receiver (backend.php)
<?php
$secret_key = 'YOUR_API_KEY';
$params = $_POST;
$sign = strtolower(trim($params['sign'] ?? ''));
unset($params['sign']);
ksort($params);
$signPairs = [];
foreach ($params as $k => $v) {
if ($v !== "" && $v !== null) $signPairs[] = $k . "=" . $v;
}
$calculated_sign = strtolower(md5(implode("&", $signPairs) . "&key=" . $secret_key));
if (strcasecmp($sign, $calculated_sign) === 0 && ($params['status'] ?? '') === '1') {
// 1. Fetch Order: $order_id = $params['out_trade_no'];
// 2. Credit Player: $amount = $params['pay_money'];
// 3. Mark Order Completed
echo "success";
exit;
}
echo "fail";
?>
2. Automated Payout / Disbursement API
POST / Server-to-Server (Zero OTP)
Send direct server-to-server HTTP POST requests to transfer funds to EasyPaisa, JazzCash, 1Link Bank, or USDT without any 2FA or OTP prompt:
https://payout.moklopay.com/payout/
| Parameter | Type | Requirement | Description |
|---|---|---|---|
mchId | String | Required | Your Merchant ID (YOUR_MCH_ID) |
out_trade_no | String | Required | Unique payout order serial from your platform |
money | Number | Required | Transfer amount in PKR |
pay_type | String | Required | EP (EasyPaisa), JZ (JazzCash), BANK, USDT |
account | String | Required | Receiver Mobile Number, IBAN, or USDT Wallet Address |
userName | String | Required | Receiver Full Account Title |
notify_url | String | Required | Webhook URL to receive final payout status |
sign | String | Required | MD5 signature: md5(alphabetized_params + "&key=api_key") |
PHP Payout Dispatch Script
<?php
$mch_id = 'YOUR_MCH_ID';
$api_key = 'YOUR_API_KEY';
$endpoint = 'https://payout.moklopay.com/payout/';
$data = [
'mchId' => $mch_id,
'out_trade_no' => 'WD' . date('YmdHis') . rand(100, 999),
'money' => 2500.00,
'pay_type' => 'EP', // Options: 'EP', 'JZ', 'BANK', 'USDT'
'account' => '03001234567',
'userName' => 'Muhammad Ali',
'notify_url' => 'https://yourwebsite.com/payout_callback.php'
];
ksort($data);
$signPairs = [];
foreach ($data as $k => $v) {
if ($v !== "" && $v !== null) $signPairs[] = $k . "=" . $v;
}
$data['sign'] = strtolower(md5(implode("&", $signPairs) . "&key=" . $api_key));
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$result = json_decode($res, true);
if ($result && ($result['code'] ?? -1) === 0) {
echo "Payout Queued! Payout ID: " . $result['payout_id'];
} else {
echo "Error: " . ($result['msg'] ?? 'Request declined');
}
?>
3. Realtime Balance Query API
POST / Instant JSON
Query current merchant ledger balance directly from external game servers or cashier scripts:
https://balance.moklopay.com/balance/
PHP Balance Check Script
<?php
$mch_id = 'YOUR_MCH_ID';
$api_key = 'YOUR_API_KEY';
$endpoint = 'https://balance.moklopay.com/balance/';
$params = [
'mchId' => $mch_id,
'currency' => 'PKR'
];
ksort($params);
$signPairs = [];
foreach ($params as $k => $v) {
if ($v !== "" && $v !== null) $signPairs[] = $k . "=" . $v;
}
$params['sign'] = strtolower(md5(implode("&", $signPairs) . "&key=" . $api_key));
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
curl_close($ch);
$data = json_decode($res, true);
echo "Current Ledger Balance: ₨ " . ($data['data']['balance'] ?? '0.00');
?>
© 2026 Moklo Pay • https://moklopay.com/