API Documentation

Introduction

Lajela Recharge API:- is one of the best VTU online/mobile recharge api in nigeria, with our API you can easily integrate Bill Payment, Airtime Purchase, TV Subscription e.t.c, on your website but before you do anything, you should create a free Lajela Account account. Then we will provide you with API Keys that you can use to make API calls.

GET API FOR FREE Join Our WhatsApp Group

Authentication

Authenticate your API calls by including your API KEY in the Authorization header of every request for purchase and subscription. You can manage your API keys from the dashboard. Your API KEY should be kept secret, If for any reason you believe your secret key has been compromised or you wish to reset them, you can do so from the dashboard. But you don't need authentication to access some part of our API. You can simply make GET Request to query Data.

Category

Use this request to get the list of all Category in our platform.

Endpoints - Category

GET: https://recharge.lajela.com/api/category
		

Subcategory

A valid response of this request will get the list of all services in a particular Category.

Example and Response: Services under Airtime Purchase

GET: https://recharge.lajela.com/api/sub-category?category=airtime
		

Service

Request the details of a particular Service including Name, Logo, Amount, Convenience Fee, Product Type, Minimum and Maximum Amount Allowed, it helps in billing customer and payment validation during transactions, with this, you don't necessary need to get all the details of the service from the User End you can dynamically query each service from your Back end.

Example and Response: Services under Airtime Purchase

GET: https://recharge.lajela.com/api/service?service=glo
		

Plans

This request helps to get the list of available plans on a particular service. We are using the Variation for Plan in some case ( Variation is a change or slight difference in condition, amount, or level, typically within certain limits )

Example and Response: Plans under Glo Data Subscription

GET: https://recharge.lajela.com/api/plans?service=glo-data
		

Variation Detail

Query the details of a particular variation including Amount, Variation Name and Code, it helps in billing customer, display information Dynamic before/after Payment

Example and Response: gotv as a service and gotv-plus as a plan.

GET: https://recharge.lajela.com/api/variation?service=gotv&plan=gotv-plus
		

Making Payment

For testing payment use: http://recharge.lajela.com/api/testpay

There two types of payment, the payment for FIX Service (TV Subscription, Data Plan) which has a fixed amount and plan and the payment for Flexible services like Airtime Purchase.

You don't need to know the type of payment for each service, you can dynamically request a service details like Name, Minimum and Maximum Amount Allowed and the type as well with our API. The good news is that our system successfully detect your payment type automatically.

Parameter for each type of payment are describe below.

Flexible Payment

Flexible payment is the payment for service like Airtime Purchase and bellow are the parameter for Flexible payment.

Field Type Description
api key

(Required) Your API Authetification to access your account

requestID Interger

(Required). A unique code for every transaction

serviceID String

serviceID (Required). Merchants or Operator ID ( gotv, glo, mtm-data, airtel etc)

amount Float

Amount (Required). Amount paying without Chargers

phone string

Phone Number (Required without country code).

email String

 Email Address (Optional)

Request Flexible Payment (POST REQUEST)

		
$host = 'http://recharge.lajela.com/api/pay'; $refer= (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $api = 'ap_xxxxxxxxxxxxxxxxxxx'; //Your API Key $data = array( 'serviceID'=> "gotv", //Merchants or Operator ID ( gotv, airtel, dstv, glo-data etc) 'plan'=> "gotv-plus", //The plan Subscribing for (gotv-plus, gotv-value etc) 'amount' => 1900, // (Required) Amount to pay 'customerID' => 111111, // (e.g Dstv SmartCard Number) (Optional). 'phone' => "0703xxxxxxxxxx", //without country code 'email' => "name@example.com", //string 'requestID' => time()+mt_rand() // unique for every transaction ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $host, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_ENCODING => "", CURLOPT_POSTFIELDS => $data, CURLOPT_REFERER => $refer, CURLOPT_HTTPHEADER => array("Authorization: Bearer $api"), CURLOPT_FOLLOWLOCATION=> true, CURLOPT_MAXREDIRS => 10, CURLOPT_POSTREDIR => 3, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", )); $r = curl_exec($curl); curl_close($curl); print_r(json_decode($r,true));

FIX Payment

Flexible payment is the payment for service like Airtime Purchase and bellow are the parameter for Flexible payment.

Parameter

Field Type Description
api key

(Required) Your API Authetification to access your account

requestID Interger

(Required). A unique code for every transaction

serviceID String

serviceID (Required). Merchants or Operator ID ( gotv, glo, mtm-data, airtel etc)

plan String

The plan Subscribing for (gotv-plus, gotv-value etc)

amount Float

Amount (Required). Amount paying without Chargers

customerID String

(e.g Dstv SmartCard Number) (Required). 

phone string

Phone Number (Required without country code).

email String

 Email Address (Optional)

Request Flexible Payment (POST REQUEST)

		
$host = 'http://recharge.lajela.com/api/pay'; $refer= (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $api = 'ap_xxxxxxxxxxxxxxxxxxxx'; //Your API Key $data = array( 'serviceID'=> "mtn", //Merchants or Operator ID ( gotv, airtel, dstv, glo-data etc) 'phone' => "0703xxxxxxxxxx", //integer 'email' => "name@example.com", //string 'amount' => 1000, // (Required) Amount to pay 'requestID' => time()+mt_rand() // unique for every transaction ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $host, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_ENCODING => "", CURLOPT_POSTFIELDS => $data, CURLOPT_REFERER => $refer, CURLOPT_HTTPHEADER => array("Authorization: Bearer $api"), CURLOPT_FOLLOWLOCATION=> true, CURLOPT_MAXREDIRS => 10, CURLOPT_POSTREDIR => 3, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", )); $r = curl_exec($curl); curl_close($curl); print_r(json_decode($r,true));


	 
	   
	   

Response Both Flexible and FIX

The response for Flexible and Fix look similar, just that some Array or json key are left blank if not applicable to the service

Array ( [code] => 000 [status] => TRANSACTION SUCCESSFUL [description] => TRANSACTION SUCCESSFUL [content] => Array ( [transactionID] => 189584034893843 [requestID] => 897439437848 [amount] => 2 [phone] => 0703xxxxxxxxxxx [serviceID] => mtn [email] => name@example.com [customerID] => [plan] => [image] => https://recharge.lajela.com/images/products/200X200/MTN-Airtime.jpg [convinience_fee] => 0 [productType] => flexible [serviceName] => MTN Airtime VTU [status] => TRANSACTION SUCCESSFUL [code] => 000 [description] => TRANSACTION SUCCESSFUL [date] => 2019-03-22T11:16:05+01:00 ) [gateway] => Array ( [referrer] => https://recharge.lajela.com/xxxxxxxx.html [host] => recharge.lajela.com [ip] => 185.2.168.39 ) )

Payment Verification

This is actually useful after Payment, it helps to verify the status of payment, (if the payment was successfully or not due to unforeseen circumstance).

Use this link to verify testing payment http://recharge.lajela.com/api/testverfy

Example and Response: GoTV Payment.

	  
$host = 'http://recharge.lajela.com/api/verify'; $api = 'API KEY'; //Your API Key $data = array( 'requestID' => 8755965695964845 // For the transaction ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $host, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_ENCODING => "", CURLOPT_POSTFIELDS => $data, CURLOPT_HTTPHEADER => array("Authorization: Bearer $api"), CURLOPT_FOLLOWLOCATION=> true, CURLOPT_MAXREDIRS => 10, CURLOPT_POSTREDIR => 3, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", )); $response = curl_exec($curl); print_r(json_decode($response,true));

Response

		
Array ( [code] => 016 [status] => TRANSACTION FAILED [description] => TRANSACTION FAILED [content] => Array ( [transactionID] => 8585405894594 [requestID] => 3414793352 [amount] => 2 [phone] => 090xxxxxxxxxxx [serviceID] => gotv [email] => user@example.com [customerID] => 7017725579 [plan] => gotv-plus [image] => https://recharge.lajela.com/images/products/200X200/Gotv-Payment.jpg [convinience_fee] => 100 [productType] => fix [serviceName] => Gotv Payment [status] => TRANSACTION FAILED [code] => 016 [description] => TRANSACTION FAILED [date] => 2019-03-22T11:16:05+01:00 ) [gateway] => Array ( [referrer] => https://recharge.lajela.com/xxxxxxxx.html [host] => recharge.lajela.com [ip] => 185.2.168.39 ) )

Customer Verification

This request helps to query for customer details and status for services like GoTV, DSTV etc .

Example and Response: a Customer (Mr. Michael on GoTv)

GET: https://recharge.lajela.com/api/customert?service=gotv&id=7017725579
		

Available Balance on Your Account

Get Your Available Balance.

Example and Response: Available balance

		
$host = 'https://recharge.lajela.com/api/balance'; $data = array( 'api' => 'ap_xxxxxxxxxxxxxxxxxxx' // API KEY ); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $host, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_USERPWD => $username.":" .$password, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => $data, )); echo curl_exec($curl);
		
{ "response_description": "000", "content": { "balance": "841" } } }

Purchase Code

This is a verification responses with purchase code, the purchase code is holding pins,tokens,serial numbers for services where such is expected e.g Electricity Bills and WAEC Scratch Cards.

	
Array ( [code] => 016 [status] => TRANSACTION SUCCESSFUL [description] => TRANSACTION SUCCESSFUL [content] => Array ( [transactionID] => 1949818356 [requestID] => 348994843934 [amount] => 900 [phone] => 0xxxxxxxxxxxx [serviceID] => waec [email] => name@example.com [image] => xxxxxxx [convinience_fee] => xxxxxxxxx [productType] => xxxxxxxxxx [serviceName] => xxxxxxxxx [status] => TRANSACTION SUCCESSFUL [code] => 016 [description] => TRANSACTION SUCCESSFUL [date] => 2019-03-22T11:16:05+01:00 ) [gateway] => Array ( [referrer] => https://recharge.lajela.com/xxxxxxxx.html [host] => recharge.lajela.com [ip] => 185.2.168.39 ) [purchaseCode] => Array ( [pin] => 7937493342882252 [serial] => AE03049348349423 ) )

Response Code

Bellow are list of Response Code and their respective meaning.

	
'000':'TRANSACTION SUCCESSFUL', '001':'TRANSACTION QUERY', '011':'INVALID ARGUMENTS', '012':'PRODUCT DOES NOT EXIST', '013':'BELOW MINIMUM AMOUNT ALLOWED', '017':'ABOVE MAXIMUM AMOUNT ALLOWED', '018':'LOW WALLET BALANCE', '014':'REQUEST ID ALREADY EXIST', '015':'INVALID REQUEST ID', '016':'TRANSACTION FAILED', '019':'LIKELY DUPLICATE TRANSACTION', '020':'CUSTOMER CONFIRMED', '021':'ACCOUNT LOCKED', '022':'ACCOUNT SUSPENDED', '023':'INVALID API OR NOT FOUND', '024':'ACCESS NOT ALLOWED' // usually API TOKEN does not match with the requestID '025':'REQUEST METHOD NOT POST'