MENU navbar-image

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."
    }
}
 

Request      

POST api/authenticate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

client_id   string   

Example: deleniti

secret_key   string   

Example: rerum

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"
        }
    ]
}
 

Request      

GET api/v1/airtime-networks

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
    }
}
 

Request      

POST api/v1/airtime

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the airtime network. Example: mtn

amount   integer   

The amount to be purchased. Example: 100

recipient   numeric   

The phone number of the recipient. Example: 0123456789

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"
        }
    ]
}
 

Request      

GET api/v1/cable-services

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
    }
}
 

Request      

POST api/v1/cable-plans

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the cable. Example: dstv

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."
    }
}
 

Request      

POST api/v1/verify-smart-card-number

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the electricity. Example: dstv

smartCardNumber   numeric   

The meter number. Example: 0123456789

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."
    }
}
 

Request      

POST api/v1/cable

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the data network. Example: dstv

planId   integer   

The id of the data plan. Example: 2

smartCardNumber   integer   

The smart card number. Example: 123456789

subscriptionType   string   

The subscription type. Example: renew, change

quantity   integer   

The quantity to purchase. Example: 1

phoneNumber   numeric   

The phone number of the recipient. Example: 0123456789

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"
        }
    ]
}
 

Request      

GET api/v1/data-networks

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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"
        }
    ]
}
 

Request      

GET api/v1/data-types

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
    }
}
 

Request      

POST api/v1/data-plans

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the data network. Example: mtn-data

dataTypeId   integer   

The id of the Data type. Example: 2

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."
    }
}
 

Request      

POST api/v1/data

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the data network. Example: mtn-data

dataTypeId   integer   

The id of the Data type. Example: 2

planId   integer   

The id of the data plan. Example: 2

recipient   numeric   

The phone number of the recipient. Example: 0123456789

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"
        }
    ]
}
 

Request      

GET api/v1/electricity-services

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
    }
}
 

Request      

POST api/v1/verify-meter-number

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the electricity. Example: ibedc

meterType   string   

The meter type. Example: prepaid, postpaid

meterNumber   numeric   

The meter number. Example: 0123456789

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."
    }
}
 

Request      

POST api/v1/electricity

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

serviceID   string   

The service ID of the electricity. Example: ibedc

meterType   string   

The meter type. Example: prepaid, postpaid

meterNumber   numeric   

The meter number. Example: 0123456789

amount   integer   

The amount to be purchased. Example: 1000

phoneNumber   numeric   

The phone number of the recipient. Example: 0123456789