Production Core Architecture

GoPay Developer API Specification

Integration suite for automated BDT Collections, India UPI/INR Pay-In, USDT TRC20, and multi-channel payouts.

Gateway Authentication

Each API request requires your unique merchant authentication parameters available in your merchant console:

Parameter Description Format Example
appId Merchant Client Application ID / API Key String GP_99863898
secret_key Secret cryptographic merchant key token String (32-64 chars) 79b051de8e1a527cc02640e1a19365ac

1. Live Balance Query API

Query live balances across all channels or a single specified channel wallet (BDT, INR, and USDT).

POST GET https://api-pay.go-pay.pro/v1/Balance/bdt/index.php
Parameter Type Requirement Description
appId String REQUIRED Merchant App ID / API Key.
secret_key String REQUIRED Merchant secret token.
channel String / Int OPTIONAL Target channel: 1, 2, 3, 4, 5, or all (Default: all).
// Response JSON: All Allowed Channels
{
  "code": 200,
  "status": "SUCCESS",
  "message": "All permitted channel balances fetched successfully.",
  "data": {
    "merchant_id": "MID333255",
    "username": "fastwin",
    "allowed_currencies": "BDT,USDT",
    "channels": {
      "channel_1": { "channel_id": 1, "name": "Channel 1 ", "currency": "BDT", "balance": 1500.00 },
      "channel_2": { "channel_id": 2, "name": "Channel 2 ", "currency": "BDT", "balance": 3200.50 },
      "channel_3": { "channel_id": 3, "name": "Channel 3 ", "currency": "BDT", "balance": 500.00 },
      "channel_5": { "channel_id": 5, "name": "Channel 5 ", "currency": "USDT", "balance": 250.00 }
    },
    "total_bdt_balance": 5200.50,
    "total_usdt_balance": 250.00,
    "main_account_balance": 36950.50
  },
  "timestamp": "2026-09-29 18:30:00"
}
// Request JSON: channel=5
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_SECRET_KEY",
  "channel": 5
}

// Response JSON
{
  "code": 200,
  "status": "SUCCESS",
  "message": "Balance fetched for Channel 5 (EDPay USDT TRC20).",
  "data": {
    "merchant_id": "MID333255",
    "username": "fastwin",
    "channel": {
      "channel_id": 5,
      "name": "Channel 5 (EDPay USDT TRC20)",
      "currency": "USDT",
      "balance": 250.00
    }
  },
  "timestamp": "2026-09-29 18:31:00"
}
curl -X POST https://api-pay.go-pay.pro/v1/Balance/bdt/index.php \
  -H "Content-Type: application/json" \
  -d '{
    "appId": "GP_xxxxxxxx",
    "secret_key": "YOUR_SECRET_KEY",
    "channel": "all"
  }'

2. BDT Cashier Pay-In (Deposit) API

Create deposit orders for Bangladesh mobile wallets (bKash, Nagad, Rocket) and redirect users to the cashier payment page.

POST https://api-pay.go-pay.pro/v1/Collect/bdt/
Parameter Type Requirement Description
appId String REQUIRED Your Merchant App ID.
merOrderNo String REQUIRED Unique invoice transaction ID generated by your platform.
amount Decimal / Float REQUIRED Deposit amount in BDT (Minimum: 100.00).
payMethod String REQUIRED Wallet channel route: BKASH, NAGAD, ROCKET.
notifyUrl URL REQUIRED Server-to-server webhook callback URL for payment status.
returnUrl URL REQUIRED Customer redirect landing page after payment completion.
<!-- Direct Form Auto-Submit Example -->
<form id="gopay_checkout" action="https://api-pay.go-pay.pro/v1/Collect/bdt/" method="POST">
    <input type="hidden" name="appId" value="GP_xxxxxxxx">
    <input type="hidden" name="merOrderNo" value="ORD_<?php echo time(); ?>">
    <input type="hidden" name="amount" value="500.00">
    <input type="hidden" name="payMethod" value="NAGAD">
    <input type="hidden" name="notifyUrl" value="https://yourdomain.com/gopay_notify.php">
    <input type="hidden" name="returnUrl" value="https://yourdomain.com/payment_success.php">
</form>
<script>document.getElementById('gopay_checkout').submit();</script>
curl -X POST https://api-pay.go-pay.pro/v1/Collect/bdt/ \
  -d "appId=GP_xxxxxxxx" \
  -d "merOrderNo=ORD_1727642400" \
  -d "amount=500.00" \
  -d "payMethod=BKASH" \
  -d "notifyUrl=https://yourdomain.com/gopay_notify.php" \
  -d "returnUrl=https://yourdomain.com/payment_success.php"

3. India INR Direct Pay-In API

Create India UPI, QR & NetBanking deposit checkouts. Redirect users to the Indian payment gateway.

POST https://api-pay.go-pay.pro/indian_pay.php
Parameter Type Requirement Description
appId String REQUIRED Merchant App ID / API Key.
merOrderNo String REQUIRED Merchant invoice reference ID.
amount Decimal REQUIRED Deposit capital in INR (Min: 100.00 ₹).
payMethod String OPTIONAL Pass UPI, QR, or leave empty for all channels.
customer_name String OPTIONAL Payer name in English.
notifyUrl URL REQUIRED Webhook callback URL for settled transactions.
returnUrl URL REQUIRED Landing page after checkout completion.
<!-- India Pay-In Form Post -->
<form id="indian_checkout" action="https://api-pay.go-pay.pro/indian_pay.php" method="POST">
    <input type="hidden" name="appId" value="GP_xxxxxxxx">
    <input type="hidden" name="merOrderNo" value="INR_<?php echo time(); ?>">
    <input type="hidden" name="amount" value="1000.00">
    <input type="hidden" name="payMethod" value="UPI">
    <input type="hidden" name="customer_name" value="Amit Sharma">
    <input type="hidden" name="notifyUrl" value="https://yourdomain.com/indian_notify.php">
    <input type="hidden" name="returnUrl" value="https://yourdomain.com/payment_done.php">
</form>
<script>document.getElementById('indian_checkout').submit();</script>
curl -X POST https://api-pay.go-pay.pro/indian_pay.php \
  -d "appId=GP_xxxxxxxx" \
  -d "merOrderNo=INR_1727645500" \
  -d "amount=1000.00" \
  -d "payMethod=UPI" \
  -d "notifyUrl=https://yourdomain.com/indian_notify.php" \
  -d "returnUrl=https://yourdomain.com/payment_done.php"

4. Deposit Status Query API

Verify real-time settlement status of any inbound deposit invoice.

POST GET https://api-pay.go-pay.pro/v1/Deposit-Query/bdt/
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_MERCHANT_SECRET_KEY",
  "order_id": "2026092917882299"
}
{
  "code": 200,
  "status": "SUCCESS",
  "message": "Order fetched successfully.",
  "data": {
    "order_id": "2026092917882299",
    "merchant_id": "MID333255",
    "upstream_trade_no": "GP20260929113559",
    "channel_provider": "GOPAY",
    "method": "Nagad",
    "amount": 500.00,
    "fee": 9.25,
    "net_amount": 490.75,
    "status": "Success",
    "created_at": "2026-09-29 11:35:59"
  }
}

5. IPN Webhook Callback Handler

Webhook Signature Rule: GoPay delivers asynchronous callbacks with your secret_key parameter. You MUST verify this secret token and echo lowercase ok upon successful ledger update.
<?php
/**
 * Universal Webhook Listener (PHP)
 */
define('MY_GOPAY_SECRET', 'YOUR_MERCHANT_SECRET_KEY');

$rawPayload = file_get_contents("php://input");
$data = json_decode($rawPayload, true) ?: $_POST;

$receivedSecret = $data['secret_key'] ?? '';
$orderNo        = $data['merOrderNo'] ?? ($data['order_id'] ?? '');
$amount         = floatval($data['amount'] ?? 0);
$status         = strtoupper($data['orderStatus'] ?? ($data['status'] ?? ''));

// 1. Verify Secret Key Authenticity
if ($receivedSecret !== MY_GOPAY_SECRET) {
    http_response_code(403);
    echo "fail";
    exit;
}

// 2. Process Successful Transaction
if (!empty($orderNo) && ($status === 'SUCCESS' || $status === '1')) {
    // Check if order is already processed in your DB
    // Credit user account: $amount
    // Mark order status as Paid in your DB

    echo "ok"; // Mandatory: Echo exactly 'ok'
    exit;
}

echo "fail";
?>

6. Universal Pay-Out (Withdraw) API

Automated server-to-server outbound payout engine. Supports BDT (bKash/Nagad), India INR (UPI/Bank), and USDT TRC20[cite: 8].

POST https://api-pay.go-pay.pro/v1/Pay-Out/bdt/
Parameter Type Requirement Description
appId String REQUIRED Merchant App ID / API Key.
secret_key String REQUIRED Merchant secret key.
channel Integer REQUIRED Liquidity Wallet: 1, 2, 3 (BDT), 4 (INR), 5 (USDT TRC20).
amount Decimal REQUIRED Disbursal capital (Min: 100 for BDT/INR, 5 for USDT).
method String REQUIRED bkash, nagad, inr_bank, usdt_trc20.
receiver_phone String BDT OPTIONAL 11-digit mobile wallet number (For Ch 1, 2, 3).
receiver_name String OPTIONAL Recipient English account holder name.
account_no String INR ONLY Indian bank account number (Required for Channel 4).
ifsc_code String INR ONLY Indian bank IFSC code (Required for Channel 4).
usdt_address String USDT ONLY TRC20 Wallet address starting with 'T' (Required for Channel 5)[cite: 8].
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_MERCHANT_SECRET_KEY",
  "channel": 5,
  "amount": 20.00,
  "method": "usdt_trc20",
  "usdt_address": "TLNVbJs71RVpZavaNSFxH3uuegrqJnum91"
}
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_MERCHANT_SECRET_KEY",
  "channel": 2,
  "amount": 500.00,
  "method": "nagad",
  "receiver_phone": "01700000000",
  "receiver_name": "Rahim Khan"
}
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_MERCHANT_SECRET_KEY",
  "channel": 4,
  "amount": 1000.00,
  "method": "inr_bank",
  "account_no": "919876543210",
  "ifsc_code": "HDFC0001234",
  "receiver_name": "Amit Sharma"
}
{
  "code": 200,
  "status": "SUCCESS",
  "message": "Withdrawal processed and logged successfully.",
  "data": {
    "payout_id": "DF2026092918451198",
    "gateway_trade_no": "174372258",
    "merchant_id": "MID333255",
    "channel": 5,
    "currency": "USDT",
    "amount": 20.00,
    "fee": 0.10,
    "total_deduction": 20.10,
    "status": "Pending",
    "target_account": "TLNVbJs71RVpZavaNSFxH3uuegrqJnum91"
  },
  "timestamp": "2026-09-29 18:45:11"
}

7. Withdraw Status Query API

Query live status, gateway reference ID, and fee details of any payout transaction.

POST GET https://api-pay.go-pay.pro/v1/withdraw-Query/bdt/
{
  "appId": "GP_xxxxxxxx",
  "secret_key": "YOUR_MERCHANT_SECRET_KEY",
  "payout_id": "DF2026092918451198"
}
{
  "code": 200,
  "status": "SUCCESS",
  "message": "Withdrawal details fetched successfully.",
  "data": {
    "payout_id": "DF2026092918451198",
    "transfer_id": "174372258",
    "merchant_id": "MID333255",
    "channel_wallet": 5,
    "account_name": "USDT Payout",
    "mobile_number": "TLNVbJs71RVpZavaNSFxH3uuegrqJnum91",
    "method": "usdt_trc20",
    "amount": 20.00,
    "fee": 0.10,
    "net_amount": 20.00,
    "status": "Success",
    "created_at": "2026-09-29 18:45:11"
  }
}