Balance and pricing
Two cheap reads. Neither counts against the send rate limit, so checking your balance before every message is fine.
Balance
/api/v1/sms/balance
curl https://api.splashifypro.com/api/v1/sms/balance \
-H "Authorization: Bearer sms_live_your_key_here"{ "success": true, "balance": 1250.5, "currency": "INR" }Worth calling before a campaign rather than discovering an empty wallet
halfway through one. A send with insufficient balance returns 402 and is
neither sent nor charged, so nothing is lost, but a campaign that stops at the
four hundredth recipient is still a campaign you have to reason about.
Pricing
/api/v1/sms/pricing
{
"success": true,
"currency": "INR",
"unit": "part",
"note": "Prices are per message part. A message longer than one part is charged for each part it uses.",
"pricing": [
{ "category": "promotional", "price_per_part": 0.16 },
{ "category": "transactional", "price_per_part": 0.18 },
{ "category": "service_implicit", "price_per_part": 0.18 },
{ "category": "service_explicit", "price_per_part": 0.18 }
]
}These are your prices, including any rate agreed for your account, not a public price list.
Per part, not per message
A 300-character message is two parts and costs twice a 150-character one, and a single rupee sign can turn a one-part message into two. If you estimate campaign cost from this endpoint, multiply by parts and not by recipients. See Message parts and encoding.
Estimating a campaign
Work out the parts per message
160 characters per part in the basic alphabet; 70 if the text contains anything outside it, such as a rupee sign, an emoji or an Indian-language script. Longer messages split at 153 and 67.
Multiply by recipients
Parts per message times the number of recipients.
Multiply by the price for that template's category
From this endpoint.
Compare against your balance
And top up before starting rather than during.
Do not round the per-part price to two decimals before multiplying. It can carry four, and rounding early across a large campaign moves the total noticeably.
What you are actually charged
The estimate above is a good one, but the figure on your bill is the part count the network reports for each message, which is the authoritative number. In normal use the two agree.
Whether a failed message is refunded depends on your account's billing mode. See Billing and wallet.