Skip to content

Airtime Topup

Endpoint

sh
> POST ${BASE_URL}/topup-transactions/airtime-topup

Payloads

NAMETypeDescription
amountnumberAmount the voucher will hold
msisdnstringThe user who is going to claim the voucher/gift

Sample Request

sh
$  curl -H 'Content-Type: application/json' \
        -H 'x-api-token: ACCESS_TOKEN' \
        "BASE_URL/topup-transactions/airtime-topup"
Typescript
import * as axios from "axios";

axios
  .get("BASE_URL/topup-transactions/airtime-topup", {
    headers: {
      "Content-Type": "application/json",
      "x-api-token": "ACCESS_TOKEN"
    },
  })
  .then((response) => {
    console.log("Success:", response.data);
  })
  .catch((error) => {
    console.error(
      "Error:",
      error.response ? error.response.data : error.message,
    );
  });

Response Schema

Success Schema

ts
{
  success: boolean;
  message: string;
  statusCode: number;
  data: {
    message: string,
  }
}

Error Schema

ts
{
  statusCode: number;
  success: boolean;
  message: string;
  data: any;
}

Sample Response

json
{
  "success": true,
  "message": "Successful",
  "statusCode": 200,
  "data": {
    "message": "Your request is being processed"
  }
}