Overview

Overview

Offer airtime & data through your channels by using our Top-up API

The Vodacom Top-up API allows partners to be able to top-up their respective customers, enabling them to continuously stay connected with the digital ecosystem

What is it?

What is it

This offering will enable partners to integrate their application and services with Vodacom’s Top-up API, therefore customers can top-up their Vodacom airtime or data without leaving the partners platform. The limited airtime, data and SMS bundles will be available to prepaid and hybrid customers.

Why use it?


Why use it
Benefits for your business:
  • Allows an uninterrupted online experience
  • Seamless partner and customer interaction
  • Single point of interaction

How does it work?

How does it work

The Vodacom TopUp API is available to prepaid and hybrid customers.


The TopUp API is implemented in three easy steps:

Step 1

Set-up your
application

Implement the Top-up API into your app

Step 2

Send a Top-Up
request

Select the required top-up bundle(s) and submit MSISDNS to be provisioned

Step 3

Receive a Top-Up
confirmation

Receive confirmation once end-users account has been topped-up successfully

Get Notified When We Launch

This API product is going through the final stages of development.
Submit your email address to be notified when the product is available for use in your application.

Test API Operations in Postman

View the steps required to test the API operations in Postman using the Postman Collections

1. Download the Postman Collection

Click the Download Postman button at the top of the Documentation page of the relevant product to download the Postman Collection.

A zipped JSON file will be downloaded on to your computer that contains the Postman Collection. Unzip the file and save the contents in a convenient location.

2. Open the file in Postman

Open Postman on your computer and import the JSON file by following these steps:

  1. In Postman, click File > Import
  2. Remaining in the File tab, click Upload Files
  3. Navigate to where you saved the Postman Collection. Select the file and click Open
  4. You will now see a new Collection has been created in your left menu. Click the dropdown arrow to view all the available operations. The Headers, Body and URL will be prepopulated with the required information.

    3. Generate an Access Token

    OAuth 2.0 is an open standard for authorisation and it is used to provide your applications with secure delegated access. OAuth 2.0 works over HTTP and authorises devices, APIs, servers and applications with access tokens rather than credentials.

    Before testing the API you will need to set the authorisation by following these steps:

    1. In Postman, select the OAuth method in the left panel
    2. All necessary fields should be populated for you
    3. Click Send and you should receive a 200 success response
    4. You will see your access token in the access_token key of the JSON object received in the response, as seen in the image below
    5. Copy the access token to authorise your requests

    Please note, the access tokens in the sandbox environments are valid for 24 hours, after which you will have to generate a new access token below to continue testing.

    4. Enable Authorisation in Postman

    You can now use the access token to authorise your requests by following these steps:

    1. In Postman, select the API method you want to test in the left panel
    2. Click the Authorization tab
    3. Paste the copied access token you generated in step 3 in the Token field
    4. Your request will now be authorised

    5. Start Testing the APIs

    You are now ready to begin testing the API methods.

    View the response error details below to understand potential reasons why your request may be failing.

    HTTP Code Description
    401 Invalid or Expired Excess Token
    404 Unauthorized, Failed to Resolve the Request
    429 Rate Limit has been exhausted
    500 Failed to establish the backend connectivity