Local Payments API

Accept local payment methods in Pakistan, India, UAE, and Bangladesh. JazzCash, Easypaisa, NayaPay, SadaPay, UPI, bKash and more.

Separate API System • v1.1
Home Main API Docs Overview Pricing Countries How It Works API Reference Checkout API Admin API Examples
Overview Pricing & Packages Supported Countries How It Works Subscribe Get Subscription Manage Gateways Transactions Dashboard Regenerate Keys Authentication Get Methods Submit Payment Check Status Dashboard Default Gateways Subscriptions Process Transactions Business Gateways Code Examples Checkout Flow

Overview

The Local Payments API is a completely separate API system from the main ReyPub payment APIs. It enables businesses to accept local payment methods in Pakistan, India, UAE, and Bangladesh.

How It Works: Businesses subscribe to a Local Payments package, then enable payment methods (JazzCash, Easypaisa, etc.) they want to accept. The System Admin configures the actual payment account details (account numbers, bank info). Once admin sets up the details, customers can pay through the business checkout page. After paying, customers submit their transaction/reference ID which the Admin verifies and approves. Approved amounts are automatically credited to the business balance.
Important Change (v1.1): Gateway payment details (account numbers, bank info) are now configured by System Admin only. Businesses enable/disable payment methods but cannot edit account details directly. Transaction approval has also moved to Admin-only for security and compliance.

Key Features

  • Separate API keys - Local Payments uses its own X-LP-Key and X-LP-Secret headers
  • Admin-managed gateway details - Admin configures all payment account details for security
  • Business enables methods - Businesses choose which payment methods to offer, Admin sets up the details
  • Admin defaults - Admin can set default gateways that are copied when a business subscribes
  • Admin-only transaction approval - Admin verifies and approves/rejects all transactions
  • Auto-credit on approval - Approved amounts are automatically added to business balance
  • Multiple countries - Support for PK, IN, AE, BD with all local methods
  • 1% settlement fee - Only charged on approved transactions
  • Key regeneration - Businesses can regenerate LP API keys at any time

Pricing & Packages

Single Country

$50 one-time

Accept payments in one country

  • One country of your choice
  • All local payment methods
  • 1% settlement fee on approved payments
  • Dedicated LP API keys
  • Business dashboard
  • Transaction tracking
  • Checkout page integration
Settlement Fee: A 1% fee is charged only on approved/settled transactions. The fee is deducted automatically when a payment is approved. No charges on rejected or pending transactions.

Supported Countries & Methods

🇵🇰 Pakistan (PK)

Currency: PKR

  • JazzCash
  • Easypaisa
  • NayaPay
  • SadaPay
  • Bank Transfer (PK)

🇮🇳 India (IN)

Currency: INR

  • UPI
  • PayTM
  • PhonePe
  • Bank Transfer (IN)

🇦🇪 UAE (AE)

Currency: AED

  • InstaPay
  • Bank Transfer (UAE)

🇧🇩 Bangladesh (BD)

Currency: BDT

  • bKash
  • Nagad
  • Rocket
  • Bank Transfer (BD)

How It Works

1

Subscribe

Business subscribes to a Local Payments package ($50 single / $150 all countries)

2

Enable Methods

Business enables payment methods (JazzCash, bank, etc.) they want to accept

3

Admin Setup

System Admin configures the actual payment account details (numbers, bank info)

4

Customer Pays

Customer sees payment methods at checkout, pays to the shown details

5

Submit Reference

Customer enters the transaction/reference ID from their payment app

6

Admin Approves

System Admin verifies the payment reference and approves/rejects it

7

Auto-Credit

Approved payment is auto-credited to merchant balance (minus 1% fee)

Admin-Managed System: The admin sets up default gateways for all businesses. When a business subscribes, these defaults are automatically copied to their account. Businesses can enable/disable payment methods, but only Admin can configure payment account details and approve/reject transactions. This ensures security and prevents fraud.
Gateway Setup Flow:
1. Business enables a payment method (e.g. JazzCash) via dashboard or API
2. Gateway is created with status Pending Admin Setup
3. Admin configures the actual account details (number, title, bank info)
4. Business is notified and can toggle the gateway active/inactive
5. Business cannot enable a gateway until Admin has configured the details

Subscribe to Local Payments

POST /api/local-payments/subscribe
Subscribe to a Local Payments package. Requires business auth (Bearer token). Deducts package price from business balance.

Request Body

FieldTypeRequiredDescription
package_slugstringYes"single-country" or "all-countries"
countriesarrayFor singleArray of country codes, e.g. ["PK"]

Example

{
  "package_slug": "single-country",
  "countries": ["PK"]
}

Response

{
  "success": true,
  "data": {
    "subscription_id": 1,
    "package": "Single Country",
    "countries": ["PK"],
    "api_key": "lp_pk_...",
    "api_secret": "lp_sk_...",
    "settlement_fee": "1%",
    "price_charged": 50,
    "warning": "IMPORTANT: Save your API secret now."
  }
}

Get Subscription

GET /api/local-payments/subscription
Get current active subscription info. Requires business auth.

Manage Gateways

Important (v1.1): Businesses can only enable/disable payment methods. Admin configures all payment account details (account numbers, bank info, etc.). Businesses cannot edit gateway details directly.
GET /api/local-payments/gateways
List all your payment gateways. Optional ?country=PK filter. Returns gateways with their setup status.

Enable a Payment Method

POST /api/local-payments/gateways/enable
Enable a payment method for your business. Admin will be notified to configure the payment account details. Gateway starts in Pending Admin Setup state.

Request Body

FieldTypeRequiredDescription
countrystringYesCountry code: PK, IN, AE, BD (must be in your subscription)
method_typestringYese.g. jazzcash, easypaisa, bank_pk, upi, bkash

Example - Enable JazzCash

{
  "country": "PK",
  "method_type": "jazzcash"
}

Response

{
  "success": true,
  "message": "JazzCash enabled! Admin will set up the payment details. You will be notified once it is active."
}
Gateway States:
Pending Admin Setup - Method enabled, waiting for Admin to configure account details
Configured (Active) - Admin has set up details, gateway is live on checkout page
Configured (Disabled) - Gateway configured but temporarily disabled by business

Note: You cannot enable a gateway until Admin has configured the payment details.

Toggle Gateway Active/Inactive

PUT /api/local-payments/gateways/:id/toggle
Toggle a gateway on/off. Cannot enable if Admin hasn't configured details yet.

Response

{
  "success": true,
  "data": { "is_active": 1 },
  "message": "Gateway enabled"
}

Remove a Gateway

DELETE /api/local-payments/gateways/:id
Remove a gateway. If gateway has existing transactions, it will be disabled instead of deleted.

Transactions

GET /api/local-payments/transactions
List all local payment transactions. Supports pagination and filters: ?status=submitted, ?country=PK

Regenerate API Keys

POST /api/local-payments/regenerate-keys
Regenerate your LP API keys. Old keys become invalid immediately. Requires business auth (Bearer token).

Response

{
  "success": true,
  "data": {
    "api_key": "lp_pk_new_key...",
    "api_secret": "lp_sk_new_secret...",
    "warning": "IMPORTANT: Save your new API secret now. It will NOT be shown again. Old keys are now invalid."
  },
  "message": "API keys regenerated"
}
Warning: Regenerating keys will immediately invalidate your old keys. Any checkout pages or integrations using the old keys will stop working. Make sure to update all integrations with the new keys.
Transaction Approval: All local payment transactions are now reviewed and approved/rejected by the System Admin only. Businesses can view their transactions but cannot approve or reject them. Once Admin approves a transaction, the amount (minus 1% settlement fee) is automatically credited to the business balance.

Dashboard

GET /api/local-payments/dashboard
Get LP dashboard stats: subscription info, transaction counts, volumes.

Checkout API

Authentication: The Checkout API uses separate LP API keys. Include these headers in every request:

X-LP-Key: lp_pk_your_key
X-LP-Secret: lp_sk_your_secret

Checkout Authentication

Every checkout API call requires the X-LP-Key and X-LP-Secret headers. These are generated when you subscribe to Local Payments.

Get Payment Methods

GET /api/local-payments/checkout/methods
Get available payment methods for checkout. Optional ?country=PK filter. Returns account details for each method.

Response Example

{
  "success": true,
  "data": {
    "business_name": "MyShop",
    "countries": [
      {
        "country_code": "PK",
        "country_name": "Pakistan",
        "currency": "PKR",
        "methods": [
          {
            "id": 1,
            "method_type": "jazzcash",
            "method_name": "JazzCash",
            "account_title": "Ali Ahmed",
            "account_number": "03001234567",
            "instructions": "Send to this JazzCash number"
          },
          {
            "id": 2,
            "method_type": "easypaisa",
            "method_name": "Easypaisa",
            "account_title": "Ali Ahmed",
            "account_number": "03451234567"
          }
        ]
      }
    ]
  }
}

Submit Payment

POST /api/local-payments/checkout/pay
After customer pays to the shown details, submit the transaction/reference ID for verification.

Request Body

FieldTypeRequiredDescription
gateway_idintegerYesThe payment method ID from /checkout/methods
amountnumberYesAmount paid in local currency
reference_idstringYesTransaction ID / Reference number from payment app
order_idstringNoYour order/invoice ID
customer_namestringNoCustomer name
customer_emailstringNoCustomer email
customer_phonestringNoCustomer phone

Example

{
  "gateway_id": 1,
  "amount": 5000,
  "reference_id": "TXN123456789",
  "order_id": "ORD-001",
  "customer_name": "Muhammad Bilal",
  "customer_phone": "+923001234567"
}

Response

{
  "success": true,
  "data": {
    "transaction_id": "lp_abc123...",
    "status": "submitted",
    "amount": 5000,
    "currency": "PKR",
    "method": "JazzCash",
    "reference_id": "TXN123456789",
    "message": "Payment submitted for verification."
  }
}

Check Payment Status

GET /api/local-payments/checkout/status/:transaction_id
Check the status of a submitted payment.

Status Values

StatusDescription
pendingPayment created, awaiting customer action
submittedCustomer submitted transaction ID, awaiting verification
approvedPayment verified and approved, funds credited
rejectedPayment rejected (invalid reference, etc.)
expiredPayment expired without submission

Admin API

Admin endpoints for managing the Local Payments system. All require admin Bearer token authentication.

Admin Dashboard

GET /api/local-payments/admin/dashboard
Overview: subscriptions, transaction volumes, gateways, packages.

Default Gateways

Default gateways are template gateways that get copied to new business subscriptions. Set your own JazzCash, bank details here and they will be the default for all new businesses.

GET /api/local-payments/admin/default-gateways
List default gateways. Optional ?country=PK filter.
POST /api/local-payments/admin/default-gateways
Add a default gateway.
PUT /api/local-payments/admin/default-gateways/:id
Update a default gateway.
DELETE /api/local-payments/admin/default-gateways/:id
Delete a default gateway.

Manage Subscriptions

GET /api/local-payments/admin/subscriptions
List all LP subscriptions with business info.

Process Transactions (Admin Only)

All local payment transactions must be approved or rejected by Admin. This is the only way to process transactions - businesses cannot approve/reject.

GET /api/local-payments/admin/transactions
List all LP transactions. Filter by ?status=submitted, supports pagination.
POST /api/local-payments/admin/transactions/:id/process
Approve or reject a submitted LP transaction. On approval, amount minus settlement fee is auto-credited to business balance.

Request Body

{
  "action": "approve",  // or "reject"
  "admin_note": "Verified via JazzCash app - TXN confirmed"
}
On Approval: The transaction amount (minus settlement fee%) is automatically credited to the business balance. The business receives a notification about the approved payment.

Business Gateways (Admin)

GET /api/local-payments/admin/business/:bizId/gateways
List gateways for a specific business.
POST /api/local-payments/admin/business/:bizId/gateways
Add a gateway for a specific business.
PUT /api/local-payments/admin/gateways/:id
Update any business gateway.

Integration Examples

1. Subscribe to Local Payments (Business)

// Subscribe for Pakistan only ($50)
const response = await fetch('/api/local-payments/subscribe', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_BUSINESS_TOKEN'
  },
  body: JSON.stringify({
    package_slug: 'single-country',
    countries: ['PK']
  })
});
const data = await response.json();
// Save data.data.api_key and data.data.api_secret!

2. Enable JazzCash Gateway (Business)

// Business enables the method - Admin will configure the account details
await fetch('/api/local-payments/gateways/enable', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_BUSINESS_TOKEN'
  },
  body: JSON.stringify({
    country: 'PK',
    method_type: 'jazzcash'
  })
});
// Response: "JazzCash enabled! Admin will set up the payment details."
// Wait for Admin to configure details before gateway goes live

3. Checkout Flow (Customer Side)

// Step 1: Get payment methods
const methods = await fetch('/api/local-payments/checkout/methods?country=PK', {
  headers: {
    'X-LP-Key': 'lp_pk_...',
    'X-LP-Secret': 'lp_sk_...'
  }
});

// Step 2: Show payment details to customer
// Customer pays to the shown JazzCash/Bank details

// Step 3: Customer submits transaction ID
const payment = await fetch('/api/local-payments/checkout/pay', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-LP-Key': 'lp_pk_...',
    'X-LP-Secret': 'lp_sk_...'
  },
  body: JSON.stringify({
    gateway_id: 1,
    amount: 5000,
    reference_id: 'TXN123456789',
    order_id: 'ORD-001',
    customer_name: 'Muhammad Bilal'
  })
});

// Step 4: Check status
const status = await fetch(
  '/api/local-payments/checkout/status/' + payment.data.transaction_id,
  { headers: { 'X-LP-Key': 'lp_pk_...', 'X-LP-Secret': 'lp_sk_...' } }
);

4. Approve Payment (Admin Only)

// NOTE: Only Admin can approve/reject transactions
// Businesses can only VIEW their transactions
await fetch('/api/local-payments/admin/transactions/1/process', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ADMIN_TOKEN'
  },
  body: JSON.stringify({
    action: 'approve',
    admin_note: 'Verified via JazzCash app - TXN confirmed'
  })
});
// On approval: amount minus 1% fee auto-credited to business balance

5. Regenerate LP API Keys (Business)

const response = await fetch('/api/local-payments/regenerate-keys', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_BUSINESS_TOKEN'
  }
});
const data = await response.json();
// SAVE the new api_key and api_secret immediately!
// Old keys are now invalid

Checkout Flow Diagram

1

Load Methods

Call GET /checkout/methods to show available payment options

2

Select Method

Customer chooses JazzCash, bank, etc. Show account details

3

Customer Pays

Customer sends money to the displayed account via their app

4

Enter Reference

Customer enters the Transaction ID / Reference from their payment

5

Submit

Call POST /checkout/pay with gateway_id, amount, reference_id

6

Poll Status

Call GET /checkout/status/:id to check if approved