Developers searching for a bKash API key usually want one thing: to get bKash payments working on a website or app as quickly as possible. But the "key" is only one piece of a credential set, and getting live access depends on more than code. This guide explains what bKash API credentials are, how the usual process works from sandbox to production, the mistakes that slow developers down, and when a multi-wallet payment gateway API is the faster route.
What Is a bKash API Key?
bKash's payment gateway (PGW) — including the widely used tokenized checkout — authenticates merchants with a set of credentials rather than a single key. Open-source integration libraries for PHP, Laravel, Node.js and other stacks typically ask for four values:
- App key — identifies your merchant application.
- App secret — a private value paired with the app key.
- Username and password — merchant API user credentials.
Your server uses these to request an access token (the "grant token"), and that token is then sent with calls such as create payment, execute payment and query payment. So when people search for "bKash API key", they really need this whole credential set plus the correct base URL for sandbox or live.
How to Get bKash API Credentials: The Typical Path
Step 1: Use sandbox credentials for development
Development normally starts in bKash's sandbox environment with test credentials and test wallet numbers. This lets you build and test the full flow — create, redirect, execute, callback, query — without real money.
Step 2: Have an eligible merchant business
Live PGW access is tied to a bKash merchant relationship. Expect to provide business documents and complete onboarding and KYC with bKash. Requirements can differ by business type, so check directly with bKash for current requirements.
Step 3: Pass integration checks
Payment providers commonly review the integration before granting production credentials — for example, that the checkout flow, callbacks and error handling behave correctly.
Step 4: Switch to production
Once approved, you receive live credentials and swap the base URL and keys in your environment configuration. Nothing else in your code should need to change if you built it cleanly.
Where to Store Your bKash API Key Safely
Leaked payment credentials are a serious risk. Follow these basics:
- Never put credentials in front-end code — not in JavaScript, Flutter or Android source files. All calls that use the app secret must run on your server.
- Use environment variables or a secrets manager, not hard-coded values in your repository.
- Don't commit .env files to GitHub; add them to .gitignore.
- Cache and refresh tokens instead of requesting a new grant token on every payment.
- Always verify payment status server-side with a query call before marking an order paid — never trust only the redirect URL.
- Serve your site over HTTPS so callback data isn't exposed.
Common Problems Developers Face
- Mixing sandbox and live values: sandbox credentials with a live base URL (or the reverse) fail authentication.
- Expired tokens: grant tokens have a limited lifetime; build refresh logic.
- Callback handling: users close the browser after paying, so your system should re-check pending payments.
- Duplicate orders: use your order ID as a unique reference and make execute logic idempotent.
- Only one wallet: after finishing bKash, many teams discover customers also want Nagad, Rocket and bank payments — which means another set of credentials, another integration and another approval process for each.
The Faster Alternative: One Payment Gateway API for Every Wallet
If your goal is "let Bangladeshi customers pay online", a single payment gateway API can save you from maintaining separate bKash, Nagad and bank integrations. KarentPay is a Bangladeshi payment gateway that brings bKash, Nagad, Rocket, Upay, Cellfin and internet banking from various banks into one integration.
- One set of API credentials from your KarentPay merchant account instead of one per wallet.
- Developer documentation at karentpay.com/documentations.
- WooCommerce plugin — search "KarentPay" on WordPress.org if your project is a WordPress store and you'd rather not write code.
- Auto and manual transfer options to match how your business confirms payments.
- SSL secure processing for every transaction.
The same security rules still apply: keep your KarentPay credentials on the server, verify every payment server-side, and use HTTPS.
bKash Direct vs a Multi-Wallet Gateway: Quick Comparison
- Wallets covered: direct bKash API covers bKash only; a gateway like KarentPay covers bKash, Nagad, Rocket, Upay, Cellfin and internet banking.
- Integrations to maintain: one per provider when going direct; one in total with a gateway.
- Onboarding: a separate approval for each provider when going direct; a single merchant account with a gateway.
- Best for: direct suits businesses that only want bKash and have dev resources; a gateway suits most stores, apps and SaaS products that want every popular method quickly.
FAQ: bKash API Key and Integration
Is the bKash API free?
Testing in the sandbox doesn't involve real money, but live payments carry transaction charges set by the provider. Confirm current charges directly with bKash or with your payment gateway.
Where can I find bKash API documentation?
bKash publishes developer documentation for its payment gateway. If you use KarentPay instead, its API docs are at karentpay.com/documentations.
Can I use a bKash API key from GitHub?
No. Credentials found in public repositories are either sandbox test values or leaked secrets. Use only credentials issued to your own merchant account.
Can an individual get a bKash API key?
Live API access is linked to merchant onboarding, so requirements depend on bKash's current policy. A payment gateway may offer a simpler onboarding route; ask about KYC requirements before you apply.
How do I accept bKash and Nagad with one API?
Use a payment gateway that supports both, such as KarentPay, so a single integration shows customers bKash, Nagad, Rocket, Upay, Cellfin and bank options.
Skip the Credential Juggling
Build once, accept every popular payment method in Bangladesh. Visit karentpay.com to open a merchant account and get your KarentPay API credentials today.

