Devices

SMS sender

Send SMS to your customers from your own phone and SIM. Messages are queued in TakaPay (from the dashboard or the API) and the TakaPay Android app picks them up, sends them, and reports back.

Queue an SMS (your backend)

POST/api/v1/sms

Auth: X-Api-Key (your store API key)

to is one number, a comma separated list, or an array (up to 100). Bangladeshi mobile numbers only; +880 is accepted. Each recipient becomes one message with status queued.

curl
curl -X POST https://pay.brainicsoft.com/api/v1/sms \
  -H "X-Api-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": ["01711111111", "01811111111"], "message": "Your order is confirmed"}'

Android app (gateway)

The app authenticates with the store's webhook secret, the same one it uses to forward payment SMS (X-Webhook-Secret or Authorization: Bearer). The platform-wide secret has no store, so it can't be used here.

Single webhook URL

POST/api/sms-gateway

One URL for everything the app does. Pick the job with event (or leave it out and it is inferred from the fields). Every response includes outbox: queued SMS for the phone to send, already claimed (up to pull, default 10; send 0 for none).

events
// An SMS the phone received → stored in the dashboard Inbox
{ "event": "received", "from": "01711111111", "message": "Hi", "receivedAt": "2026-10-06T10:00:00.000Z" }

// Result of an SMS the phone sent (one, or several in "reports")
{ "event": "report", "id": "fe41db0d-…", "status": "sent" }
{ "event": "report", "reports": [
  { "id": "fe41db0d-…", "status": "sent" },
  { "id": "a1699950-…", "status": "failed", "error": "No SIM balance" }
] }

// Nothing to send, just get the outbox
{ "event": "poll" }
response
{
  "ok": true,
  "event": "report",
  "reported": [ { "id": "fe41db0d-…", "status": "sent", … } ],
  "outbox": [ { "id": "44c8b9cf-…", "to": "01711111111", "message": "Your order is confirmed" } ]
}

The same jobs are also available as separate routes:

GET/api/sms-gateway/outbox?limit=10

Fetch queued SMS. Returned messages are claimed (status sending), so another phone on the same store won't get them. A claim with no report after 5 minutes is re-queued, and failed after 3 attempts. Polling also marks the phone online in the dashboard.

response
{
  "messages": [
    { "id": "44c8b9cf-…", "to": "01711111111", "message": "Your order is confirmed" }
  ]
}

POST/api/sms-gateway/outbox/:id/report

Report the result of each message after sending it.

body
{ "status": "sent" }
{ "status": "failed", "error": "No SIM balance" }

Incoming SMS webhook

POST/api/sms-gateway/inbox

A separate webhook from the payment SMS one: the app forwards SMS the phone receives (customer replies and so on) and they show up under Inbox in the dashboard. Sending the same SMS twice (same from, message and receivedAt) is safe; it is stored once. The response carries up to pull (default 10, 0 for none) queued outgoing SMS, already claimed, so send them and report back just like the outbox.

request
{
  "from": "01711111111",
  "message": "I want to cancel my order",
  "receivedAt": "2026-10-06T10:00:00.000Z"
}
response
{
  "ok": true,
  "id": "648a41bf-…",
  "outbox": [
    { "id": "fe41db0d-…", "to": "01711111111", "message": "Your order is cancelled" }
  ]
}

status values

queuedWaiting for the phone to pick it up
sendingClaimed by the phone, no report yet
sentThe phone sent it
failedSending failed; retry from the dashboard
cancelledCancelled before the phone picked it up