Developers

Murubbi Pay API

Accept bKash, Nagad and Rocket on your website with one REST API, one key and signed webhooks. Free to read, no account needed.

REST · JSONAuth: X-Brand-KeyWebhooks: HMAC-SHA256

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.

1

Create a payment

Your server calls /payment/create and gets a checkout_url.

2

Customer pays

They send money and enter the TrxID on the checkout page.

3

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_xxxxxxxxxxxxxxxx
Keep the Brand Key on your server. Do not put it in browser JavaScript or a mobile app. If a key leaks, rotate it from Brands → Key.

Each 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

POST/api/v1/payment/create

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_idstringrequired

Your own order reference. Letters, digits and _-:.#/ — up to 100 characters. Unique per account.

amountnumberrequired

Amount in BDT, 1 – 500000, up to 2 decimals.

payment_modestringoptional

CREDIT_VERIFY or HOSTED_CHECKOUT. Defaults to the Brand setting.

customer_namestringoptional

Shown in Trnx Check and webhooks.

customer_emailstringoptional

Customer email.

customer_phonestringoptional

Customer phone, digits and +.

success_urlurloptional

Where the customer goes after a successful payment.

cancel_urlurloptional

Where the customer goes if they cancel or the session expires.

callback_urlurloptional

Webhook URL for this payment only. Overrides the Brand / account webhook.

metadataobjectoptional

Any JSON you want back in webhooks.

Request
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"
  }'
Response · 201
{
  "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

POST/api/v1/payment/verify-direct

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_idstringrequired

Your order reference (unique per account).

methodstringoptional

BKASH, NAGAD, ROCKET or UPAY. Optional: if left out, the wallet is read from the SMS.

trx_idstringrequired

Transaction ID from the customer, 6–40 letters or digits.

amountnumberrequired

Expected amount in BDT. Must match the money received.

customer_namestringoptional

Optional customer details.

customer_emailstringoptional

Optional customer details.

customer_phonestringoptional

Optional customer details.

metadataobjectoptional

Any JSON you want back in webhooks.

Request
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
  }'
Response · 200
{
  "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
}
Sending the same 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

GET/api/v1/payment/device-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.

online

true if at least one of your enabled SMS phones is connected right now.

show_wallets

Use this one. false only when the phone is offline and "Hide payment numbers when phone disconnects" is ON in Dashboard → Devices.

hide_wallets_when_offline

Your current dashboard setting.

online_devices / total_devices

Connected phones / enabled phones that were checked.

scope

BRAND if this Brand has its own phones, otherwise ACCOUNT (all your phones).

Request
curl https://murubbipay.com/api/v1/payment/device-status \
  -H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx"
Response · 200
{
  "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"
}
Turn the behaviour on or off in Dashboard → Devices → Hide payment numbers when phone disconnects. When it is OFF, show_wallets is always true, but online still tells you the real phone state.

Payment status

GET/api/v1/payment/status/{order_id}

Returns the current state of a payment. status is PENDING, SUCCESS or EXPIRED. Prefer webhooks; use this as a fallback.

Request
curl https://murubbipay.com/api/v1/payment/status/INV-1024 \
  -H "X-Brand-Key: mp_brand_xxxxxxxxxxxxxxxx"
Response · 200
{
  "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.success

The customer paid and the TrxID was verified.

payment.expired

The 15-minute checkout window passed without payment.

Example delivery
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);
});
Reply with any 2xx status within 10 seconds. Otherwise we retry up to 5 times (after about 10s, 20s, 40s and 80s). The same event can arrive more than once, so update the order only if it is not already paid.

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"
}
400Validation error

A field is missing or invalid. The message says which one.

401Unauthorized

X-Brand-Key is missing or wrong.

402INSUFFICIENT_BALANCE

Not enough credit for Verify with API. Top up in Credit Wallet.

403SUBSCRIPTION_EXPIRED

Your package has expired. Renew it in the dashboard.

403BRAND_DISABLED

The brand for this key is turned off.

403BRAND_DOMAIN_MISMATCH

Origin / Referer / X-Website-Url is not the brand’s domain.

404TRX_NOT_FOUND

No SMS with this TrxID on your phones, even after waiting 4 seconds. Check the TrxID or retry shortly.

404ORDER_NOT_FOUND

No payment with this order_id.

409DUPLICATE_ORDER_ID

This order_id was already used for another payment.

409TRX_ALREADY_USED

This TrxID already paid another order.

409PAYMENT_ABNORMAL

The SMS balance did not add up (possible fake SMS). The merchant must approve it first.

422TRX_TOO_OLD

The TrxID reached the server more than 30 days ago.

422AMOUNT_MISMATCH

Money received is different from the amount you sent.

422METHOD_MISMATCH

You sent method, and the TrxID belongs to a different wallet (e.g. Nagad, not bKash). Leave method out to skip this check.

429TOO_MANY_REQUESTS

Rate limit reached. Wait for Retry-After seconds.

Rate limits

POST /payment/create

120 requests / minute per account

POST /payment/verify-direct

120 requests / minute per account

GET /payment/status/{order_id}

120 requests / minute per account

GET /payment/device-status

300 requests / minute per account

All endpoints

600 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.png

Murubbi Pay · SVG · any size

https://murubbipay.com/logo.svg

bKash · PNG · 192×192

https://murubbipay.com/wallets/bkash.png

Nagad · PNG · 192×192

https://murubbipay.com/wallets/nagad.png

Rocket · PNG · 192×192

https://murubbipay.com/wallets/rocket.png

Upay · PNG · 192×192

https://murubbipay.com/wallets/upay.png
<img src="https://murubbipay.com/wallets/bkash.png" alt="bKash" width="32" height="32">