Get Stated

Airtime API enables you to send airtime from your EtherOne Wallet to specified registered mobile money numbers. You must ensure that you have subscribed to the Airtime API in the EtherOne Dashboard

Authentication ( Optional )

SHA256 RSA Signature

In order to add extra authentication to the airtime API, it is necessary to apply RSA encryption to your data. First, you need to generate a key pair and then upload the public key to the EtherOne dashboard, specifically on the airtime subscription page. To create a signature, follow these steps:

1. Create the data using the following format: phoneNumber&transactionID&amount. Example: "876767672323&256757121212&5000"

2. Use your private key to sign the data and generate a signature. Example: Using the private key "abcd1234", the signature might be "xxxxxxx".

3. Include the generated signature in the JSON body when sending the request. Example: {"signature": "xxxxxxxxx" }

You can use the code samples below to sign your data

// Sample Code In PHP
// Step 1: Prepare the data 
$msisdn = "256757121212";
$transactionID = "876767672323";
$amount = "5000";
$data = $msisdn."&".$transactionID."&".$amount;
      
// Step 2: Load your private key
$privateKey = openssl_pkey_get_private("path/to/private_key.pem");
// Make sure to replace 'path/to/private_key.pem' with the actual path to your private key file

// Step 3: Sign the data
openssl_sign($data, $signature, $privateKey, OPENSSL_ALGO_SHA256);

// Step 4: Encode the signature
$encodedSignature = base64_encode($signature);

// Print or use the JSON string as needed
echo $encodedSignature;

Last updated