Rate Plan API

Retrieve SMS Pricing and Rate Plans

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/read

HTTP Method

POST GET

 

Required Parameters
KeyValueDescription
Login Credentials (Required)
Authenticate your API request using userid-password or apiKey—choose one method.
useridYour Registered UsernameYour registered username; use if apiKey isn't provided. Signup for User ID
passwordYour PasswordURL-encoded password (for special characters); use if apiKey isn't provided. Signup for API Key
Header (optional) Parameters
apiKeyYour unique apiKeyapiKey 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.

 

Request Parameters
ParameterTypeRequiredDescription
outputStringOptionalResponse format. Use json for JSON response (recommended)
Response Fields
FieldTypeDescription
Root Level Fields
mccMncRoutingEnabledBooleanWhether detailed country/operator routing is enabled for your account
defaultCurrencyStringCurrency code (e.g., USD, EUR, INR)
currencySymbolStringCurrency symbol for display (e.g., $, €, ₹)
currencyPositionStringPosition of currency symbol: left or right
ratesArrayArray of rate plan objects (see below)
Rate Object Fields
mccStringMobile Country Code (e.g., "404" for India, "Default" for default rate)
mncStringMobile Network Code (e.g., "10" for Airtel, "Default" for default rate)
countryStringCountry name (e.g., "India", "United States", "Default")
countryCodeStringPhone country code with + prefix (e.g., "+91", "+1", "Default")
operatorStringMobile network operator name (e.g., "Airtel", "AT&T", "Default")
rateStringRate per SMS message (4 decimal places, e.g., "0.0050")
dltRateStringDLT rate for India DLT-registered templates (4 decimal places)
sortNameStringISO country code for sorting (e.g., "IN", "US", "UK", "Default")
Sample Request Code
<?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;
}
Sample Response (Default Rates - MCC/MNC Routing Disabled)
{
  "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.

Sample Response (MCC/MNC Routing Enabled - Detailed Country Rates)
{
  "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 CodeHTTP StatusDescription
200200Success - Rate plan retrieved successfully
485400Invalid action. Only read action is supported
486403Rate plans for sub-users are undefined. Please review the rates in the main account
487404 or 500User attributes not found or error occurred while retrieving rate plan
488405Create, Update, or Delete actions are not supported for rate plans
489403Rate plan is not active for your account. Please contact administrator for pricing information
Sample Error Response (Pricing Hidden)
{
  "response": {
    "api": "rateplan",
    "action": "read",
    "status": "error",
    "msg": "Rate plan is not active for your account. Please contact administrator for pricing information",
    "code": 489
  }
}
Sample Error Response (Sub-User Access Denied)
{
  "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 TypeDescriptionWhen Applied
Default RateStandard rate for all SMS messagesWhen MCC/MNC routing is disabled or no specific country rate is configured
Country/Operator RateSpecific rate for messages to a particular country/operatorWhen MCC/MNC routing is enabled and a specific rate is configured
DLT RateRate for India DLT-registered templatesOnly 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
Example: Currency Display Logic
// 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.0050

Integration 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.0045

Example 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 mccMncRoutingEnabled flag 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?

K

Kurlon IT

2022-08-04

We have tied up with other SMS providers also, but SMS GatewayCenter is quite good. Good Service from the team. We are very happy with the service be it accounts related or technical issue. We always get good response.

I

INOX Air Products

2018-02-09

We have an excellent experience with SMS Gateway Center. The services and support has been of very high standard.

S

Shalabh Arora

2025-04-11

I’ve been using SMSGatewayCenter’s bulk SMS and WhatsApp services since early 2022 for my small business, and the experience has been fantastic. The platform is intuitive, and the message delivery is incredibly reliable, reaching my customers without fail. The 24/7 support team is quick to assist, and the cost-effectiveness is a big plus. It’s transformed how I connect with my audience, and I highly recommend it to other entrepreneurs! (Google Revirews)

R

Reflex

2025-04-11

We’ve been using your bulk SMS services for a few months, and the results have been phenomenal. The open rates and customer engagement have gone through the roof. Highly recommend for any business looking to scale fast! (Google Revirews)

V

Vedanth Gowda

2025-04-18

I’m Vedanth Gowda, leading a finance business, and I’ve been leveraging SMSGatewayCenter’s bulk SMS and WhatsApp tools —absolutely transformative! The platform’s speed and precision in delivering financial alerts to my clients are unmatched, giving me a competitive edge. Samrat’s expertise in tailoring notification workflows for market updates was a standout, and the robust security features instilled trust. The affordable pricing and proactive support team make it a no-brainer. Perfect for finance pros aiming to elevate client trust and efficiency! (Google Revirews)

N

Naval Bhatnagar

2025-04-12

From day one, the team at SMS GATEWAY CENTER guided us through setup, testing, and launching campaigns. Their support is A+. Whether you’re new to SMS marketing or experienced, they make it smooth. Thank you Aakash. (Google Revirews)


CTA for Unlock Real-Time Messaging – Integrate Today!

Unlock Real-Time Messaging – Integrate Today!

Try Our API in a Sandbox Environment Before Going Live!

Join Thousands of Developers – Try Our API Now!

Get in touchSign up