Copy the whole reference in one tap — every endpoint, field and code sample, as Markdown.
Introduction
The Murubbi Pay API lets your website accept bKash, Nagad, Rocket and Upay payments that are verified automatically. Your customer sends money to your number, and Murubbi Pay matches their Transaction ID (TrxID) with the payment SMS on your phone running the Murubbi Pay app.
Create a payment
Your server calls /payment/create and gets a checkout_url.
Customer pays
They send money and enter the TrxID on the checkout page.
You get notified
We verify it and POST a signed webhook to your server.
Base URL: https://murubbipay.com/api/v1. All requests and responses use JSON. Amounts are in Bangladeshi Taka (BDT).
Every payment gets an invoice_id — a platform-wide number that starts at 001 and goes up by one for each new payment. It is never reused and comes back in every response and webhook.
Authentication
Every API request needs one header: your Brand Key. Create a Brand in the dashboard (Brands → Add Brand) with your website URL, and you get a key that starts with mp_brand_.
X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxxEach Brand Key is locked to its website domain. If a request carries an Origin, Referer or X-Website-Url header from another domain, it is rejected with BRAND_DOMAIN_MISMATCH. Your success_url, cancel_url and callback_url must also be on that domain. An active package is required.
Payment modes
Verify with API
Customers pay to your own numbers from Payment Gateway, on your branded checkout page. Each verified payment uses 1 credit. Money goes straight to you.
Hosted Checkout
Customers pay to your own Payment Gateway numbers on the standard Murubbi Pay checkout page. Used automatically when your credit runs out.
The mode comes from your Brand setting. You can override it per request with payment_mode.
Create a payment
Creates a checkout session that is valid for 15 minutes. Redirect the customer to checkout_url. Calling again with the same order_id and amount while it is still pending returns the same session.
order_idstringrequiredYour own order reference. Letters, digits and _-:.#/ — up to 100 characters. Unique per account.
amountnumberrequiredAmount in BDT, 1 – 500000, up to 2 decimals.
payment_modestringoptionalCREDIT_VERIFY or HOSTED_CHECKOUT. Defaults to the Brand setting.
customer_namestringoptionalShown in Trnx Check and webhooks.
customer_emailstringoptionalCustomer email.
customer_phonestringoptionalCustomer phone, digits and +.
success_urlurloptionalWhere the customer goes after a successful payment.
cancel_urlurloptionalWhere the customer goes if they cancel or the session expires.
callback_urlurloptionalWebhook URL for this payment only. Overrides the Brand / account webhook.
metadataobjectoptionalAny JSON you want back in webhooks.
curl -X POST https://murubbipay.com/api/v1/payment/create \
-H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"order_id": "INV-1024",
"amount": 1250,
"customer_name": "Rahim Uddin",
"customer_email": "[email protected]",
"success_url": "https://myshop.com/thank-you",
"cancel_url": "https://myshop.com/cart"
}'{
"payment_id": "6f1c2b0e-3a4d-4c2e-9b1f-8d7e6a5b4c3d",
"order_id": "INV-1024",
"invoice_id": "001",
"brand_id": "1a2b3c4d-...",
"payment_mode": "CREDIT_VERIFY",
"amount": "1250.00",
"status": "PENDING",
"checkout_url": "https://murubbipay.com/checkout/6f1c2b0e-...",
"expires_at": "2026-11-12T10:15:00.000Z"
}Verify a TrxID
For your own checkout UI: the customer pays to your number and gives you the TrxID, and you verify it in one call. It is checked against SMS from your phones only. Each successful check uses 1 credit and marks the TrxID as used, so it can never pay twice.
order_idstringrequiredYour order reference (unique per account).
methodstringoptionalBKASH, NAGAD, ROCKET or UPAY. Optional: if left out, the wallet is read from the SMS.
trx_idstringrequiredTransaction ID from the customer, 6–40 letters or digits.
amountnumberrequiredExpected amount in BDT. Must match the money received.
customer_namestringoptionalOptional customer details.
customer_emailstringoptionalOptional customer details.
customer_phonestringoptionalOptional customer details.
metadataobjectoptionalAny JSON you want back in webhooks.
curl -X POST https://murubbipay.com/api/v1/payment/verify-direct \
-H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"order_id": "INV-1025",
"method": "BKASH",
"trx_id": "9G7A6B5C4D",
"amount": 500
}'{
"verified": true,
"replay": false,
"payment_id": "0c9e8d7f-...",
"order_id": "INV-1025",
"invoice_id": "002",
"brand_id": "1a2b3c4d-...",
"trx_id": "9G7A6B5C4D",
"method": "BKASH",
"amount": "500.00",
"sender_number": "01712345678",
"received_at": "2026-11-12T09:58:41.000Z",
"fee_deducted": "0.0010",
"wallet_balance": "4.9990",
"credits_used": 1,
"credits_left": 4999
}order_id and trx_id again returns the same result with "replay": true and no extra charge, so retries are safe. A failed check (wrong TrxID, amount, etc.) creates nothing and costs nothing, so the customer can try again on the same order_id with the correct TrxID. If the SMS is a few seconds late, the call waits up to 4 seconds for it before answering TRX_NOT_FOUND.Phone status
For your own checkout UI. Tells you if your SMS phone is connected right now, so you can hide your payment numbers while it is offline and customers don't pay into a number nobody is watching. Hosted Checkout already does this for you. Call it from your server when the checkout page loads. It is free and uses no credits.
onlinetrue if at least one of your enabled SMS phones is connected right now.
show_walletsUse this one. false only when the phone is offline and "Hide payment numbers when phone disconnects" is ON in Dashboard → Devices.
hide_wallets_when_offlineYour current dashboard setting.
online_devices / total_devicesConnected phones / enabled phones that were checked.
scopeBRAND if this Brand has its own phones, otherwise ACCOUNT (all your phones).
curl https://murubbipay.com/api/v1/payment/device-status \
-H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx"{
"online": false,
"show_wallets": false,
"hide_wallets_when_offline": true,
"online_devices": 0,
"total_devices": 1,
"scope": "BRAND",
"checked_at": "2026-11-29T08:30:00.000Z"
}show_wallets is always true, but online still tells you the real phone state.Payment status
Returns the current state of a payment. status is PENDING, SUCCESS or EXPIRED. Prefer webhooks; use this as a fallback.
curl https://murubbipay.com/api/v1/payment/status/INV-1024 \
-H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx"{
"payment_id": "6f1c2b0e-...",
"order_id": "INV-1024",
"invoice_id": "001",
"brand": { "id": "1a2b3c4d-...", "name": "My Shop", "website_url": "https://myshop.com" },
"checkout_type": "HOSTED",
"payment_mode": "CREDIT_VERIFY",
"status": "SUCCESS",
"method": "BKASH",
"amount": "1250.00",
"fee": "0.0010",
"trx_id": "9G7A6B5C4D",
"sender_number": "01712345678",
"customer_name": "Rahim Uddin",
"customer_email": "[email protected]",
"paid_at": "2026-11-12T10:02:13.000Z",
"created_at": "2026-11-12T10:00:00.000Z"
}Webhooks
When a payment is verified or expires, we send an HTTPS POST to your webhook URL. The URL is chosen in this order: the payment's callback_url, then the Brand's webhook, then your account default (Dashboard → API Docs).
payment.successThe customer paid and the TrxID was verified.
payment.expiredThe 15-minute checkout window passed without payment.
POST /webhooks/murubbi HTTP/1.1
Content-Type: application/json
User-Agent: MurubbiPay-Webhook/1.0
X-Event: payment.success
X-Delivery-Attempt: 1
X-Signature: 5f2a9c...e81b (hex HMAC-SHA256 of the raw body)
{
"event": "payment.success",
"payment_id": "6f1c2b0e-...",
"order_id": "INV-1024",
"invoice_id": "001",
"brand_id": "1a2b3c4d-...",
"brand_name": "My Shop",
"checkout_type": "HOSTED",
"payment_mode": "CREDIT_VERIFY",
"status": "SUCCESS",
"method": "BKASH",
"amount": "1250.00",
"fee": "0.0010",
"trx_id": "9G7A6B5C4D",
"sender_number": "01712345678",
"customer_name": "Rahim Uddin",
"customer_email": "[email protected]",
"paid_at": "2026-11-12T10:02:13.000Z",
"metadata": null,
"timestamp": 1794477733
}Verify the signature
X-Signature is the hex HMAC-SHA256 of the raw request body, using your webhook secret (Dashboard → API Docs → Webhook secret). Always check it before trusting the data.
import crypto from 'node:crypto';
import express from 'express';
const app = express();
// Use the RAW body: the signature is computed over the exact bytes we sent.
app.post('/webhooks/murubbi', express.raw({ type: 'application/json' }), (req, res) => {
const expected = crypto
.createHmac('sha256', process.env.MURUBBI_WEBHOOK_SECRET)
.update(req.body)
.digest('hex');
const given = req.get('X-Signature') ?? '';
const valid =
given.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
if (!valid) return res.status(401).end();
const event = JSON.parse(req.body.toString('utf8'));
if (event.event === 'payment.success') {
// mark event.order_id as paid (make this idempotent)
}
res.sendStatus(200);
});Errors
Errors use normal HTTP status codes and always return the same JSON shape. Use error in your code and show message to people.
{
"statusCode": 409,
"error": "TRX_ALREADY_USED",
"message": "This Transaction ID has already been used"
}Validation errorA field is missing or invalid. The message says which one.
UnauthorizedX-Brand-Key is missing or wrong.
INSUFFICIENT_BALANCENot enough credit for Verify with API. Top up in Credit Wallet.
SUBSCRIPTION_EXPIREDYour package has expired. Renew it in the dashboard.
BRAND_DISABLEDThe brand for this key is turned off.
BRAND_DOMAIN_MISMATCHOrigin / Referer / X-Website-Url is not the brand’s domain.
TRX_NOT_FOUNDNo SMS with this TrxID on your phones, even after waiting 4 seconds. Check the TrxID or retry shortly.
ORDER_NOT_FOUNDNo payment with this order_id.
DUPLICATE_ORDER_IDThis order_id was already used for another payment.
TRX_ALREADY_USEDThis TrxID already paid another order.
PAYMENT_ABNORMALThe SMS balance did not add up (possible fake SMS). The merchant must approve it first.
TRX_TOO_OLDThe TrxID reached the server more than 30 days ago.
AMOUNT_MISMATCHMoney received is different from the amount you sent.
METHOD_MISMATCHYou sent method, and the TrxID belongs to a different wallet (e.g. Nagad, not bKash). Leave method out to skip this check.
TOO_MANY_REQUESTSRate limit reached. Wait for Retry-After seconds.
Rate limits
POST /payment/create120 requests / minute per account
POST /payment/verify-direct120 requests / minute per account
GET /payment/status/{order_id}120 requests / minute per account
GET /payment/device-status300 requests / minute per account
All endpoints600 requests / minute per IP
Over the limit you get 429 with a Retry-After header (seconds). Responses also include X-RateLimit-Limit and X-RateLimit-Remaining.
Logos
Free to use on your own checkout — for example one icon next to each payment method.
Murubbi Pay · PNG · 512×512
https://murubbipay.com/logo.pngMurubbi Pay · SVG · any size
https://murubbipay.com/logo.svgbKash · PNG · 192×192
https://murubbipay.com/wallets/bkash.pngNagad · PNG · 192×192
https://murubbipay.com/wallets/nagad.pngRocket · PNG · 192×192
https://murubbipay.com/wallets/rocket.pngUpay · PNG · 192×192
https://murubbipay.com/wallets/upay.png<img src="https://murubbipay.com/wallets/bkash.png" alt="bKash" width="32" height="32">