Nagad Online Payment Gateway API
নগদ পেমেন্ট গেটওয়ে ইন্টিগ্রেশনের সম্পূর্ণ সুস্পষ্ট ও সহজবোধ্য ডকুমেন্টেশন। bKash ডেভলপার পোর্টালের মতো প্রতিটি স্টেপ, RSA এনক্রিপশন/ডিক্রিপশন, রিয়েল কোড এক্সাম্পল (JavaScript, PHP, Laravel, Python, Java) সহ সাজানো।
Dual-Key Cryptography
Nagad uses RSA PKCS1Padding for encryption and SHA1withRSA for digital signatures with Base64 payload encoding.
2-Step Checkout Flow
1. Initialize: Generates unique PaymentRefId & Challenge.
2. Place Order: Passes order amount and returns Nagad redirect URL.
Callback & Server Verify
Instant redirect callback to merchant site, followed by a mandatory server-to-server Verification API call to validate payment legitimacy.
Payment Architecture & Call Flow
Nagad Online Payment Gateway follows a secure, stateless HTTPS REST model. The entire payment lifecycle consists of the following seamless flow:
Merchant Onboarding (4 Steps)
Register as a Merchant
Register in the Nagad Merchant Portal with your business information, trade license, bank account, and server IP details.
Get Merchant Credentials
From the merchant portal dashboard, obtain your assigned Merchant ID (e.g. 687450000031324) and download Nagad Gateway Public Key.
Generate & Upload Keys
Generate your own 2048-bit Merchant RSA Key Pair. Upload your Public Key to the Nagad Merchant Portal, and keep your Private Key confidential on your server.
Integrate APIs
Implement the 3 core APIs: Initialize Order, Place Order, and Verify Payment using our ready-made SDK examples in PHP, Laravel, Node.js, Python, or Java.
Environments & Base URLs
Standard URL Structure:
{BASE_URL}:{PORT}/{CONTEXT_PATH}/{API_PATH}
Example Initialize Endpoint:
http://sandbox.mynagad.com:10080/remote-payment-gateway-1.0/api/dfs/check-out/initialize/{merchantId}/{orderId}
Standard HTTP Request Headers
Every HTTP request sent to Nagad Payment Gateway must include these mandatory meta-data headers:
Purchase Status States
Compare bKash vs Nagad Architecture