API Documentation

REST API v1.0
Overview
Integrate secure PayIn collection and PayOut disbursement with high-speed webhooks.
Base API URL
https://nexivopay.pro/api/v1/
Official PHP Integration SDK
Complete boilerplate with PayIn, PayOut, and signed webhook handler.
Download SDK (.zip)
Request & Response Specs

All endpoints require HTTP POST with Content-Type: application/json. Every response is delivered as JSON with standard HTTP status codes.

Authentication
Every request to the API must include these HTTP headers for secure signature validation.
Header NameFormat / ExampleRequired
X-API-KeyYour primary API Key (from Merchant Dashboard)Yes
X-Merchant-IDYour registered identifier e.g. M2026XXXXXXYes
Content-Typeapplication/jsonYes
Your Secret Key is strictly used for verifying inbound webhook callback signatures and should never be transmitted in API headers.
Example Request Headers
X-API-Key: ak_live_382947190248102948
X-Merchant-ID: M2026E96939
Content-Type: application/json
Payment Channels
Available mobile financial channels and corresponding gateway routing codes.
ProviderMethod CodePayInPayOut
bKash 101 Active Active
Nagad 102 Active Active

Settlement currency for all channels is natively fixed to BDT (৳).

PayIn — Create Payment
Initialize a checkout session and redirect the user to the generated payment interface.
POST /api/v1/payin/create
Payload Parameters
FieldTypeDescriptionRequired
trx_idstringUnique reference ID generated by your platformYes
amountdecimalPayment amount (Min: ৳100.00, Max: ৳50,000.00)Yes
method_codeinteger101 = bKash, 102 = NagadYes
customer_namestringFull name of the payerYes
callback_urlstringYour webhook endpoint for signed instant updatesYes
customer_emailstringCustomer email addressOptional
customer_phonestringCustomer mobile numberOptional
return_urlstringURL to redirect the customer after paymentOptional
Implementation Example (PHP cURL)
$data = [
    'trx_id'        => 'ORDER-' . time(),
    'amount'        => 500.00,
    'method_code'   => 101,
    'customer_name' => 'Tanvir Ahmed',
    'callback_url'  => 'https://yourdomain.com/webhook/payin',
    'return_url'    => 'https://yourdomain.com/payment/success'
];

$ch = curl_init('https://nexivopay.pro/api/v1/payin/create');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS     => json_encode($data),
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
        'X-API-Key: YOUR_API_KEY',
        'X-Merchant-ID: YOUR_MERCHANT_ID'
    ]
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);

if (!empty($response['success']) && !empty($response['data']['payment_url'])) {
    header('Location: ' . $response['data']['payment_url']);
    exit;
}
JSON Success Response (200 OK)
{
    "success": true,
    "message": "Payment request created",
    "data": {
        "transaction_id": "TRX20261013ABC999",
        "trx_id": "ORDER-1791842966",
        "amount": 500.00,
        "currency": "BDT",
        "status": "pending",
        "payment_url": "https://nexivopay.pro/pay/TRX20261013ABC999"
    }
}
PayOut — Withdrawal
Instantly disburse funds to your customer's personal wallet via API.
POST /api/v1/payout/create
Payload Parameters
FieldTypeDescriptionRequired
trx_idstringYour unique withdrawal referenceYes
amountdecimalDisbursement amountYes
method_codeinteger101 = bKash, 102 = NagadYes
account_numberstring11-digit recipient mobile wallet numberYes
account_namestringFull name of the beneficiary accountYes
notify_urlstringWebhook URL for status updatesYes
JSON Success Response (200 OK)
{
    "success": true,
    "message": "Payout request submitted",
    "data": {
        "transaction_id": "OUT20261013PAY456",
        "trx_id": "WIT-88401",
        "amount": 1000.00,
        "fee": 0.00,
        "net_amount": 1000.00,
        "currency": "BDT",
        "status": "processing",
        "account_number": "017***5678"
    }
}
Check Status
Query the real-time processing status of any PayIn or PayOut request.
POST /api/v1/transaction/status
Request Payload
{
    "trx_id": "ORDER-1791842966"
}
Callback / Webhook
We dispatch an HTTP POST request to your callback URL with an HMAC SHA-256 signature immediately when a transaction status updates.
Always calculate and verify the signature before marking any order as paid. Return HTTP status 200 to acknowledge receipt.
Incoming Webhook Payload
{
    "transaction_id": "TRX20261013ABC999",
    "trx_id": "ORDER-1791842966",
    "type": "payin",
    "amount": 500.00,
    "currency": "BDT",
    "status": "completed",
    "signature": "e4ykY9OKJvjVxvrpOVaDfyQEl4UoLCa5CLAde8TwzDM"
}
Webhook Signature Verification (PHP)
$secretKey = 'YOUR_SECRET_KEY_FROM_MERCHANT_DASHBOARD';$rawInput  = file_get_contents('php://input');
$payload   = json_decode($rawInput, true);

if (!$payload) {
    http_response_code(400);
    exit('Invalid JSON');
}

$expectedSignature = hash('sha256', 
    $payload['transaction_id'] .$payload['trx_id'] . 
    $payload['status'] .$secretKey
);

if (hash_equals($expectedSignature,$payload['signature'] ?? '')) {
    if ($payload['status'] === 'completed') {
        // Credit the customer or fulfill the order
    }
    echo json_encode(['success' => true]);
} else {
    http_response_code(401);
    echo json_encode(['success' => false, 'message' => 'Invalid signature']);
}
Error Codes
Standard error responses returned by the payment gateway API.
Error CodeHTTP StatusReason
AUTH_FAILED401Missing or invalid X-API-Key / X-Merchant-ID headers
INSUFFICIENT_BALANCE402Merchant balance is lower than the requested payout amount
INVALID_PARAMS400Missing or invalid payload parameters
DUPLICATE_ORDER409Transaction reference (trx_id) has already been processed
SERVER_ERROR500Internal gateway error occurred