Use case · Order notifications
Order confirmation and delivery update SMS, sent automatically
Tell customers the moment an order is confirmed, shipped or out for delivery, in Bangla or English. Every SMS has a delivery report, and signed webhooks keep your system in sync.
The problem
When customers do not hear about their order, they call. Every "where is my parcel?" call costs your team time, and a customer who is not expecting the courier is more likely to miss the delivery or refuse a cash-on-delivery parcel.
Sending order SMS from your own code brings its own problems. A timeout makes your server retry and the customer gets the same message twice. A message fails silently and nobody knows. And a big promotion going out at the same time can push order updates to the back of the line.
How BitSMS solves it
One call per order event
No double sends on retries
Delivery reports and signed webhooks
Ahead of promotions in the queue
In your code
Send a shipping update
One HTTPS request per message. The API answers as soon as the SMS is safely queued and gives you a message ID to track.
- Use the order number and event in the Idempotency-Key, e.g. order-5521-shipped.
- Register a webhook once to receive delivered and failed updates for every message.
- Send to any Bangladeshi mobile number, in 017… or +88017… format.
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
Can I send order confirmation SMS in Bangla?
Yes. Write the text in Bangla and BitSMS sends it as Unicode. A Bangla SMS holds 70 characters, then 67 per part for longer messages; the calculator on the Features page shows the count before you send.
How do I know if a delivery update SMS reached the customer?
Every message gets a delivery report from the operator. You can see it in the dashboard, look it up by message ID, or receive it on a signed webhook.
What if my server sends the same order SMS twice?
Send an Idempotency-Key with each request. If the same key arrives again, BitSMS returns the first message instead of sending a duplicate, and you are charged once.