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.
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.
Headers
Field Object Schema
Field key e.g. account_number.
Display label e.g. bKash Personal / Agent Number.
Input type e.g. text, number, or select.
Whether this field is mandatory.
curl --request GET \
--url https://tzpayway.com/api/v1/withdraw/methods \
--header 'X-API-KEY: YOUR_API_KEY'
{
"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.
Headers
Request Parameters ()
Withdrawal amount e.g. 500.00.
Method slug e.g. .
Form fields required for :
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 ''
{
"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.
Headers
curl --request GET \
--url https://tzpayway.com/api/v1/balance \
--header 'X-API-KEY: YOUR_API_KEY'
{
"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.
X-API-KEY
Pass your API key in the X-API-KEY header on every API request.
X-API-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).
Headers
Your active API key.
curl --request GET \
--url https://tzpayway.com/api/v1/payment/methods \
--header 'X-API-KEY: YOUR_API_KEY'
{
"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.
Headers
Request Body
Payment amount e.g. 100.00. Minimum amount is 10 BDT or 0.08 USD (configurable in Admin Settings).
Transaction currency (e.g. "BDT" or "USD"). Default is BDT, send "BDT" to create as BDT.
Specific methods to allow on checkout e.g. ["bkash", "nagad"].
Country filter code (e.g. "BD").
Instant payment callback notification webhook URL.
Redirect URL after customer completes payment.
Redirect URL if customer cancels checkout.
Customer name e.g. "John Doe" (nullable).
Customer email e.g. "[email protected]" (nullable).
Customer phone number e.g. "01700000000" (nullable).
Set true to have customer pay deposit fees or false for merchant to pay. Defaults to your API key setting.
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"]
}'
{
"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.
Headers
URL Parameters
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'
{
"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": 1788821047
}
Webhooks & Security
Error Codes
Common HTTP status codes returned by the API.
Plugins & Extensions
Modules
Official drop-in payment gateway modules and plugins for popular platforms, scripts, and billing engines.
PTC & Viserlab (PTC-V1)
Complete drop-in gateway module for Viserlab scripts (PTCLab, HyipLab, MicroLab, etc.) with instant automated IPN balance crediting and signature verification.
WooCommerce (Wordpress-Module)
Official payment gateway module for WooCommerce stores. Accept bKash, Nagad, Rocket, Upay, Bank Cards, and Crypto with real-time IPN webhook order synchronization.
WHMCS Gateway (WHMCS-V1)
Official payment gateway module for WHMCS hosting billing. Automatically mark invoices as paid, credit balances, and trigger automated service provisioning.
Custom REST API SDK
Connect any custom web application, backend service, or mobile app using our REST API endpoints, HMAC signature verification, and webhooks.
PTC-V1 Step-by-Step Installation Guide
Follow these simple steps to install the module in your Viserlab script.
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
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');
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();
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.
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.
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).
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
ProcessingorCompleted.
Click Save changes.
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.
Upload Gateway Files
Extract the downloaded ZIP archive and upload the modules folder directly to your WHMCS root directory:
whmcs_root/modules/gateways/tzpayway.phpwhmcs_root/modules/gateways/callback/tzpayway.phpActivate 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.
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.
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