The phone app forwards every bKash / Nagad / Rocket money-received SMS to the hub. Websites and bots ask the hub to claim a Transaction ID. A TrxID can be claimed once โ after any connection uses it, every other connection gets already_used.
๐ฑ Phone app โโโบ Hub โโโ claim โโ Website
โโโ claim โโ Bot 1, Bot 2, โฆ
https://sms.aponcloudx.com/hook(?i)^(bkash|nagad|rocket|16216)$ (regex ON) ยท Text filter: (?i)(trx\s*id|txn\s*id|transaction\s*id){"from":"%from%","text":"%text%","sentStamp":%sentStamp%,"receivedStamp":%receivedStamp%,"sim":"%sim%"}The hub checks the X-Signature header = hex HMAC-SHA256(secret, raw body). Wrong signature โ 403.
Admin โ Dashboard โ Connections โ + New Connection. Copy the API key (shown once). Send it as Authorization: Bearer <key>. Keep it on the server, never in a browser or app.
POST /v1/claim โ use a TrxID (atomic, one use ever)
{"wallet":"bkash","trx_id":"BKA1B2C3D4","ref":"invoice-1234","min_amount":288}
Success: {"ok":true,"sms":{"wallet":"bkash","trx_id":"โฆ","amount":288,"counterparty":"1712345678","sms_time":"โฆ"}}
Errors (ok:false): not_found (SMS not arrived yet โ retry in a minute), already_used, not_payment (needs admin review), amount_too_low.
GET /v1/check?wallet=bkash&trx_id=โฆ โ look up without using it.
GET /v1/numbers โ active payment numbers {"bkash":[{"number":"01โฆ","type":"personal"}],โฆ}. Show these to customers so a number change is made in one place.
Python
import requests
HUB, KEY = "https://sms.aponcloudx.com", "hub_xxx" # keep KEY in .env
r = requests.post(f"{HUB}/v1/claim", json={"wallet": "nagad", "trx_id": trx, "ref": f"order-{order_id}",
"min_amount": amount_bdt}, headers={"Authorization": f"Bearer {KEY}"}, timeout=15).json()
if r["ok"]: credit(user, r["sms"]["amount"])
elif r["error"] == "not_found": ask_user_to_wait()
else: show(r.get("message"))
Node.js
const r = await fetch(HUB + '/v1/claim', { method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + process.env.SMS_HUB_KEY },
body: JSON.stringify({ wallet: 'bkash', trx_id, ref: 'inv-' + id, min_amount: bdt }) }).then(r => r.json());
bKash, NAGAD, Rocket/16216 with a TrxID are stored.