Home
Solutions
Pricing
Developers
Blog
Company
+91 91610 19161 WhatsApp
Create account Login
  1. Home
  2. Blog
  3. Guides

Build a plan browsing screen customers actually enjoy

GuidesPublished Updated 6 min read
Phone-style cards for Recommended, Top data packs and Truly unlimited plan categories

People do not browse plans, they scan them. They are looking for one amount they already half-know, or for the best data pack under a budget. A good plan screen makes both fast. The good news is that the Plan Fetch response already hands you the structure.

What comes back

{
  "ERROR": "0",
  "Operator": "Airtel",
  "Circle": "AP",
  "RDATA": {
    "Recommended Packs": [ { "rs": 49, "validity": "1 day", "desc": "DATA : Unlimited | COMBO : 1 day" } ],
    "Top DATA Packs":    [ "..." ],
    "Truly Unlimited":   [ "..." ]
  },
  "MESSAGE": "Operator Plan Successfully"
}

Every key inside RDATA is a category and every value is a list of packs. That maps directly to tabs and cards.

Build tabs from the data

Do not hard-code "Recommended" or "Unlimited". Operators add and rename categories, and a screen that adapts will keep working.

function renderPlans(resp, mount) {
  const groups = resp.RDATA || {};
  const names = Object.keys(groups).filter(k => Array.isArray(groups[k]) && groups[k].length);
  mount.innerHTML = '';
  const tabs = document.createElement('div');
  const list = document.createElement('div');
  names.forEach((name, i) => {
    const b = document.createElement('button');
    b.textContent = name;
    b.onclick = () => show(name);
    tabs.appendChild(b);
  });
  function show(name) {
    list.innerHTML = '';
    groups[name].slice().sort((a, b) => Number(a.rs) - Number(b.rs)).forEach(p => {
      const card = document.createElement('button');
      card.className = 'plan';
      card.textContent = '₹' + p.rs + ' · ' + p.validity + ' · ' + p.desc;
      list.appendChild(card);
    });
  }
  mount.append(tabs, list);
  if (names.length) show(names[0]);
}

Using textContent rather than innerHTML for pack descriptions matters: the text comes from an upstream source, so never inject it as HTML.

Design choices that help customers decide

  • Sort by price within a tab. It is the one ordering everyone understands.
  • Lead with price and validity, then data and benefits. Those are the two numbers people compare.
  • Keep the description short. Show the first line and expand on tap.
  • Keep the amount field. Many customers already know the exact amount; let them type it and match it to a pack.
  • Pre-select Recommended so the first view is never empty.

Add a personal offers row

Call R-Offer Check for the same number and, if it returns offers, show them as a row above the tabs titled "Offers for your number". It is the cheapest way to make the screen feel personal.

Make it fast

  • Fetch the operator first, then the plans, and show a skeleton while waiting.
  • Cache the plan list per operator and circle for a few hours, as described in caching and daily limits.
  • Handle a failure with a retry button, not an empty screen. See error handling and retries.

Test it with awkward data

Try a category with zero packs, a pack with a very long description and a circle where the operator returns only two categories. If the screen still looks right, you are done.

The full parameters are on the Recharge Plan API page and in the Plan Fetch reference.

Frequently asked questions

How are plans grouped in the response?

Plan Fetch returns an RDATA object whose keys are category names such as Recommended Packs, Top DATA Packs and Truly Unlimited. Each key holds a list of packs with rs, validity and desc.

Are the category names always the same?

Not necessarily. Build your tabs from the keys you receive instead of hard-coding names.

How often should I refresh plans?

Cache plan lists for a few hours and refresh when a customer starts a new session.

Ready to build?

Create an account, pick a plan and make your first call today. Every plan includes every endpoint.

Create account Read the docs

Keep reading