Rate Plan API
Introduction to Rate Plan API
Welcome to SMSGatewayCenter's Rate Plan API! This API allows mobile app users to retrieve their SMS pricing and rate plan information programmatically. Access default SMS rates or detailed country/operator-specific pricing based on your account configuration. Perfect for displaying pricing in mobile applications, calculating costs before sending messages, or building custom billing interfaces. Our RESTful endpoint supports POST and GET methods over HTTP for secure, flexible integration.
About Rate Plan API
The Rate Plan API enables you to:
- Retrieve default SMS rates for your account
- Access DLT rates for India DLT-registered templates
- Get detailed country-specific rates if MCC/MNC routing is enabled
- View operator-specific pricing for international SMS
- Obtain currency information for proper price display
- Calculate SMS costs before sending messages
Rate information is automatically filtered based on your account configuration and visibility settings.
Important Notes
- Sub-users (userType = 4) cannot access rate plans - they inherit pricing from the main account
- Pricing visibility - If administrator has hidden pricing for your account, API returns error 489
- MCC/MNC routing - When enabled, provides detailed country/operator-specific rates
- Default rate - Always included as the first entry in the rates array
- Read-only API - Rate plans can only be read, not created or modified via API
Read Rate Plan
Retrieve SMS pricing information for the authenticated user. Returns default rates or detailed MCC/MNC-based rates depending on your account configuration.
API Endpoint
https://unify.smsgateway.center/SMSApi/rateplan/readHTTP Method
POST GET
| Key | Value | Description |
|---|---|---|
| Login Credentials (Required) | ||
| Authenticate your API request using userid-password or apiKey—choose one method. | ||
| userid | Your Registered Username | Your registered username; use if apiKey isn't provided. Signup for User ID |
| password | Your Password | URL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key |
| Header (optional) Parameters | ||
| apiKey | Your unique apiKey | apiKey needs to be sent as HTTP header when you are not using userid-password method. You can avail this from your user control panel and use instead of userid-password HTTP Request parameter. Please do not disclose this to anyone. |
| Parameter | Type | Required | Description |
|---|---|---|---|
output | String | Optional | Response format. Use json for JSON response (recommended) |
| Field | Type | Description |
|---|---|---|
| Root Level Fields | ||
mccMncRoutingEnabled | Boolean | Whether detailed country/operator routing is enabled for your account |
defaultCurrency | String | Currency code (e.g., USD, EUR, INR) |
currencySymbol | String | Currency symbol for display (e.g., $, €, ₹) |
currencyPosition | String | Position of currency symbol: left or right |
rates | Array | Array of rate plan objects (see below) |
| Rate Object Fields | ||
mcc | String | Mobile Country Code (e.g., "404" for India, "Default" for default rate) |
mnc | String | Mobile Network Code (e.g., "10" for Airtel, "Default" for default rate) |
country | String | Country name (e.g., "India", "United States", "Default") |
countryCode | String | Phone country code with + prefix (e.g., "+91", "+1", "Default") |
operator | String | Mobile network operator name (e.g., "Airtel", "AT&T", "Default") |
rate | String | Rate per SMS message (4 decimal places, e.g., "0.0050") |
dltRate | String | DLT rate for India DLT-registered templates (4 decimal places) |
sortName | String | ISO country code for sorting (e.g., "IN", "US", "UK", "Default") |
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/rateplan/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "userid=YourUsername&password=YourPassword&output=json",
CURLOPT_HTTPHEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"response": {
"api": "rateplan",
"action": "read",
"status": "success",
"msg": "Rate plan retrieved successfully",
"code": 200,
"count": 1,
"data": {
"mccMncRoutingEnabled": false,
"defaultCurrency": "USD",
"currencySymbol": "$",
"currencyPosition": "left",
"rates": [
{
"mcc": "Default",
"mnc": "Default",
"country": "Default",
"countryCode": "Default",
"operator": "Default",
"rate": "0.0050",
"dltRate": "0.0010",
"sortName": "Default"
}
]
}
}
}
Explanation: When MCC/MNC routing is disabled, only the default rate is returned. This is the standard rate applied to all SMS messages sent from your account.
{
"response": {
"api": "rateplan",
"action": "read",
"status": "success",
"msg": "Rate plan retrieved successfully - 125 country rates",
"code": 200,
"count": 125,
"data": {
"mccMncRoutingEnabled": true,
"defaultCurrency": "USD",
"currencySymbol": "$",
"currencyPosition": "left",
"rates": [
{
"mcc": "Default",
"mnc": "Default",
"country": "Default",
"countryCode": "Default",
"operator": "Default",
"rate": "0.0050",
"dltRate": "0.0010",
"sortName": "Default"
},
{
"mcc": "404",
"mnc": "10",
"country": "India",
"countryCode": "+91",
"operator": "Airtel",
"rate": "0.0045",
"dltRate": "0.0000",
"sortName": "IN"
},
{
"mcc": "404",
"mnc": "20",
"country": "India",
"countryCode": "+91",
"operator": "Vodafone",
"rate": "0.0045",
"dltRate": "0.0000",
"sortName": "IN"
},
{
"mcc": "310",
"mnc": "410",
"country": "United States",
"countryCode": "+1",
"operator": "AT&T",
"rate": "0.0080",
"dltRate": "0.0000",
"sortName": "US"
},
{
"mcc": "234",
"mnc": "15",
"country": "United Kingdom",
"countryCode": "+44",
"operator": "Vodafone",
"rate": "0.0070",
"dltRate": "0.0000",
"sortName": "UK"
}
]
}
}
}
Explanation: When MCC/MNC routing is enabled, the API returns detailed country and operator-specific rates. The default rate is always the first entry, followed by all configured country/operator rates.
Error Codes
| Error Code | HTTP Status | Description |
|---|---|---|
200 | 200 | Success - Rate plan retrieved successfully |
485 | 400 | Invalid action. Only read action is supported |
486 | 403 | Rate plans for sub-users are undefined. Please review the rates in the main account |
487 | 404 or 500 | User attributes not found or error occurred while retrieving rate plan |
488 | 405 | Create, Update, or Delete actions are not supported for rate plans |
489 | 403 | Rate plan is not active for your account. Please contact administrator for pricing information |
{
"response": {
"api": "rateplan",
"action": "read",
"status": "error",
"msg": "Rate plan is not active for your account. Please contact administrator for pricing information",
"code": 489
}
}
{
"response": {
"api": "rateplan",
"action": "read",
"status": "error",
"msg": "Rate plans for sub-users are undefined. Please review the rates in the main account",
"code": 486
}
}
Understanding Rate Plan Components
MCC/MNC Explained
- MCC (Mobile Country Code): A unique code identifying the country (e.g., 404 for India, 310 for United States, 234 for United Kingdom)
- MNC (Mobile Network Code): A code identifying the mobile operator within that country (e.g., 10 for Airtel, 20 for Vodafone)
- Combined MCC+MNC: Uniquely identifies a specific mobile network operator in a specific country
Rate Types
| Rate Type | Description | When Applied |
|---|---|---|
| Default Rate | Standard rate for all SMS messages | When MCC/MNC routing is disabled or no specific country rate is configured |
| Country/Operator Rate | Specific rate for messages to a particular country/operator | When MCC/MNC routing is enabled and a specific rate is configured |
| DLT Rate | Rate for India DLT-registered templates | Only applicable for Indian DLT-compliant messages |
Currency Display
The API returns currency information to help you display prices correctly in your mobile app:
- defaultCurrency: Currency code (USD, EUR, INR, etc.)
- currencySymbol: Symbol to display ($, €, ₹, etc.)
- currencyPosition: Whether to show symbol on left or right of amount
// JavaScript example for displaying formatted price
function formatPrice(rate, currencySymbol, currencyPosition) {
if (currencyPosition === 'left') {
return currencySymbol + rate; // e.g., $0.0050
} else {
return rate + currencySymbol; // e.g., 0.0050€
}
}
// Usage
const formattedPrice = formatPrice('0.0050', '$', 'left');
console.log(formattedPrice); // Output: $0.0050Integration Examples
Example 1: Display Default Rate in Mobile App
curl --location 'https://unify.smsgateway.center/SMSApi/rateplan/read' \
--form 'userid="your_username"' \
--form 'password="your_password"' \
--form 'output="json"'Example 2: Calculate SMS Cost Before Sending
<?php
// Step 1: Get rate plan
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://unify.smsgateway.center/SMSApi/rateplan/read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => "userid=YourUsername&password=YourPassword&output=json",
));
$response = json_decode(curl_exec($curl), true);
curl_close($curl);
// Step 2: Extract default rate
$defaultRate = $response['response']['data']['rates'][0]['rate'];
$currencySymbol = $response['response']['data']['currencySymbol'];
// Step 3: Calculate cost for 1000 SMS
$smsCount = 1000;
$totalCost = $defaultRate * $smsCount;
echo "Cost for {$smsCount} SMS: {$currencySymbol}" . number_format($totalCost, 2);
// Output: Cost for 1000 SMS: $5.00
Example 3: Find Rate for Specific Country
import requests
import json
# Step 1: Get rate plan
url = "https://unify.smsgateway.center/SMSApi/rateplan/read"
payload = {
'userid': 'YourUsername',
'password': 'YourPassword',
'output': 'json'
}
response = requests.post(url, data=payload)
data = response.json()
# Step 2: Find rate for India
rates = data['response']['data']['rates']
india_rates = [r for r in rates if r['country'] == 'India']
# Step 3: Display India rates by operator
for rate in india_rates:
print(f"{rate['operator']} (MCC: {rate['mcc']}, MNC: {rate['mnc']}): ${rate['rate']}")
# Output:
# Airtel (MCC: 404, MNC: 10): $0.0045
# Vodafone (MCC: 404, MNC: 20): $0.0045Example 4: Build Pricing Table for Mobile App
// React Native / JavaScript example
async function fetchAndDisplayRates() {
const formData = new FormData();
formData.append('userid', 'YourUsername');
formData.append('password', 'YourPassword');
formData.append('output', 'json');
const response = await fetch('https://unify.smsgateway.center/SMSApi/rateplan/read', {
method: 'POST',
body: formData
});
const data = await response.json();
const rates = data.response.data.rates;
const currencySymbol = data.response.data.currencySymbol;
const currencyPosition = data.response.data.currencyPosition;
// Group rates by country
const ratesByCountry = {};
rates.forEach(rate => {
if (!ratesByCountry[rate.country]) {
ratesByCountry[rate.country] = [];
}
ratesByCountry[rate.country].push(rate);
});
// Display rates
Object.keys(ratesByCountry).forEach(country => {
console.log(`\n${country}:`);
ratesByCountry[country].forEach(rate => {
const price = currencyPosition === 'left'
? `${currencySymbol}${rate.rate}`
: `${rate.rate}${currencySymbol}`;
console.log(` ${rate.operator}: ${price}`);
});
});
}
fetchAndDisplayRates();Best Practices
Recommendations
- Cache rate plans: Store rate information locally and refresh periodically (e.g., once per day) to reduce API calls
- Handle currency properly: Use the provided currency symbol and position for consistent display
- Check MCC/MNC routing: Use
mccMncRoutingEnabledflag to determine UI display logic - Default rate fallback: Always use the default rate (first entry) when specific country rate is not found
- Error handling: Implement proper error handling for error codes 486 and 489
- Format rates: Display rates with appropriate decimal places (typically 4 decimal places)
- Cost calculator: Implement a cost calculator in your mobile app using the rate data
- Pricing transparency: Display pricing information clearly to users before they send messages
Use Cases
Cost Calculator
Build a real-time SMS cost calculator in your mobile app that shows users the exact cost before sending messages.
Pricing Table
Display comprehensive country-wise and operator-wise pricing tables for international SMS services.
Budget Planning
Help users plan their SMS campaigns by calculating total costs based on recipient countries.
Billing Integration
Integrate rate information into your billing system for accurate invoice generation.
Testimonials
Why do Great Businesses Trust SMS Gateway Center?

