TZPayWay TZPayWay
Sign in
API Key:
Developer API • v1.0 REST API

TZPayWay Developer Documentation

Accept customer deposits, request direct customer withdrawals (cashout via agent methods), and check account balances via bKash, Nagad, Rocket, Upay, and Cards.

API Base URL: https://tzpayway.com/api/v1

Core Features

Direct Customer Withdrawals

Submit customer cashout details directly via API without needing any checkout app redirect.

Instant Notifications

Get automated payment updates sent directly to your server as soon as an agent processes the transaction.

Dynamic Form Schemas

Fetch method definitions and field requirements dynamically to render clean forms in your app.

API Endpoints

Get Withdrawal Methods

Get all available payment gateway withdrawal methods along with their dynamic form input field definitions.

GET /api/v1/withdraw/methods

Headers

X-API-KEY header required

Field Object Schema

name string

Field key e.g. account_number.

label string

Display label e.g. bKash Personal / Agent Number.

type string

Input type e.g. text, number, or select.

required boolean

Whether this field is mandatory.

curl --request GET \
  --url https://tzpayway.com/api/v1/withdraw/methods \
  --header 'X-API-KEY: YOUR_API_KEY'
200 OK Response
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "bKash",
      "slug": "bkash",
      "currency": "BDT",
      "min_limit": 10.0,
      "max_limit": 25000.0,
      "charge_percent": 1.5,
      "fields": [
        {
          "name": "account_number",
          "label": "bKash Personal / Agent Number",
          "type": "text",
          "required": true,
          "placeholder": "01700000000"
        }
      ]
    }
  ]
}

API Endpoints

Create Customer Withdrawal

Create a customer withdrawal / cashout transaction directly via API. No checkout URL redirect is created.

Min/Max:
POST /api/v1/withdraw/create

Headers

X-API-KEY header required

Request Parameters ()

amount number required

Withdrawal amount e.g. 500.00.

method string required

Method slug e.g. .

user_data object required

Form fields required for :

webhook_url string optional

Your webhook callback URL for status updates.

curl --request POST \
  --url https://tzpayway.com/api/v1/withdraw/create \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data ''
200 OK Response
{
  "success": true,
  "message": "Withdrawal request created successfully.",
  "transaction": {
    "trx_id": "TZWDUJURCKD55W",
    "amount": 1.0,
    "currency": "",
    "method": "",
    "method_slug": "",
    "type": "withdrawal",
    "status": "assigned",
    "user_data": ,
    "created_at": "2026-08-06 19:50:00"
  }
}

API Endpoints

Check Merchant Balance

Get your current merchant account balance.

GET /api/v1/balance

Headers

X-API-KEY header required
curl --request GET \
  --url https://tzpayway.com/api/v1/balance \
  --header 'X-API-KEY: YOUR_API_KEY'
200 OK Response
{
  "success": true,
  "data": {
    "merchant_id": 1,
    "name": "Demo Merchant",
    "email": "[email protected]",
    "balance": 2540.50,
    "currency": "USD"
  }
}

Getting Started

Authentication

Send your API key in the request header to authenticate every request.

Request Header

X-API-KEY

Pass your API key in the X-API-KEY header on every API request.

X-API-KEY:
Secret Key

Secret Key

Keep this secret on your server. Used to verify and decrypt incoming webhook notifications.

Secret Key: sk_live_xxxxxxxx

Getting Started

Sandbox Testing

Test making payments and receiving webhook updates safely in test mode.

How to Test:

  • Go to your API Credentials page or set a test key above.
  • Click the Try Test Request button next to any endpoint.
  • Configure test parameters (amount, allowed payment methods).
  • Complete the test payment to verify instant webhook notifications.

API Endpoints

Deposit Methods

Get all available payment options for deposit (bKash, Nagad, Rocket, Upay, Cards).

GET /api/v1/payment/methods

Headers

X-API-KEY header required

Your active API key.

curl --request GET \
  --url https://tzpayway.com/api/v1/payment/methods \
  --header 'X-API-KEY: YOUR_API_KEY'
200 OK Response
{
  "success": true,
  "data": [
    {
      "name": "bKash",
      "slug": "bkash",
      "type": "mobile_banking"
    }
  ]
}

API Endpoints

Create Payment Link

Create a new deposit payment request and get a checkout page URL for your customer.

POST /api/v1/payment/create

Headers

X-API-KEY header required

Request Body

amount number required

Payment amount e.g. 100.00. Minimum amount is 10 BDT or 0.08 USD (configurable in Admin Settings).

currency string optional

Transaction currency (e.g. "BDT" or "USD"). Default is BDT, send "BDT" to create as BDT.

allowed_methods array optional

Specific methods to allow on checkout e.g. ["bkash", "nagad"].

country string optional

Country filter code (e.g. "BD").

webhook_url url optional

Instant payment callback notification webhook URL.

success_url url optional

Redirect URL after customer completes payment.

cancel_url url optional

Redirect URL if customer cancels checkout.

cus_name string optional

Customer name e.g. "John Doe" (nullable).

cus_email string optional

Customer email e.g. "[email protected]" (nullable).

cus_number string optional

Customer phone number e.g. "01700000000" (nullable).

fee_paid_by_user boolean optional

Set true to have customer pay deposit fees or false for merchant to pay. Defaults to your API key setting.

user_data object optional

Custom customer metadata payload returned in webhooks.

curl --request POST \
  --url https://tzpayway.com/api/v1/payment/create \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "amount": 100.00,
    "currency": "BDT",
    "cus_name": "John Doe",
    "cus_email": "[email protected]",
    "cus_number": "01700000000",
    "allowed_methods": ["bkash", "nagad"]
  }'
200 OK Response
{
  "success": true,
  "data": {
    "trx_id": "TZDUJURCKD55W",
    "payment_url": "https://tzpayway.com/pay/TZDUJURCKD55W",
    "amount": 100.00,
    "status": "pending"
  }
}

API Endpoints

Check Payment Status

Check the status of any payment using its transaction ID.

GET /api/v1/payment/status/{trx_id}

Headers

X-API-KEY header required

URL Parameters

trx_id string required

Transaction ID returned when creating the payment.

curl --request GET \
  --url https://tzpayway.com/api/v1/payment/status/TZDUJURCKD55W \
  --header 'X-API-KEY: YOUR_API_KEY'
200 OK Response
{
  "success": true,
  "data": {
    "trx_id": "TZDUJURCKD55W",
    "status": "completed",
    "amount": 100.00,
    "method": "bkash"
  }
}

Webhooks & Security

Webhook Notifications

Receive instant payment updates sent to your webhook URL. Payloads are encrypted with your Secret Key.

Sample Webhook Payload

{
  "event": "payment.completed",
  "trx_id": "TZDUJURCKD55W",
  "status": "completed",
  "amount": 100.00,
  "method": "bkash",
  "timestamp": 1788824293
}

Webhooks & Security

Error Codes

Common HTTP status codes returned by the API.

200 OK Request completed successfully.
400 Bad Request Missing required parameters in request body.
401 Unauthorized Missing or invalid X-API-KEY header.
404 Not Found Transaction ID not found.

Plugins & Extensions

Modules

Official drop-in payment gateway modules and plugins for popular platforms, scripts, and billing engines.

PTC & Viserlab (PTC-V1)

Viserlab / PTC Laravel Scripts
v1.0.0 Stable

Complete drop-in gateway module for Viserlab scripts (PTCLab, HyipLab, MicroLab, etc.) with instant automated IPN balance crediting and signature verification.

bKash Nagad Rocket Upay Bank Crypto
PHP 8.1 - 8.4 • Laravel 8.x - 11.x • Double-Check IPN

WooCommerce (Wordpress-Module)

WordPress & WooCommerce Gateway
v1.0.0 Stable

Official payment gateway module for WooCommerce stores. Accept bKash, Nagad, Rocket, Upay, Bank Cards, and Crypto with real-time IPN webhook order synchronization.

bKash Nagad Rocket Upay Bank Crypto
WordPress 5.6+ • WooCommerce 4.0+ • HPOS Ready • PHP 7.4 - 8.4

WHMCS Gateway (WHMCS-V1)

Web Hosting & Billing Automation
v1.0.0 Stable

Official payment gateway module for WHMCS hosting billing. Automatically mark invoices as paid, credit balances, and trigger automated service provisioning.

bKash Nagad Rocket Upay Bank Crypto
WHMCS 7.x & 8.x • PHP 7.4 - 8.4 • Auto Provisioning

Custom REST API SDK

Node.js, Python, PHP, Next.js
Open API

Connect any custom web application, backend service, or mobile app using our REST API endpoints, HMAC signature verification, and webhooks.

REST API JSON Payloads HMAC-SHA256
Full sandbox simulator • Automated test console

PTC-V1 Step-by-Step Installation Guide

Follow these simple steps to install the module in your Viserlab script.

1

Upload Module Files

Extract the downloaded ZIP archive and copy the core directory into your script's root directory:

core/app/Http/Controllers/Gateway/TZPAYWAY/ProcessController.php
2

Add IPN Webhook Routes

Open your script's routes/ipn.php file and append the following route definitions:

// TZPayWay Webhook IPN
Route::post('TZPAYWAY', 'TZPAYWAY\ProcessController@ipn')->name('TZPAYWAY');
Route::post('tzpayway', 'TZPAYWAY\ProcessController@ipn')->name('tzpayway');
3

Run Database SQL

Open your database manager (such as phpMyAdmin or TablePlus) and execute the SQL query:

INSERT INTO `gateways` (`code`, `name`, `alias`, `image`, `status`, `gateway_parameters`, `supported_currencies`, `crypto`, `description`, `created_at`, `updated_at`) 
VALUES 
(133, 'TZPAYWAY', 'TZPAYWAY', 'tzpayway.png', 1, '{"api_key":{"title":"API Key","global":true,"value":""},"secret_key":{"title":"Secret Key","global":true,"value":""},"api_url":{"title":"API Base URL","global":true,"value":"https://tzpayway.com"}}', '{"BDT":"BDT","USD":"USD"}', 0, 'Pay securely via bKash, Nagad, Rocket, Upay, Bank Transfer, and Crypto through TZPayWay.', NOW(), NOW())
ON DUPLICATE KEY UPDATE 
`name` = VALUES(`name`),
`alias` = VALUES(`alias`),
`gateway_parameters` = VALUES(`gateway_parameters`),
`supported_currencies` = VALUES(`supported_currencies`),
`updated_at` = NOW();
4

Configure in Admin Panel

1. Log in to your script's Admin Dashboard and navigate to Payment Gateways > Automatic Gateways.

2. Locate TZPAYWAY and click Edit.

3. Enter your credentials:

  • API Key: Your merchant API key from your TZPayWay dashboard.
  • Secret Key: Your secret key for HMAC signature verification.
  • API Base URL: https://tzpayway.com

4. Add supported currencies (such as BDT or USD), set your exchange rates and deposit limits, then enable the gateway.

WooCommerce Plugin Step-by-Step Installation Guide

Follow these simple steps to install the official TZPayWay payment gateway in your WordPress WooCommerce store.

1

Install and Activate Plugin

1. Download the ZIP file from GitHub.

2. In your WordPress Admin Dashboard, navigate to Plugins > Add New > Upload Plugin.

3. Choose the downloaded ZIP file, click Install Now, and then click Activate Plugin.

2

Navigate to Payment Gateway Settings

1. In your WordPress Admin Dashboard, go to WooCommerce > Settings.

2. Click on the Payments tab.

3. Locate TZPayWay in the list and click Manage (or Set up).

3

Configure Gateway Credentials

Enter your credentials from your TZPayWay Merchant Dashboard:

  • Enable/Disable: Check the box to enable the payment method.
  • API Key (X-API-KEY): Your merchant API key (e.g. pk_live_...).
  • Secret Key: Your merchant secret key for HMAC signature verification.
  • API Base URL: https://tzpayway.com
  • Successful Order Status: Select Processing or Completed.

Click Save changes.

4

Automated Webhooks & Instant Sync

The plugin automatically transmits your store's callback URL during checkout. When customers complete their bKash, Nagad, Card, or Crypto payment, TZPayWay instantly notifies your store, verifies signatures, completes the order, and reduces stock automatically.

https://your-domain.com/?wc-api=wc_gateway_tzpayway

WHMCS-V1 Step-by-Step Installation Guide

Follow these simple steps to install the module in your WHMCS billing system.

1

Upload Gateway Files

Extract the downloaded ZIP archive and upload the modules folder directly to your WHMCS root directory:

whmcs_root/modules/gateways/tzpayway.php
whmcs_root/modules/gateways/callback/tzpayway.php
2

Activate Gateway in WHMCS

1. Log in to your WHMCS Admin Dashboard.

2. Navigate to System Settings (or Setup > Payments) > Payment Gateways.

3. Select the All Payment Gateways tab, locate TZPayWay (bKash, Nagad, Rocket, Upay, Cards), and click Activate.

3

Configure Gateway Credentials

Enter your merchant credentials from your TZPayWay dashboard:

  • API Key: Your merchant API key from your TZPayWay dashboard.
  • Secret Key: Your secret key for HMAC-SHA256 signature verification.
  • API Base URL: https://tzpayway.com
  • Auto Redirect: Optionally enable instant redirection to the checkout screen.

Click Save Changes to save your configuration.

4

Automated Webhooks & Invoicing

The module automatically supplies your WHMCS callback URL on each checkout session. When a client completes payment, the webhook verifies the HMAC signature and automatically marks the invoice as Paid, credits client accounts, and triggers WHMCS automatic hosting provisioning hooks.

https://your-domain.com/modules/gateways/callback/tzpayway.php