V2.5 ENTERPRISE

API Integration Documentation

Automate payins, generate round-robin QR sessions, and receive real-time webhook events.

1. Authentication

All requests are authenticated using your api_key. You can obtain your keys from the Merchant Hub.

Base URL: https://npfast.site/api/

2. Create Payment Session

Create a new checkout session. Returns a session token and hosted checkout_url.

Endpoint:
POST https://npfast.site/api/create_payment.php
PHP cURL Example:
<?php
$payload = [
    'api_key'         => 'pk_live_your_api_key_here',
    'amount'          => 2500.00,
    'order_id'        => 'ORDER_' . time(),
    'customer_name'   => 'Ali Khan',
    'customer_mobile' => '03001234567'
];

$ch = curl_init('https://npfast.site/api/create_payment.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);

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

if ($response['status'] === 'success') {
    // Redirect customer to checkout URL:
    header('Location: ' . $response['checkout_url']);
    exit;
}
?>
Sample JSON Response:
{
  "status": "success",
  "order_id": "PAY_98F012DA",
  "amount": 2500.00,
  "currency": "PKR",
  "checkout_url": "https://npfast.site/checkout.php?order=PAY_98F012DA",
  "easypaisa": {
    "account_number": "PK68UMBL0000033401613495",
    "account_title": "ASEET - 3495"
  }
}

3. Webhook Notification

Our matching engine verifies the transaction and delivers an instant HTTP POST callback to your configured webhook_url.

Webhook JSON Payload:
{
  "event": "payment.paid",
  "order_id": "PAY_98F012DA",
  "merchant_order_ref": "ORDER_1792306116",
  "amount": 2500.00,
  "currency": "PKR",
  "trx_id": "402089985762",
  "sender_mobile": "03331234567",
  "status": "paid",
  "timestamp": "2026-10-18 12:00:00"
}

4. Status Query API

Query the status of any payment order directly from your server:

GET https://npfast.site/api/check_status.php?order_id=PAY_98F012DA&api_key=pk_live_your_key