Use case · Marketing campaigns
SMS marketing in Bangladesh, with the cost known before you send
Run bulk SMS campaigns to thousands of customers: upload a CSV or call the API, preview the exact cost, and send. Opted-out numbers are skipped and every campaign has a report.
The problem
A promotional SMS campaign is simple until you run one. The customer list has numbers in five formats and some are not valid. A Bangla offer turns out to be three SMS parts instead of one, and the bill is three times what you planned. Someone who asked you to stop gets the message anyway.
Then there is the question every marketer asks after sending: did it work? Without delivery numbers per campaign, you cannot tell a weak offer from a message that never arrived.
How BitSMS solves it
CSV upload or bulk API
Cost preview before sending
Opt-out list applied automatically
Reports you can act on
Campaigns never slow down OTPs
In your code
Or send from your own system
The same API sends single messages and campaigns. For lists, use the bulk endpoint with up to 10,000 numbers per request; each number becomes its own message with its own delivery report.
- Valid numbers are accepted and invalid ones are returned to you, in the same response.
- A message that no route takes within its validity (1 hour by default) expires, and its cost goes back to your balance.
- Promotional SMS must follow BTRC rules: send only to customers who agreed to hear from you, and honour every request to stop.
curl https://sms-api.bitcommerz.com/v1/messages \
-H "Authorization: Bearer $BITSMS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-5521-shipped" \
-d '{"to": "01712345678", "text": "Your order #5521 has shipped."}'// Node.js 18+ (built-in fetch)
const res = await fetch("https://sms-api.bitcommerz.com/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.BITSMS_API_KEY}`,
"Content-Type": "application/json",
// Same key on a retry = no duplicate SMS, no double charge.
"Idempotency-Key": "order-5521-shipped",
},
body: JSON.stringify({ to: "01712345678", text: "Your order #5521 has shipped." }),
});
const msg = await res.json();
console.log(res.status, msg.id, msg.status); // 202 "0192…" "queued"<?php
$ch = curl_init("https://sms-api.bitcommerz.com/v1/messages");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("BITSMS_API_KEY"),
"Content-Type: application/json",
"Idempotency-Key: order-5521-shipped",
],
CURLOPT_POSTFIELDS => json_encode([
"to" => "01712345678",
"text" => "আপনার অর্ডার #5521 পাঠানো হয়েছে।",
]),
]);
$body = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE); // 202
echo $body["id"], " ", $body["parts"], " part(s)\n";import os, requests
res = requests.post(
"https://sms-api.bitcommerz.com/v1/messages",
headers={
"Authorization": f"Bearer {os.environ['BITSMS_API_KEY']}",
"Idempotency-Key": "order-5521-shipped",
},
json={"to": "01712345678", "text": "Your order #5521 has shipped."},
timeout=10,
)
msg = res.json()
print(res.status_code, msg["id"], msg["status"]) # 202 ... queuedbody, _ := json.Marshal(map[string]string{
"to": "01712345678",
"text": "Your order #5521 has shipped.",
})
req, _ := http.NewRequest("POST", "https://sms-api.bitcommerz.com/v1/messages", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+os.Getenv("BITSMS_API_KEY"))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "order-5521-shipped")
res, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err) // safe to retry with the same Idempotency-Key
}
defer res.Body.Close()
var msg struct{ ID, Status string }
json.NewDecoder(res.Body).Decode(&msg)
fmt.Println(res.StatusCode, msg.ID, msg.Status) // 202 ... queuedFrequently asked questions
How many numbers can I send a bulk SMS campaign to?
Up to 10,000 numbers in one API request, and you can make as many requests as you need. In the dashboard, upload a CSV and the preview shows how many numbers are valid before you send.
Will I know the campaign cost before sending?
Yes. The preview counts the SMS parts for your message, multiplies by the number of valid recipients and shows the total cost and your balance after sending. Bangla text uses more parts than English, and the preview accounts for that.
What happens to people who do not want promotional SMS?
Add them to your opt-out list. Bulk messages to those numbers are rejected before sending and are not charged. You are responsible for having your customers' consent and following BTRC rules for promotional SMS.
Can I send a campaign with my brand name?
Yes, with a masking sender ID. It needs a one-time approval with your business documents. Without it, campaigns go out from a numeric sender at the non-masking price.