Purchase Data
curl --request POST \
--url https://api.bleeprs.com/api/purchaseData \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phoneNumber": "08107176819",
"productCode": "MTN_DATA_PRODUCT_CODE",
"voucherCode": "MTN_DATA_VOUCHER_CODE",
"network": "MTN",
"amount": 1000
}
]
'import requests
url = "https://api.bleeprs.com/api/purchaseData"
payload = [
{
"phoneNumber": "08107176819",
"productCode": "MTN_DATA_PRODUCT_CODE",
"voucherCode": "MTN_DATA_VOUCHER_CODE",
"network": "MTN",
"amount": 1000
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
phoneNumber: '08107176819',
productCode: 'MTN_DATA_PRODUCT_CODE',
voucherCode: 'MTN_DATA_VOUCHER_CODE',
network: 'MTN',
amount: 1000
}
])
};
fetch('https://api.bleeprs.com/api/purchaseData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bleeprs.com/api/purchaseData",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'phoneNumber' => '08107176819',
'productCode' => 'MTN_DATA_PRODUCT_CODE',
'voucherCode' => 'MTN_DATA_VOUCHER_CODE',
'network' => 'MTN',
'amount' => 1000
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bleeprs.com/api/purchaseData"
payload := strings.NewReader("[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bleeprs.com/api/purchaseData")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bleeprs.com/api/purchaseData")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]"
response = http.request(request)
puts response.read_body{
"gatewayStatus": "00",
"gatewayMessage": "Successfully Processed",
"requestReference": "KpEAFZutv3SvQ4aMjrv7",
"data": {
"message": "Vending Request successful",
"references": [
"bpr_req_a1b2c3d4e5f6"
]
}
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Data bundle for MTN_DATA_PRODUCT_CODE not found"
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Vending account not configured"
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Data vending is temporarily unavailable across all servers. Please try again later."
}Vending
Purchase Data
Purchase data bundle for a phone number
POST
/
purchaseData
Purchase Data
curl --request POST \
--url https://api.bleeprs.com/api/purchaseData \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phoneNumber": "08107176819",
"productCode": "MTN_DATA_PRODUCT_CODE",
"voucherCode": "MTN_DATA_VOUCHER_CODE",
"network": "MTN",
"amount": 1000
}
]
'import requests
url = "https://api.bleeprs.com/api/purchaseData"
payload = [
{
"phoneNumber": "08107176819",
"productCode": "MTN_DATA_PRODUCT_CODE",
"voucherCode": "MTN_DATA_VOUCHER_CODE",
"network": "MTN",
"amount": 1000
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
phoneNumber: '08107176819',
productCode: 'MTN_DATA_PRODUCT_CODE',
voucherCode: 'MTN_DATA_VOUCHER_CODE',
network: 'MTN',
amount: 1000
}
])
};
fetch('https://api.bleeprs.com/api/purchaseData', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bleeprs.com/api/purchaseData",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'phoneNumber' => '08107176819',
'productCode' => 'MTN_DATA_PRODUCT_CODE',
'voucherCode' => 'MTN_DATA_VOUCHER_CODE',
'network' => 'MTN',
'amount' => 1000
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bleeprs.com/api/purchaseData"
payload := strings.NewReader("[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bleeprs.com/api/purchaseData")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bleeprs.com/api/purchaseData")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"phoneNumber\": \"08107176819\",\n \"productCode\": \"MTN_DATA_PRODUCT_CODE\",\n \"voucherCode\": \"MTN_DATA_VOUCHER_CODE\",\n \"network\": \"MTN\",\n \"amount\": 1000\n }\n]"
response = http.request(request)
puts response.read_body{
"gatewayStatus": "00",
"gatewayMessage": "Successfully Processed",
"requestReference": "KpEAFZutv3SvQ4aMjrv7",
"data": {
"message": "Vending Request successful",
"references": [
"bpr_req_a1b2c3d4e5f6"
]
}
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Data bundle for MTN_DATA_PRODUCT_CODE not found"
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Vending account not configured"
}{
"gatewayStatus": "88",
"gatewayMessage": "Unsucessfull",
"requestReference": "bpr_req_a1b2c3d4e5f6",
"data": "Data vending is temporarily unavailable across all servers. Please try again later."
}Overview
Purchase a data bundle for any Nigerian phone number using a specific product code. The data will be credited instantly to the recipient’s phone.Request Body
Send an array with one or more data purchases.Response Fields
string
Reference to store for reconciliation and support.
object
Status Codes
| Code | Meaning |
|---|---|
202 | Batch accepted for processing. Data is credited within a few seconds; use each reference in data.references to track individual items. |
400 | The request could not be processed. Common causes: invalid payload, empty body, or the supplied productCode was not found in the data catalog. |
422 | Your organisation is not yet configured for vending, or an individual item in the batch could not be posted. |
503 | Data vending is temporarily unavailable. Retry after a short delay. If you specified a voucherCode tied to a specific server, try again without one so the other server can be used. |
Purchase Flow
- Get Available Plans: First, call the List Data Plans endpoint to see available data plans for a specific network
- Select Product Code: Choose the desired data plan and note its
ProductCode - Purchase Data: Submit the selected plan details exactly as returned by the catalog
Notes
- Data is credited instantly to the recipient’s phone
- Phone numbers are accepted as
080...,23480..., or80...and normalized to the 11-digit local format; non-Nigerian mobile numbers are rejected before any charge - Product codes and voucher codes are case-sensitive
- Transaction processing may take a few seconds
- Ensure the phone number is on the correct network for the data plan
- Store the
requestReferencereturned by the API for reconciliation and support
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Minimum array length:
1Recipient's phone number. Accepted as 08012345678, 2348012345678, or 8012345678 — normalized to the 11-digit local format.
Example:
"08107176819"
Product code returned by the Data catalog
Example:
"MTN_DATA_PRODUCT_CODE"
Target network returned by the Data catalog
Example:
"MTN"
Voucher code returned by the Data catalog
Example:
"MTN_DATA_VOUCHER_CODE"
Amount returned by the Data catalog
Example:
1000
Data value returned by the Data catalog, when provided
Example:
1024
Response
Batch accepted for processing. Data is credited within a few seconds; use each reference in data.references to track individual items.
Was this page helpful?