Documentation
Payment gateway API

Welcome to Nxspay Docs

Nxspay is a simple and secure payment automation tool that lets you use a personal account as a payment gateway, so you can accept payments from customers on your website. Here you will find how Nxspay works and how to integrate the Nxspay API into your site.

Last updated: 2026-11-16

POST https://secure.nxspay.shop/api/payment/create
// headersAPI-KEY: your_app_keyContent-Type: application/json// body{ "amount": "10", "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel"}
200 Response
{ "status": true, "message": "Payment link created", "payment_url": "https://secure.nxspay.shop/..."}
  1. 1

    Create a payment

    Send the order to api/payment/create with your API key.

  2. 2

    Customer pays

    Redirect the customer to the returned payment_url to complete payment.

  3. 3

    Verify the result

    Confirm the transaction_id with api/payment/verify.

Quick Start

নতুন ইউজারদের জন্য চারটি ধাপে শুরু করুন। API key কোথায় পাবেন তা এখানে স্পষ্ট করা হয়েছে।

  1. 1

    অ্যাকাউন্ট খুলুন

    সাইটে রেজিস্টার করে লগইন করুন। ইমেইল ভেরিফাই সম্পন্ন করুন।

  2. 2

    Brand তৈরি করুন

    ড্যাশবোর্ড → Brands → Add Brand। ডোমেইন ও ব্র্যান্ড নাম দিন। ব্র্যান্ড অ্যাকটিভ করুন।

  3. 3

    API key কপি করুন

    Brand ডিটেইলস পেজে brand_key দেখতে পাবেন। এটাই আপনার API-KEY হেডার। কেউ সাথে শেয়ার করবেন না।

  4. 4

    প্রথম রিকোয়েস্ট পাঠান

    api/payment/create-এ amount, success_url, cancel_url পাঠিয়ে payment_url নিন এবং কাস্টমারকে রিডাইরেক্ট করুন।

Supported Payment Methods

নিচের মেথডগুলো প্ল্যাটফর্মে সাপোর্টেড। মার্চেন্ট তার ব্র্যান্ড সেটিংস থেকে কোনগুলো অ্যাকটিভ রাখবেন তা বেছে নিতে পারেন।

bKash
Nagad
Rocket
Upay
Cellfin
SureCash
Ok Wallet
MCash
myCash
DBBL
Brac Bank
Bank Asia
Agrani Bank
Islamic Bank
Binance
PayPal
Payeer
Coinbase

Status & Transaction Lifecycle

একটি পেমেন্ট কীভাবে অবস্থা বদলায়:

Statusঅর্থপরবর্তী ধাপ
PENDING পেমেন্ট তৈরি হয়েছে, কাস্টমার এখনো শেষ করেনি বা যাচাই চলছে Webhook অপেক্ষা / Verify API কল
COMPLETED পেমেন্ট সফলভাবে সম্পন্ন অর্ডার ফুলফিল করুন, webhook-এ status=2 আসবে
ERROR ব্যর্থ / বাতিল / অবৈধ কাস্টমারকে আবার চেষ্টা করতে বলুন
Create → Customer pays → PENDING → (auto match / manual) → COMPLETED or ERROR ↓ Webhook (IPN) POST to your webhook_url

Modules & Mobile App

Ready-made plugins, modules and the mobile app to connect Nxspay with your existing platform in minutes.

WooCommerce Plugin

Official WordPress WooCommerce plugin to accept Nxspay payments on your store.

WHMCS Module

Automate invoice payments and client billing directly inside your WHMCS panel.

SmmPanel Module

Drop-in modified SMM panel module with Nxspay integrated as a payment method.

Mobile App

Verify transactions on the go — connect the Android app with your live API keys.

Sketchware Module

Ready-made block & module to accept Nxspay payments inside your Sketchware app projects.

API Introduction

Nxspay Payment Gateway enables Merchants to receive money from their customers by temporarily redirecting them to secure.nxspay.shop. The gateway is connecting multiple payment terminals including card systems, mobile financial systems, local and International wallets. After the payment is complete, the customer is returned to the merchant's site and seconds later the Merchant receives notification about the payment along with the details of the transaction. Working knowledge of HTML forms or cURL is required.

API Operation

REST APIs are supported in two environments. Use the Sandbox environment for testing purposes, then move to the live environment for production processing. When testing, generate an order url with your test credentials to make calls to the Sandbox URIs.

Live API End Point (For Create Payment URL):

https://secure.nxspay.shop/api/payment/create

Payment Verify API:

https://secure.nxspay.shop/api/payment/verify

Parameter Details

Variables Need to POST to Initialize Payment Process in gateway URL
Field Name Description Required Example Values
cus_name Customer Full Name Yes John Doe
cus_email Email address of the customer Yes john@gmail.com
amount The total amount payable. Please note that you should skip the trailing zeros. Yes 10 or 10.50
success_url URL to which the customer will be returned when the payment is made successfully. Yes https://yourdomain.com/success.php
cancel_url URL to return customer to your product page or home page. Yes https://yourdomain.com/cancel.php
webhook_url IPN callback URL No https://yourdomain.com/webhook.php
meta_data Extra data formatted as JSON No Json Formatted
Variables Needs For Payment Verify
Field Name Description Required Example Values
transaction_id Transaction id received as a query parameter from the success URL. Yes OVKPXW165414

Headers Details

Header Name Value
Content-Type application/json
API-KEY App key From Brands

Verify Response

api/payment/verify সফল হলে যে ফিল্ডগুলো ফেরত আসে:

Field Type Description
cus_namestringCustomer full name
cus_emailstringCustomer email
amountstring/numberPaid amount
transaction_idstringUnique transaction id
metadataobject/stringআপনার পাঠানো extra data
payment_methodstringযেমন bkash, nagad
status string PENDING COMPLETED ERROR

Example success response:

{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "10", "transaction_id": "OVKPXW165414", "metadata": {"phone": "016****"}, "payment_method": "bkash", "status": "COMPLETED"
}

Webhook (IPN)

পেমেন্ট সম্পন্ন হলে সার্ভার আপনার webhook_url-এ POST করে (application/x-www-form-urlencoded)। পে-লোড:

FieldDescriptionExample
paymentMethodPayment channelbkash
transactionIdTransaction idOVKPXW165414
paymentAmountAmount paid10
paymentFeeFee charged0
status2 = success2

PHP receiver example:

<?php
// webhook.php — আপনার সার্ভারে রাখুন
$paymentMethod = $_POST['paymentMethod'] ?? '';
$transactionId = $_POST['transactionId'] ?? '';
$paymentAmount = $_POST['paymentAmount'] ?? '';
$paymentFee = $_POST['paymentFee'] ?? '';
$status = $_POST['status'] ?? '';
if ((string)$status === '2' && $transactionId !== '') { // TODO: order mark as paid (idempotent রাখুন — একই trx_id দুইবার এলে ডুপ্লিকেট না হয়) // verify API দিয়ে আবার চেক করা ভালো প্র্যাকটিস http_response_code(200); echo 'OK';
} else { http_response_code(400); echo 'Ignored';
}
Webhook না এলে বা ব্যর্থ হলে Verify API দিয়ে transaction_id চেক করুন। আপনার endpoint-এ ২xx রেসপন্স দিন, নাহলে রিট্রাই হতে পারে।

Error Codes

Message / CodeHTTPমানে কীকীভাবে ঠিক করবেন
Invalid API request 400 রিকোয়েস্ট ফরম্যাট বা হেডার ভুল Content-Type: application/json ও সঠিক API-KEY দিন
Required field missing 400 বাধ্যতামূলক ফিল্ড বাদ পড়েছে cus_name, cus_email, amount, success_url, cancel_url চেক করুন
Metadata must be in JSON format. 400 metadata অবজেক্ট/JSON নয় metadata-কে valid JSON object হিসেবে পাঠান
Your request with Invalid Parameters. 400 প্যারামিটারের মান অবৈধ amount সংখ্যা, URL-গুলো absolute https কিনা দেখুন

Live API Tester

API key শুধু আপনার ব্রাউজারে থাকে — সার্ভারে সেভ হয় না। প্রোডাকশন key সতর্কতার সাথে ব্যবহার করুন। CORS চালু না থাকলে ব্রাউজার থেকে কল ব্যর্থ হতে পারে; সেক্ষেত্রে cURL/Postman ব্যবহার করুন।
{}

Integration

You can integrate our payment gateway into your PHP Laravel WordPress WooCommerce sites.

Sample Request

<?php$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://secure.nxspay.shop/api/payment/create', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","metadata":{"phone":"016****"},"amount":"10"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json' ),));$response = curl_exec($curl);curl_close($curl);echo $response;?> 
<?php$client = new Client();$headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json'];$body = '{ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "webhook_url": "yourdomain.com/webhook", "metadata": { "phone": "016****" }, "amount": "10"}';$request = new Request('POST', 'https://secure.nxspay.shop/api/payment/create', $headers, $body);$res = $client->sendAsync($request)->wait();echo $res->getBody();?> 
const axios = require('axios');let data = JSON.stringify({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "webhook_url": "yourdomain.com/webhook", "metadata": { "phone": "016****" }, "amount": "10"});let config = { method: 'post', maxBodyLength: Infinity, url: 'https://secure.nxspay.shop/api/payment/create', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json' }, data : data};axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);}); 
import requestsimport jsonurl = "https://secure.nxspay.shop/api/payment/create"payload = json.dumps({ "success_url": "yourdomain.com/success", "cancel_url": "yourdomain.com/cancel", "webhook_url": "yourdomain.com/webhook", "metadata": { "phone": "016****" }, "amount": "10"})headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json'}response = requests.request("POST", url, headers=headers, data=payload)print(response.text) 
package mainimport ( "fmt" "strings" "net/http" "io/ioutil")func main() { url := "https://secure.nxspay.shop/api/payment/create" method := "POST" payload := strings.NewReader(`{"success_url":"yourdomain.com/success","cancel_url":"yourdomain.com/cancel","webhook_url":"yourdomain.com/webhook","metadata":{"phone":"01521412457"},"amount":"10"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))} 
curl -X POST 'https://secure.nxspay.shop/api/payment/create' \\ -H 'API-KEY: your_api_key_here' \\ -H 'Content-Type: application/json' \\ -d '{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "10", "success_url": "https://yourdomain.com/success", "cancel_url": "https://yourdomain.com/cancel", "webhook_url": "https://yourdomain.com/webhook", "metadata": {"phone": "016****"} }' 

Response Details

Field Name Type Description
Success Response
status bool TRUE
message String Message for Status
payment_url String Payment Link (where customers will complete their payment)
Error Response
status bool FALSE
message String Message associated with the error response
Completing the payment page task, you will be redirected to the success or cancel page based on the transaction status, with the following query parameters: yourdomain.com/(success/cancel)?transactionId=******&paymentMethod=***&paymentAmount=**.**&paymentFee=**.**&status=pending or success or failed

Verify Request

<?php$curl = curl_init();curl_setopt_array($curl, array( CURLOPT_URL => 'https://secure.nxspay.shop/api/payment/verify', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{"transaction_id":"ABCDEFH"}', CURLOPT_HTTPHEADER => array( 'API-KEY: gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type: application/json' ),));$response = curl_exec($curl);curl_close($curl);echo $response;?> 
<?php$client = new Client();$headers = [ 'API-KEY' => 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type' => 'application/json'];$body = '{ "transaction_id": "ABCDEFH"}';$request = new Request('POST', 'https://secure.nxspay.shop/api/payment/verify', $headers, $body);$res = $client->sendAsync($request)->wait();echo $res->getBody();?> 
const axios = require('axios');let data = JSON.stringify({ "transaction_id": "ABCDEFH"});let config = { method: 'post', maxBodyLength: Infinity, url: 'https://secure.nxspay.shop/api/payment/verify', headers: { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json' }, data : data};axios.request(config).then((response) => { console.log(JSON.stringify(response.data));}).catch((error) => { console.log(error);}); 
import http.clientimport jsonconn = http.client.HTTPSConnection("local.pay.expensivepay.com")payload = json.dumps({ "transaction_id": "ABCDEFH"})headers = { 'API-KEY': 'gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef', 'Content-Type': 'application/json'}conn.request("POST", "/api/payment/verify", payload, headers)res = conn.getresponse()data = res.read()print(data.decode("utf-8")) 
package mainimport ( "fmt" "strings" "net/http" "io/ioutil")func main() { url := "https://secure.nxspay.shop/api/payment/verify" method := "POST" payload := strings.NewReader(`{"transaction_id":"ABCDEFH"}`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("API-KEY", "gnXi7etgWNhFyFGZFrOMYyrmnF4A1eGU5SC2QRmUvILOlNc2Ef") req.Header.Add("Content-Type", "application/json") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body))} 
curl -X POST 'https://secure.nxspay.shop/api/payment/verify' \\ -H 'API-KEY: your_api_key_here' \\ -H 'Content-Type: application/json' \\ -d '{"transaction_id": "OVKPXW165414"}' 
Sample Response
{ "cus_name": "John Doe", "cus_email": "john@gmail.com", "amount": "900.000", "transaction_id": "OVKPXW165414", "metadata": { "phone": "015****" }, "payment_method": "bkash", "status": "COMPLETED"} 

Response Details

Field Name Type Description
Success Response
status string COMPLETED or PENDING or ERROR
cus_name String Customer Name
cus_email String Customer Email
amount String Amount
transaction_id String Transaction id Generated by System
metadata json Metadata used for Payment creation
Error Response
status bool FALSE
message String Message associated with the error response

Security Notes

  • সবসময় server-side থেকে verify করুন — সাকসেস URL-এর query parameter বিশ্বাসযোগ্য নয়।
  • API key ফ্রন্টএন্ডে রাখবেন না — browser JS বা মোবাইল অ্যাপে hardcode করবেন না।
  • transaction_id মিলিয়ে দেখুন — webhook ও verify রেসপন্সের id আপনার অর্ডারের সাথে ম্যাচ করুন।
  • Idempotency — একই transaction_id একাধিকবার webhook এলে অর্ডার দুইবার আপডেট করবেন না।
  • HTTPS only — success_url, cancel_url, webhook_url সব https হওয়া উচিত।

FAQ / Troubleshooting

  • webhook_url সঠিক ও publicly reachable কিনা চেক করুন (localhost কাজ করবে না)।
  • আপনার endpoint ২xx দিচ্ছে কিনা দেখুন।
  • Dashboard → Webhook Logs থেকে attempt ও error দেখুন।
  • অস্থায়ী সমাধান: success পেজে Verify API কল করে status নিশ্চিত করুন।

Brand active আছে কিনা, key-টা ঠিকমতো API-KEY হেডারে যাচ্ছে কিনা, এবং প্ল্যান/ডিভাইস লিমিট শেষ হয়ে যায়নি কিনা দেখুন। নতুন key জেনারেট করে আবার চেষ্টা করুন।

order_id, user_id, phone ইত্যাদি পাস করতে metadata ব্যবহার করুন। Verify রেসপন্স ও (প্রয়োজনে) আপনার সাইডে স্টোর করে রাখুন যাতে webhook আসার পর অর্ডার ম্যাপ করা যায়।

ব্রাউজার থেকে সরাসরি API কলে CORS লাগে। প্রোডাকশনে সবসময় আপনার ব্যাকএন্ড থেকে কল করুন। টেস্টের জন্য cURL, Postman বা server-side স্ক্রিপ্ট ব্যবহার করুন।

Changelog

ডকুমেন্টেশন ও API-র গুরুত্বপূর্ণ আপডেট।

  • 2026-11-16 — Webhook payload ডক, Verify response টেবিল, Error codes, Live API tester, Quick start, Supported methods, Lifecycle, FAQ, Security notes, cURL উদাহরণ ও সার্চ যোগ।
  • 2024-06-06 — প্রাথমিক ডকুমেন্টেশন রিলিজ (Create / Verify, প্লাগইন লিংক)।