1. Home
  2. Blog
  3. Integration

Integration

How to Design Transactional SMS and OTP Messages: Segments, Pumping Defense and Cost Guide

How to design transactional SMS and OTP messages: segment math, code rules, SMS pumping defense, delivery reports and payback, with worked examples.

Contents 14 sections
  1. What Is Transactional SMS and What Types Exist?
  2. How Are SMS Character Sets and Segments Calculated?
  3. How Do Non-GSM Characters Affect SMS Cost?
  4. How Should an SMS Template and Its Variables Be Designed?
  5. How Should a Verification Code Be Designed?
  6. How Is SMS Pumping Prevented?
  7. How Are Delivery Reports, Latency and Fallback Channels Managed?
  8. How Do Sender Identity and Registration Processes Work?
  9. SMS, In-App Verification or Email Link: Which Channel?
  10. Which Metrics Should You Track?
  11. How Is the Payback of Transactional SMS Design Calculated?
  12. What Are Common Mistakes in Transactional SMS?
  13. Integration and Custom Software with İnovabil
  14. Frequently Asked Questions

A dealer signs in to a portal and waits for a six-digit code on their phone; a customer wants a one-line notice when an order ships; a reminder goes out for tomorrow's appointment. All of these are transactional SMS: short messages an application sends to one user after an event, not campaigns. They look simple, yet a segment miscount can double the bill, a loose code design can put accounts at risk, and without defenses thousands of fake sends can happen overnight.

This guide covers how to design one-time passcode (OTP) and notification messages: segment math, the cost of non-GSM characters, defense against SMS pumping, delivery reports, fallback channels and the payback calculation. All figures are illustrative; they are not any provider's tariff or an industry average.

Key ideaThe cost of transactional SMS depends less on message count than on segment count and on send points open to abuse. Fit each message into one segment, make codes short-lived with limited attempts, restrict sending by number, device and country, and watch the verification completion rate: that lowers both the bill and the risk.

What Is Transactional SMS and What Types Exist?

Transactional SMS is a message the application sends because of a user action or an event on the user's account. It differs from a bulk campaign in that an event triggers it and the content is specific to that user. Which messages count as transactional and which as commercial is set by regulation; settle the line and the consent requirements with your legal counsel. For the marketing side, see our marketing automation guide.

TypeExampleLatency expectationWatch point
Verification code (OTP)Sign-in, registration, payment approvalSecondsShort life, single use, abuse limits
Transaction noticeOrder received, order shippedMinutesLittle personal data, segment budget
ReminderAppointment, payment due dateAt a planned timeSend hour, repeat limit
MarketingCampaign, discountBulk and plannedCommercial message rules; outside this article

Only the verification code keeps a user waiting on screen. Password and second-factor options are covered in our MFA and SSO guide; here we focus on the SMS channel itself.

How Are SMS Character Sets and Segments Calculated?

One SMS carries a limited number of characters in a single part, and the limit depends on encoding. If a message uses only letters from the GSM basic character set, one part holds up to 160 characters. If even one character is outside the set, the whole message switches to Unicode and one part holds 70. A message over the limit is split into segments; each segment carries header data, so characters per segment drop to 153 (GSM) or 67 (Unicode).

EncodingSingle segmentConcatenated, per segmentExample characters
GSM basic set160153Latin letters, digits, common punctuation
Unicode7067Letters outside the set, emoji

Four Turkish letters (s-cedilla, g-breve, dotless i and dotted capital I) are not in the basic set, so any message containing one falls to Unicode. Some providers may offer extended encodings or a different counting method for Turkish, so confirm the counting rule in your provider's documentation and test it with a real send.

How Do Non-GSM Characters Affect SMS Cost?

Take the same order notice in two forms, each 125 characters: one with Turkish letters outside the GSM set, one written with plain Latin letters only.

VersionContent (abridged)CharactersEncodingSegments
With Turkish lettersDear customer, order #1042 has shipped. Have a nice day.125Unicode2 (125 > 70; 2 × 67 = 134)
Plain lettersThe same text, accents removed125GSM1 (125 ≤ 160)
Segment cost of the same message: the version with local letters is 2 segments and 96,000 lira a month, the plain version is 1 segment and 48,000 lira, a 48,000 lira difference
Same text, different encoding: segment count sets the bill.

At 120,000 messages a month and an illustrative ₺0.40 per segment: one segment costs 120,000 × ₺0.40 = ₺48,000; two segments cost 120,000 × 2 × ₺0.40 = ₺96,000. The difference is ₺48,000 a month, ₺576,000 a year. Not all your traffic is this message, but checking each template's segment count shows fixable waste.

There are two fixes: write without the extra letters (at a cost to readability and brand voice) or fit the text into 70 characters. For verification codes the second is usually possible: a message like "BayiPortal code: 482913. Do not share it." is 41 characters and one segment even with Unicode.

How Should an SMS Template and Its Variables Be Designed?

A template is fixed text plus variables. Because variable length changes between messages, budget for the worst case. A verification template budget against the 70-character Unicode limit:

PartContentCharacters
BrandBayiPortal10
Code4829136
Validity note(5 min)7
WarningDo not share it.16
Connecting text and spacescode: , period, spaces9
Total48 (limit 70, margin 22)

Keep templates versioned and run a test that computes the segment count on every change.

Do not put full names, addresses, amounts or order contents in the message; it can be read on a lock screen. Leave the detail to the signed-in screen. If you include a link, make sure the short link carries a single-use, time-limited token and asks for authentication when opened; a short link takes about 20 characters, so subtract it from the budget. For personal data questions, consult your legal counsel.

How Should a Verification Code Be Designed?

A code's security rests on four parameters: length, validity period, attempt limit and resend frequency. An illustrative starting set:

ParameterSuggested startReason
Length6 digits (106 possibilities)Readable and easy to type
Validity5 minutesShortens the life of a stolen code
UseSingle useInvalid after a successful sign-in
Attempt limit5 wrong tries per codeLimits guessing
ResendAt least 30 seconds apartSlows rapid repeats
Daily limit10 sends per numberLimits guessing and cost

Here is the daily limit's effect. If the code is random and regenerated on each send, one attempt succeeds with probability 1 ÷ 106, and 5 attempts per code give 5 ÷ 106. With no daily limit and a 30-second interval, 86,400 ÷ 30 = 2,880 codes can be generated in a day; that is 2,880 × 5 = 14,400 attempts, about a 1.44% chance (14,400 ÷ 1,000,000). With a limit of 10, attempts drop to 10 × 5 = 50 and the chance to 50 ÷ 1,000,000 = 0.005%: 288 times lower. For the general frame, see our API security guide. Store the code as a hash and record which operation it belongs to.

How Is SMS Pumping Prevented?

SMS pumping is when an attacker uses your registration or verification endpoint to trigger codes to many fake phone numbers. The goal is to profit from sending fees or hurt the business; the loss lands on your bill.

Example: normal daily sending is 4,000. If one day reaches 40,000, the extra 36,000 messages cost 36,000 × ₺0.40 = ₺14,400 at a local rate. International numbers usually cost more; at an illustrative ₺1.50 the same volume is ₺54,000. Left unnoticed for three days, the figures are ₺43,200 and ₺162,000.

SMS pumping effect: normal 4,000 sends, attack day 40,000, extra 36,000 messages cost 14,400 lira at the local rate, completion rate falls from 90 percent to 9 percent
Pumping shows up in the completion rate as much as in send volume.

Defense is layered, and the rules must run on the server before sending.

  • Per-number limit: 3 per hour and 10 per day; at least 30 seconds between sends to the same number.
  • Per-IP and per-device limit: Requests to 20 different numbers per hour from one source are not normal; ask for extra verification when exceeded.
  • Country prefix allow list: If your users are only in Turkey, allow only +90; make each new country a deliberate decision.
  • Daily cap: Set it at 2.5 times normal: 4,000 × 2.5 = 10,000. If an attack stops at the cap, extra cost is limited to (10,000 − 4,000) × ₺0.40 = ₺2,400. A cap can also block real users, so raise an alert when it is hit and move to extra verification.
  • Anomaly alert: Alert when hourly sending exceeds three times your own peak, or when the completion rate falls.

The completion rate is the most reliable clue. On a normal day 3,600 of 4,000 sends are verified: 90%. On the pumping day, 40,000 sends still produce 3,600 verifications: 3,600 ÷ 40,000 = 9%. Volume can rise seasonally; the completion rate does not fall tenfold. For alerting, see our software monitoring guide.

How Are Delivery Reports, Latency and Fallback Channels Managed?

A provider accepting the request does not mean the message reached the phone. The delivery report (receipt) reports the gap; it usually arrives as an event (webhook) or by query, and our webhook guide explains the mechanism.

StatusMeaningHandling in the application
SentProvider accepted and passed it to the carrierPending; show "code on its way"
DeliveredReached the phoneSuccess; counted in metrics
FailedNumber invalid, off or blockedTrigger the fallback channel
UnknownNo report or report expiredDo not count as success; fallback after timeout

An illustrative month: of 120,000 sends, 115,200 delivered (96.0%), 3,000 failed (2.5%), 1,800 unknown (1.5%). Delivery rate is 115,200 ÷ 120,000 = 96.0%; excluding unknowns it is 115,200 ÷ 118,200 ≈ 97.5%. State which one you report.

Set a latency target for codes: p95 ≤ 10 seconds. Of 10,000 codes at most 500 (5%) should exceed 10 seconds; if a measurement shows 620, the rate is 6.2% and the target is missed. In the interface, offer "resend" after 15 seconds and an alternative channel on the second attempt: a voice call, email or an in-app notification. For the in-app side, see our push notification guide.

To reduce provider dependency, put sending behind an abstraction layer and route across two providers. If the first delivers 96% and the second 95%, and failures are independent, sending the first's failures to the second gives total success of 1 − 0.04 × 0.05 = 99.8%; on 120,000 messages the loss falls from 4,800 to 240. A shared line problem can hit both routes at once, so verify the gain with your own measurement. Our message queue guide covers retry and queue logic.

How Do Sender Identity and Registration Processes Work?

The name or number a message comes from affects user trust. Alphanumeric sender names, carrier and regulator registration rules and approval times vary by country and provider; ask your provider and legal counsel for details. One design rule: add the registration process to the project early, because waiting for approval can delay launch.

With 120,000 sends a month and 108,000 completed verifications (90%), SMS costs 48,000 ÷ 108,000 ≈ ₺0.44 per verification (₺0.89 at two segments). For email at an illustrative ₺0.02, 120,000 × ₺0.02 = ₺2,400, about ₺0.022 per verification.

ChannelUnit cost (illustrative)SpeedDependency and risk
SMS₺0.40 per segmentSeconds; depends on carrierCarrier, provider, pumping
In-app verificationNo send fee; development costInstantApp installed and device needed
Email link₺0.02Seconds to minutesMailbox security, deliverability

The cheapest channel is not always the right one; letting the user choose and offering a fallback is often balanced. For the email side, see our transactional email guide.

Which Metrics Should You Track?

Five metrics are enough: verification completion rate (3,600 ÷ 4,000 = 90%), delivery rate (96.0%), delivery time p95 (target ≤ 10 s), cost per delivery (48,000 ÷ 115,200 ≈ ₺0.42) and the share of blocked fake sends. Show them on one dashboard and tie alerts to ratios; looking only at send volume catches pumping late. For threshold logic, see our KPI guide.

How Is the Payback of Transactional SMS Design Calculated?

There are two gains. Segments: 40,000 notifications a month go out at two segments and can drop to one; 40,000 × ₺0.40 = ₺16,000 a month, ₺192,000 a year. Pumping: with no defense, two incidents a year, each unnoticed for two days, cost 2 × 2 × ₺14,400 = ₺57,600; with defense each incident is capped at ₺2,400, total ₺4,800. The gain is ₺52,800.

The yearly gain is ₺192,000 + ₺52,800 = ₺244,800, or ₺20,400 a month. Effort: template and segment revision 3, limits, allow list and cap 8, alerts and dashboard 4, testing 3; total 18 person-days × ₺9,000 = ₺162,000. Payback is 162,000 ÷ 20,400 ≈ 7.9 months. If no pumping incident ever occurs, 162,000 ÷ 16,000 ≈ 10.1 months; with no segment gain, 52,800 ÷ 12 = ₺4,400 gives 162,000 ÷ 4,400 ≈ 36.8 months. Recalculate with your own volume and price.

What Are Common Mistakes in Transactional SMS?

  • Sending unlimited codes: Staying open to both guessing and pumping.
  • Keeping codes valid too long: A 30-minute code widens the theft window six times.
We recommend reading: What is API integration? How it works, types and a setup guide
We recommend reading: How to Manage Bot Traffic and Automated Abuse: Signal Scoring, Rate Limits and Payback Guide
We recommend reading: How to Build an Order Tracking Page and Reduce "Where Is My Order?" Tickets: Status Model, Delay Notices and Payback Guide
We recommend reading: How to Set Up Transactional Message Template Management: Email, SMS and Push Templates, Variable Contracts, Versions and Payback Guide

Integration and Custom Software with İnovabil

At İnovabil our focus is building firm-specific software from scratch: custom software, ERP, CRM, e-commerce, web, mobile and integration. We recommend defining notification and verification flows in the requirements stage, in writing, together with the channel, segment budget and defense rules. This is not a standalone SMS product commitment; it is an application of our documented integration and role-based access capabilities.

We built CRM, purchasing and mobile for Avcılar İnşaat; a purchasing system for İZBAN; logistics and shipment planning with wholesale order management for Karyak; warehouse management and a complaint and support management system for Sleepy; and a prepaid cargo system for Kredili Kargo. Send a short summary of your user flows and we will prepare a written assessment together.

We recommend reading: Our integration service

Frequently Asked Questions

What is transactional SMS?

Messages an application sends to a user after an event, such as a verification code, an order notice or a reminder. It differs from a bulk campaign by being event-triggered and specific to that user. Ask your legal counsel about the commercial message line.

Why do non-GSM characters raise SMS cost?

Four Turkish letters are not in the GSM basic set, so the message falls to Unicode and a single segment holds 70 characters instead of 160. In the example a 125-character message becomes two segments. Confirm your provider's counting rule in its documentation.

How many digits and how long should a verification code last?

As a start: 6 digits, 5 minutes, single use, 5 wrong attempts per code, at least 30 seconds between resends and a daily limit per number. In the example the daily limit cuts the guess chance from 1.44% to 0.005%.

What is SMS pumping and how is it prevented?

It is an attacker using your verification endpoint to send codes to many fake numbers, with the loss landing on your bill. Use per-number, IP and device limits, a country prefix allow list, a daily cap and a completion-rate alert together.

What should be done when the SMS does not arrive?

Watch the delivery report, offer resend after 15 seconds and move to a fallback such as a voice call, email or in-app notification on the second attempt. Two-provider routing can reduce failures; verify the gain with your own measurement.

Let's talk about your project

Tell us briefly about the software you have in mind; we'll listen and prepare a tailored roadmap and proposal.

Get a quote