Why SMS payments?
Now you will not surprise anyone with the possibility of paying for services by sending an SMS to a certain “short number”. Even the farthest person from the Internet could hear on TV: “Send an SMS to the number XXXX to vote for YYYY”, and at the bottom of the screen see the inscription: “* the cost of sending 30 rubles”. Below I will tell how it works.
pros
Why is this payment method so good? Here are the main, in my opinion, arguments:
- Ease of payment
Today, almost every resident of the country has a mobile phone, and therefore almost everyone has the possibility of such a payment method. To use, you need a minimum of gestures: take the phone and type a small text, and if payment comes from a mobile application (for example, a game), then the user usually only needs to press the “OK” button a couple of times - the application will generate and send an SMS message.
Despite the fact that most of the amount deducted from the subscriber’s account goes into the operator’s pocket, the size of the accessible audience more than covers the difference: even if we assume that the seller receives one third of the cost of an SMS, it’s enough to have only three times a larger audience than is required to earn the same amount using direct (no commission) payment methods.
- Ease of processing payments
Processing of SMS payments can be fully automated. And if the provision of the service being sold can also be automated, this means the possibility of fully automating the whole process.
Minuses
- Small percentage
Unfortunately, in the best (for the seller) case, 40% of the SMS cost goes to the operator, and since there can be several intermediaries between the seller and the operator, below, the seller can ultimately receive, say, only 10 20% of the cost. - Fixed cost
The cost of sending an SMS to a short number is determined in advance at the operator level, so the only way to differentiate the amount of payment is to use several short numbers with different values.
- [UPDATE:] Increased probability of failure
Since the message path can be quite long (2-3 jumps), there is an increased (on a vizdku, about 0.1%) probability of SMS delivery failure. With each such case, you have to understand the "manual" mode, which again can be difficult, because first you need to figure out at what stage the failure occurred. If the subscriber turns to the operator, then the problem "goes down" until there is a place of failure. If the subscriber turns to the seller, the problem on the contrary “rises” in the direction of the operator. It is often easier to return money to the subscriber than to understand, and what actually happened.
SMS Life Cycle
')
Types of tariffing
There are two types of tariffing:
- MO-charging ("Mobile Originated")
The cost is deducted from the subscriber's account at the time of sending an SMS to a specific short number.
- MT rating ("Mobile Terminated")
The cost is deducted from the subscriber's account at the time of receiving the SMS message.
More precisely, first the user sends an SMS to a short number (no money is charged for this), then it is checked whether the subscriber has enough money to pay for the service, and whether the seller is ready to provide this service. If all is well, a message is sent to the subscriber, for which a fee is charged.
Which type of tariffication is used in a particular case depends on the country, operator, short number.
[UPGRADE:] Fixed a bug in the MO schema

Payment network agents
- Operators
Clearly, it is those who provide communication services to subscribers. For the provision of services, each operator allocates a number of short numbers, which he rents. A short number refers only to the operator to which the subscriber is connected, i.e. SMS message to a short number is processed only by this service provider. The operator "pinches" the lion's share of the cost of SMS.
- Aggregators
Operators are usually not interested in dealing with individual sellers, since they need constant and large SMS traffic, so operators negotiate with aggregators who are intermediaries between them and the sellers.
It is desirable for the aggregator that SMS messages to the XXXX short number reach him regardless of which operator has the subscriber (otherwise you will have to force the subscriber to find out which operator he has and select the corresponding short number yourself), so he separately negotiates with each operator and takes they are renting room xxxx. Naturally, if one of the popular operators does not want to lease the desired number, then it is more profitable for the aggregator to look for another number to which most operators will agree.
The operator and the aggregator agree on the cost of short numbers among themselves and the share of each in the cost of SMS. Naturally, the aggregator needs the same short number for different operators to be at least approximately the same, but there will always be a small difference. One operator may have the same short number, for example, 150 rubles, and another - 165.
- Subaggregator
Aggregators, in fact, also not always profitable to work directly with sellers, so they can negotiate with subaggregators.
A subaggregator usually negotiates with one or several aggregators on the one hand (for example, because different aggregators may have different coverage across countries and different tariff schedules), and on the other, with sellers. For example, a subaggregator can be any affiliate system that sells, not independently, but through its partners. The subaggregator and the aggregator agree among themselves how they divide the cost of the SMS, remaining after the operator has taken its share.
Of course, nothing interferes with the existence of sub-subaggregators, etc., but since at each stage a significant amount is “pinned off” from the residual SMS cost, this process has a reasonable limitation.
- Sellers
Actually - those who directly provide services, the final link in the chain. Sellers negotiate with the (sub-) aggregator for their share of SMS.
Methods for determining the cost and addressee of the SMS payment
Usually, the cost and aggregator-addressee of the SMS message are determined only by the short number to which it was sent, but in fact this is not always the case. In some cases, it is clarified by the content of the SMS text. The aggregator can agree with the operator that the cost of an SMS to this number will be determined by the so-called “prefix” - a pre-specified combination of characters at the beginning of the SMS text. For example, it may be decided that all SMS to the number XXXX, starting with the text “AGREG1” or “AGREG2”, go to this aggregator, with the first ones costing $ 1 and the second $ 2.
Since the aggregator has a limited number of numbers, it usually agrees with the subaggregator that SMS is sent to it, from certain short numbers and starting with a prefix attached to it, for example, “SUB”. In the case when the cost is set by the prefix, it can be two-syllable, for example, “AGREG1 SUB” (the following is the text essential for the subaggregator).
In turn, the subaggregator can also calculate the vendor by the next level prefix (“AGREG1 SUB SELLER1”), or somehow encrypt the vendor ID in the SMS body.
Full identification of the addressee and the cost of the SMS is determined by the parameters:
Country - Operator - Short number - SMS text.
Technical details
Sub Affiliate Interface
As a rule, all network agents, from the operator to the subaggregator, provide their sub-partners with a tool for obtaining statistics on SMS payments. It is usually made in the form of a site where a sub-partner can register, start his own projects, view current SMS and revenue statistics, and get various reports.
Transportation system
In addition to the user interface, operators and aggregators (and sometimes subaggregators) provide a software interface for two-way interaction. This interface is implemented in the form of web scripts that make http (s) requests to each other when it is necessary to transmit any information.
Consider the example of the interaction of the aggregator and subaggregator.
Each aggregator uses its own protocol and provides its own set of features, there is no standard protocol, but there is a set of standard data that is somehow provided by the aggregator to the sub-partner when receiving an SMS message:
- SMS text
In some cases, text can be delivered without a prefix, or the prefix can be delivered in a separate field.
- Short number
The number to which the message was sent. Required to determine the cost and type of service.
- A country
The service can be provided in different countries, and therefore at different prices. Sometimes a country has to be identified by an operator ID.
- Operator
Some operator ID. Different operators have different prices.
Other possible data:
- Session ID
Provided by most aggregators. Used to determine which of the user requests we are currently processing. For example, for MT-billing, the first request may contain a description of the SMS and session ID, and the second - a delivery report - only the session ID and payment status (delivered / canceled / expected).
The session ID can also be used when responding from the subaggregator to the aggregator. The fact is that more often the aggregators receive a response immediately as a result of the http request (i.e., the aggregator server makes an http request to the subaggregator server, in response to it the subaggregator sends the result of request processing), but sometimes the aggregator requires a response that is not the same request, and in the reverse parallel (i.e. after receiving a request from the aggregator, the subaggregator immediately answers “OK, received”, then processes it and already makes a new http-request to the server of the aggregator, in which it transmits the actual result plus the session ID to it was clear which SMS and there is a speech).
- Subscriber's phone number
Sometimes it is provided completely, sometimes partially, sometimes not at all.
- Caller ID
Provided by some systems in the form of an internal (for the aggregator) subscriber ID.
- Attempt number
Sometimes the aggregator cannot reach the server of the subaggregator the first time, then it can repeat the same request after some time, but specifying a new connection attempt number (0 for the first attempt, 1 for the second, etc.). If for a certain period the aggregator did not reach the subaggregator, then it may cancel payment processing.
- Request time
It may be necessary to identify the message more accurately if the time on the server of the aggregator and subaggregator is not synchronized.
In addition, the following can be transmitted: internal (for the aggregator) short number identifier, tariff identifier, full SMS cost, subaggregator income, currency in which the payment was made, and so on.
In response, the subaggregator usually sends the SMS text to be sent to the subscriber and / or an error description.
Some aggregators allow the subaggregator to send SMS messages when it is necessary (not in response to the subscriber’s SMS, but as a broadcast) to the specified number, but the fee is charged from the subaggregator itself. Also, some aggregators allow you to split the response into several messages.
Securing Communication
For communication security, the following methods are used:
- Using encrypted protocols
- Encrypt request text using a predefined password
- Transfer of a pre-set password in the request text without using encryption
- Transfer MD5-hash from a predefined list of fields including a password
- Limit the list of IPs from which requests can be received
Instead of a conclusion.
Of course, in my article I did not indicate all the possible nuances, and some things were told very blurry, but I tried to give a theoretical basis, which is completely enough to see the system from a bird's-eye view, and use it as a guide to action.
Thanks for attention!