Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your API key and secret by visiting the developer section in your account.
Authentication
Authenticate the user and issue a token.
Example request:
curl --request POST \
"https://zaylinks.com/api/authenticate" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"client_id\": \"deleniti\",
\"secret_key\": \"rerum\"
}"
const url = new URL(
"https://zaylinks.com/api/authenticate"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"client_id": "deleniti",
"secret_key": "rerum"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/authenticate';
$response = $client->post(
$url,
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'client_id' => 'deleniti',
'secret_key' => 'rerum',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/authenticate'
payload = {
"client_id": "deleniti",
"secret_key": "rerum"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"message": "Authentication successful.",
"access_token": "your_access_token_here"
}
Example response (401):
{
"status": "error",
"message": "The credentials you supplied do not match our record."
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"client_id": "The client id field is required.",
"secret_key": "The secret key field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Airtime
Airtime Networks
requires authentication
Example request:
curl --request GET \
--get "https://zaylinks.com/api/v1/airtime-networks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://zaylinks.com/api/v1/airtime-networks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/airtime-networks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/airtime-networks'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"name": "9mobile",
"serviceID": "9mobile"
},
{
"name": "Airtel",
"serviceID": "airtel"
},
{
"name": "Glo",
"serviceID": "glo"
},
{
"name": "Mtn",
"serviceID": "mtn"
},
{
"name": "Smile",
"serviceID": "smile"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vend Airtime VTU
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/airtime" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"mtn\",
\"amount\": 100,
\"recipient\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/airtime"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "mtn",
"amount": 100,
"recipient": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/airtime';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'mtn',
'amount' => 100,
'recipient' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/airtime'
payload = {
"serviceID": "mtn",
"amount": 100,
"recipient": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, completed):
{
"status": "completed",
"message": "Transaction successful",
"data": {
"type": "Airtime Purchase",
"service": "Mtn",
"amount": "100",
"amount_payable": "100.00",
"recipient": "08161144693"
},
"reference": "20241106161127AQ7CZ0LNVHQB",
"api_response": "Airtime Purchase of Mtn ₦100 for 08161144693 was successful. "
}
Example response (200, pending):
{
"status": "pending",
"message": "Transaction pending",
"data": {
"type": "Airtime Purchase",
"service": "Mtn",
"amount": "100",
"amount_payable": "100.00",
"recipient": "08161144693"
},
"reference": "20241106161127AQ7CZ0LNVHQB",
"api_response": "Airtime Purchase of Mtn ₦100 for 08161144693 was is currently being processed. Please check back after a while. "
}
Example response (200, failed):
{
"status": "failed",
"message": "Transaction failed",
"data": {
"type": "Airtime Purchase",
"service": "Mtn",
"amount": "100",
"amount_payable": "100.00",
"recipient": "08161144693"
},
"reference": "20241106161127AQ7CZ0LNVHQB",
"api_response": "Airtime Purchase of Mtn ₦100 for 08161144693 failed. "
}
Example response (403):
{
"status": "error",
"message": "Mtn Vending service currently unavailable."
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"amount": "The amount field is required.",
"recipient": "The recipient field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cable
Cable Services
requires authentication
Example request:
curl --request GET \
--get "https://zaylinks.com/api/v1/cable-services" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://zaylinks.com/api/v1/cable-services"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/cable-services';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/cable-services'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"name": "Dstv",
"serviceID": "dstv"
},
{
"name": "Gotv",
"serviceID": "gotv"
},
{
"name": "Showmax",
"serviceID": "showmax"
},
{
"name": "Startimes",
"serviceID": "startimes"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cable Plans
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/cable-plans" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"dstv\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/cable-plans"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "dstv"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/cable-plans';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'dstv',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/cable-plans'
payload = {
"serviceID": "dstv"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"planName": "Dstv Padi",
"planId": 1,
"cableType": "Dstv",
"serviceID": "dstv",
"price": "1850",
"status": "active"
},
{
"planName": "Dstv Yanga",
"planId": 2,
"cableType": "Dstv",
"serviceID": "dstv",
"price": "2565",
"status": "active"
}
]
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Verify Smart Card Number
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/verify-smart-card-number" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"dstv\",
\"smartCardNumber\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/verify-smart-card-number"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "dstv",
"smartCardNumber": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/verify-smart-card-number';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'dstv',
'smartCardNumber' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/verify-smart-card-number'
payload = {
"serviceID": "dstv",
"smartCardNumber": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"customerName": "Testermetri",
"currentBouquet": "DStv Compact N7900 + ExtraView Access N2,500"
}
Example response (403):
{
"status": "error",
"message": "Please check the Smartcard Number and Try Again"
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"smartCardNumber": "The smart card number field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vend Cable
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/cable" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"dstv\",
\"planId\": 2,
\"smartCardNumber\": 123456789,
\"subscriptionType\": \"renew, change\",
\"quantity\": 1,
\"phoneNumber\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/cable"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "dstv",
"planId": 2,
"smartCardNumber": 123456789,
"subscriptionType": "renew, change",
"quantity": 1,
"phoneNumber": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/cable';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'dstv',
'planId' => 2,
'smartCardNumber' => 123456789,
'subscriptionType' => 'renew, change',
'quantity' => 1,
'phoneNumber' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/cable'
payload = {
"serviceID": "dstv",
"planId": 2,
"smartCardNumber": 123456789,
"subscriptionType": "renew, change",
"quantity": 1,
"phoneNumber": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, completed):
{
"status": "completed",
"message": "Transaction successful",
"data": {
"type": "Cable Purchase",
"service": "Dstv",
"plan": {
"planName": "Dstv Padi",
"planId": 1,
"serviceID": "dstv"
},
"recipient": {
"smart_card_number": "1212121212",
"meter_type": null,
"name": "Testermetri",
"previousBouquet": "DStv Compact N7900 + ExtraView Access N2,500"
},
"subscription_type": "renew",
"quantity": "1",
"amount": 1850,
"amount_payable": 1850,
"phone_number": "08161144693"
},
"reference": "20241108144552JGAYIWTU7NTY",
"api_response": "Cable Purchase of Dstv Dstv Padi for 1212121212 (Testermetri) was successful. "
}
Example response (200, pending):
{
"status": "pending",
"message": "Transaction pending",
"data": {
"type": "Cable Purchase",
"service": "Dstv",
"plan": {
"planName": "Dstv Padi",
"planId": 1,
"serviceID": "dstv"
},
"recipient": {
"smart_card_number": "1212121212",
"meter_type": null,
"name": "Testermetri",
"previousBouquet": "DStv Compact N7900 + ExtraView Access N2,500"
},
"subscription_type": "renew",
"quantity": "1",
"amount": 1850,
"amount_payable": 1850,
"phone_number": "08161144693"
},
"reference": "20241108144552JGAYIWTU7NTY",
"api_response": "Cable Purchase of Dstv Dstv Padi for 1212121212 (Testermetri) is currently being processed. Please check back after a while.. "
}
Example response (200, failed):
{
"status": "failed",
"message": "Transaction failed",
"data": {
"type": "Cable Purchase",
"service": "Dstv",
"plan": {
"planName": "Dstv Padi",
"planId": 1,
"serviceID": "dstv"
},
"recipient": {
"smart_card_number": "1212121212",
"meter_type": null,
"name": "Testermetri",
"previousBouquet": "DStv Compact N7900 + ExtraView Access N2,500"
},
"subscription_type": "renew",
"quantity": "1",
"amount": 1850,
"amount_payable": 1850,
"phone_number": "08161144693"
},
"reference": "20241108144552JGAYIWTU7NTY",
"api_response": "Cable Purchase of Dstv Dstv Padi for 1212121212 (Testermetri) failed. "
}
Example response (403):
{
"status": "error",
"message": "DSTV Vending service currently unavailable."
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"planId": "The plan id field is required.",
"smartCardNumber": "The smart card number field is required.",
"subscriptionType": "The subscription type field is required.",
"quantity": "The quantity field is required.",
"phoneNumber": "The phone number field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Data
Data Networks
requires authentication
Example request:
curl --request GET \
--get "https://zaylinks.com/api/v1/data-networks" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://zaylinks.com/api/v1/data-networks"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/data-networks';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/data-networks'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"name": "9mobile",
"serviceID": "9mobile-data"
},
{
"name": "Airtel",
"serviceID": "airtel-data"
},
{
"name": "Glo",
"serviceID": "glo-data"
},
{
"name": "Mtn",
"serviceID": "mtn-data"
},
{
"name": "Smile",
"serviceID": "smile-data"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Data Types
requires authentication
Example request:
curl --request GET \
--get "https://zaylinks.com/api/v1/data-types" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://zaylinks.com/api/v1/data-types"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/data-types';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/data-types'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"id": 1,
"name": "Data Share"
},
{
"id": 2,
"name": "Sme"
},
{
"id": 3,
"name": "Glo Yakata"
},
{
"id": 4,
"name": "Airtel Hungry Man"
},
{
"id": 6,
"name": "Corporate Gifting"
},
{
"id": 7,
"name": "Mtn Big Boys Plan"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Data Plans
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/data-plans" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"mtn-data\",
\"dataTypeId\": 2
}"
const url = new URL(
"https://zaylinks.com/api/v1/data-plans"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "mtn-data",
"dataTypeId": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/data-plans';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'mtn-data',
'dataTypeId' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/data-plans'
payload = {
"serviceID": "mtn-data",
"dataTypeId": 2
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"planName": "1GB [Data Share] 1 month",
"planId": 1,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1,
"price": "255",
"status": "active"
},
{
"planName": "2GB [Data Share] 1 month",
"planId": 15,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1,
"price": "510",
"status": "active"
},
{
"planName": "3GB [Data Share] 1 month",
"planId": 16,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1,
"price": "765",
"status": "active"
},
{
"planName": "5GB [Data Share] 1 month",
"planId": 17,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1,
"price": "1275",
"status": "active"
}
]
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"data_type": "The data type field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vend Data
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/data" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"mtn-data\",
\"dataTypeId\": 2,
\"planId\": 2,
\"recipient\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/data"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "mtn-data",
"dataTypeId": 2,
"planId": 2,
"recipient": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/data';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'mtn-data',
'dataTypeId' => 2,
'planId' => 2,
'recipient' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/data'
payload = {
"serviceID": "mtn-data",
"dataTypeId": 2,
"planId": 2,
"recipient": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, completed):
{
"status": "completed",
"message": "Transaction successful",
"data": {
"type": "Data Purchase",
"service": "Mtn",
"plan": {
"planName": "1GB [Data Share] 1 month",
"planId": 1,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1
},
"amount": "245",
"amount_payable": "245",
"recipient": "08161144693"
},
"reference": "20241106161223NYJWDYUAYWBF",
"api_response": "Data Purchase of Mtn 1GB for 08161144693 was successful. "
}
Example response (200, pending):
{
"status": "pending",
"message": "Transaction pending",
"data": {
"type": "Data Purchase",
"service": "Mtn",
"plan": {
"planName": "1GB [Data Share] 1 month",
"planId": 1,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1
},
"amount": "245",
"amount_payable": "245",
"recipient": "08161144693"
},
"reference": "20241106161223NYJWDYUAYWBF",
"api_response": "Data Purchase of Mtn 1GB for 08161144693 was successful. "
}
Example response (200, failed):
{
"status": "failed",
"message": "Transaction failed",
"data": {
"type": "Data Purchase",
"service": "Mtn",
"plan": {
"planName": "1GB [Data Share] 1 month",
"planId": 1,
"validity": "1 month",
"network": "Mtn",
"serviceID": "mtn-data",
"dataType": "Data Share",
"dataTypeId": 1
},
"amount": "245",
"amount_payable": "245",
"recipient": "08161144693"
},
"reference": "20241106161223NYJWDYUAYWBF",
"api_response": "Data Purchase of Mtn 1GB for 08161144693 was successful. "
}
Example response (403):
{
"status": "error",
"message": "Mtn Vending service currently unavailable."
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"dataTypeId": "The data type id field is required.",
"planId": "The plan id field is required.",
"recipient": "The recipient field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Electricity
Electricity Services
requires authentication
Example request:
curl --request GET \
--get "https://zaylinks.com/api/v1/electricity-services" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://zaylinks.com/api/v1/electricity-services"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/electricity-services';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/electricity-services'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "success",
"message": "Data fetched successfully",
"data": [
{
"name": "Eko Electricity Distribution Company",
"serviceID": "ekedc"
},
{
"name": "Ibadan Electricity Distribution Company",
"serviceID": "ibedc"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Verify Meter Number
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/verify-meter-number" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"ibedc\",
\"meterType\": \"prepaid, postpaid\",
\"meterNumber\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/verify-meter-number"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "ibedc",
"meterType": "prepaid, postpaid",
"meterNumber": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/verify-meter-number';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'ibedc',
'meterType' => 'prepaid, postpaid',
'meterNumber' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/verify-meter-number'
payload = {
"serviceID": "ibedc",
"meterType": "prepaid, postpaid",
"meterNumber": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"status": "success",
"customerName": "OLADIPO OLUWAFEMI",
"customerAddress": "NONE"
}
Example response (403):
{
"status": "error",
"message": "Please Check your Meter Number and Try Again"
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"meterType": "The meter type field is required.",
"meterNumber": "The meter number field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Vend Electricity
requires authentication
Example request:
curl --request POST \
"https://zaylinks.com/api/v1/electricity" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"serviceID\": \"ibedc\",
\"meterType\": \"prepaid, postpaid\",
\"meterNumber\": \"0123456789\",
\"amount\": 1000,
\"phoneNumber\": \"0123456789\"
}"
const url = new URL(
"https://zaylinks.com/api/v1/electricity"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"serviceID": "ibedc",
"meterType": "prepaid, postpaid",
"meterNumber": "0123456789",
"amount": 1000,
"phoneNumber": "0123456789"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'https://zaylinks.com/api/v1/electricity';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'serviceID' => 'ibedc',
'meterType' => 'prepaid, postpaid',
'meterNumber' => '0123456789',
'amount' => 1000,
'phoneNumber' => '0123456789',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://zaylinks.com/api/v1/electricity'
payload = {
"serviceID": "ibedc",
"meterType": "prepaid, postpaid",
"meterNumber": "0123456789",
"amount": 1000,
"phoneNumber": "0123456789"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200, completed):
{
"status": "completed",
"message": "Transaction successful",
"data": {
"type": "Electricity Purchase",
"service": "Ibadan Electricity Distribution Company",
"amount": "1000",
"amount_payable": "1000.00",
"phone_number": "08161144693",
"recipient": {
"meter_number": "1111111111111",
"meter_type": "prepaid",
"name": "OLADIPO OLUWAFEMI",
"address": "NONE"
}
},
"reference": "20241108123542FF2FLCNIVVL6",
"token": " 0948 8945 8115 3789 5170 ",
"token_unit": "55.03kwH",
"api_response": "Electricity Purchase of Ibadan Electricity Distribution Company (Prepaid) ₦1000 for 1111111111111 was successful. "
}
Example response (200, pending):
{
"status": "pending",
"message": "Transaction pending",
"data": {
"type": "Electricity Purchase",
"service": "Ibadan Electricity Distribution Company",
"amount": "1000",
"amount_payable": "1000.00",
"phone_number": "08161144693",
"recipient": {
"meter_number": "1111111111111",
"meter_type": "prepaid",
"name": "OLADIPO OLUWAFEMI",
"address": "NONE"
}
},
"reference": "20241108123542FF2FLCNIVVL6",
"token": "",
"token_unit": "",
"api_response": "Electricity Purchase of Ibadan Electricity Distribution Company (Prepaid) ₦1000 for 1111111111111 failed. "
}
Example response (200, failed):
{
"status": "failed",
"message": "Transaction failed",
"data": {
"type": "Electricity Purchase",
"service": "Ibadan Electricity Distribution Company",
"amount": "1000",
"amount_payable": "1000.00",
"phone_number": "08161144693",
"recipient": {
"meter_number": "1111111111111",
"meter_type": "prepaid",
"name": "OLADIPO OLUWAFEMI",
"address": "NONE"
}
},
"reference": "20241108123542FF2FLCNIVVL6",
"token": "",
"token_unit": "",
"api_response": "Electricity Purchase of Ibadan Electricity Distribution Company (Prepaid) ₦1000 for 1111111111111 is currently being processed. Please check back after a while.. "
}
Example response (403):
{
"status": "error",
"message": "Ibadan Electricity Distribution Company Vending service currently unavailable."
}
Example response (422):
{
"status": "error",
"message": "Validation errors",
"errors": {
"serviceID": "The service i d field is required.",
"meterType": "The meter type field is required.",
"meterNumber": "The meter number field is required.",
"amount": "The amount field is required.",
"phoneNumber": "The phone number field is required."
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.