How to detect discounts for your mobile number’s operator using Reloadly

Raphael Ugwu

Raphael Ugwu

2 min

When making a top-up, you can access discounts for your mobile number based on your operator. In this guide, you will learn how to detect if discounts exist for your mobile number or the number you want to make a top-up for.

The objective of this guide can be achieved with the following steps:

  • Getting your access token
  • Types of discounts
  • Getting the discount details of your mobile number

You can get your access token by following the steps in this quickstart.

Types of discounts

Local discounts: These discounts are applicable to top-ups made to a mobile number that is registered in the same country of origin as your Reloadly account. For example, if your account’s country is Spain and you want to make a top-up to a mobile number registered in Spain – only local discounts will apply to that mobile number.

International discounts: These are discounts applied when you are making a top-up to a mobile number registered in any country besides the country your account is registered in. For example, if your account’s country is Ghana and you want to make a top-up to a mobile number registered in Colombia, international discounts will apply to that mobile number.

Note that international discounts cannot be applied to local numbers and vice versa.

Getting the discount details of your mobile number

Suppose you are located in Cape Verde and you want to identify if discounts exist for your local mobile number 2389321930. Using your mobile number and Cape Verde’s ISO code, you can make a request to an endpoint that automatically detects operators. The cURL code sample below shows how this can be achieved

curl -i -X GET \
  'https://topups-sandbox.reloadly.com/operators/auto-detect/phone/2389321930/countries/CV' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

If the above request was successful, you should get the following response:

{
  "id": 943,
  "operatorId": 943,
  "name": "Unitel Cape Verde",
  "bundle": false,
  "data": false,
  "pin": false,
  "supportsLocalAmounts": true,
  "supportsGeographicalRechargePlans": false,
  "denominationType": "RANGE",
  "senderCurrencyCode": "CVE",
  "senderCurrencySymbol": "CV$",
  "destinationCurrencyCode": "CVE",
  "destinationCurrencySymbol": "CV$",
  "commission": 6,
  "internationalDiscount": 6,
  "localDiscount": 3,
  "mostPopularAmount": 6240,
  "mostPopularLocalAmount": null,
  "minAmount": 249.61,
  "maxAmount": 454668,
  "localMinAmount": 50,
  "localMaxAmount": 100000,
  "country": {
    "isoName": "CV",
    "name": "Cape Verde"
  },
  "fx": {
    "rate": 1,
    "currencyCode": "CVE"
  },
  "logoUrls": [
    "https://s3.amazonaws.com/rld-operator/f375d995-f33f-4b6a-bd44-b080e5390dd1-size-3.png",
    "https://s3.amazonaws.com/rld-operator/f375d995-f33f-4b6a-bd44-b080e5390dd1-size-2.png",
    "https://s3.amazonaws.com/rld-operator/f375d995-f33f-4b6a-bd44-b080e5390dd1-size-1.png"
  ],
  "fixedAmounts": [],
  "fixedAmountsDescriptions": {},
  "localFixedAmounts": [],
  "localFixedAmountsDescriptions": {},
  "suggestedAmounts": [
    416,
    2080,
    4160
  ],
  "suggestedAmountsMap": {},
  "geographicalRechargePlans": [],
  "promotions": [],
  "status": "ACTIVE"
}

The response above shows you every detail you need to know about your mobile number’s operator. Let’s highlight a few key details

  "operatorId": 943,
  "name": "Unitel Cape Verde",
  "internationalDiscount": 6,
  "localDiscount": 3

The localDiscount property shows that for every top-up you send to your local Unitel Cape Verde mobile number, a discount of 3% will be applied.

Resources

Reloadly Airtime API

Reloadly Developer Documentation

This might also interest you:

Content by developers to developers.

Subscribe to The Monthly Reload for Developers and start receiving all the developers’ updates.

The Monthly Reload: the newsletter for you

Subscribe to our Newsletter and don’t miss any news about our industry and products.

It’s time to build, make your first API call today