Use case · POS & retail
SMS for POS and retail: receipts, loyalty and due reminders
Send a receipt by SMS when a sale is made, tell customers their loyalty points, and remind them politely about dues. From BitCommerz POS or any POS that can call an API.
The problem
At a busy counter, paper receipts get lost and nobody remembers the loyalty balance. Shops that sell on credit keep a due (baki) book, and collecting from it means awkward phone calls or waiting until the customer happens to come back.
A short SMS solves all three, but only if it goes out automatically from the POS, costs little and arrives in a language the customer reads.
How BitSMS solves it
SMS receipts
Loyalty points
Due (baki) reminders
Works with BitCommerz POS
In your code
Send a receipt from your POS
Call the send endpoint when a sale closes. Use the invoice number as the Idempotency-Key so a reprint or a network retry never sends a second receipt.
- Keep receipts short: an English SMS holds 160 characters, a Bangla SMS 70.
- The API answers as soon as the message is queued, so the counter never waits for the operator.
- Send reminders as transactional messages; they are not blocked by the bulk opt-out list.
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 SMS receipts from BitCommerz POS?
BitSMS is the SMS gateway made by BitCommerz, so it is the natural choice for BitCommerz POS. Contact us if you need help setting it up for your shop.
Can I use BitSMS with a POS from another company?
Yes, if the POS can call a web API or lets you add a custom SMS gateway. The send request is one HTTPS call with your API key.
How much does an SMS receipt cost?
The same per-SMS price as any other message, charged per part. A short English receipt fits in one part; see the Pricing page for current rates.