SIRP DATA API Documentation

Content

Introduction

Our API is a RESTful interface that enables seamless integration of our services into your application. It uses RESTful endpoints and standard HTTP methods, providing conventional HTTP response codes to signify the success or failure of API requests.

API Keys

You are to pass your API token via the header 'Authentication' key for every request sent to our server. The value should be in the format "Token your-token" (where your-token is your API token).

Keys security

We advise that you keep your API token as secret as possible. If you suspect that your API token has been compromised, login to your account and generate another API token as fast as possibe to render the former token invalid.

API Request

URL: They are stated in the latter part of this documentation

Method: POST

Header: It contains the 'Content-Type' (content format our server accepts), 'Accept' (format of response our server pushes back) and 'Authentication' key (API token).

Body/Content: The request body must be in json format. The fields/parameters are stated in the latter part of this documentation. All parameters are compulsory except stated otherwise.

Sample Request Code (PHP)

                
                
        <?php

            $postRequest = array(
                  'parameter1' => 'value1',
                  'parameter' => 'value1');
        
            $xpostRequest=json_encode($postRequest);
            
            $url= 'url-stated-in-each-service-below';
            $cURLConnection = curl_init($url);
            curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $xpostRequest);
            curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);
        
            curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, array(        
                "Content-Type: application/json",
                "Accept: application/json",
                "Authentication: Token ".$your_token
                ));
                
            $data = curl_exec($cURLConnection);
            curl_close($cURLConnection);
        
            $xdata= json_decode($data, true);
            echo $data;
            exit;

        ?>

                
            

Responses

For all requests, our API returns standard HTTP response codes ranging from 200s-400s (2** to 4**). More details of response returned are included in the 'description' key. Below are the various codes you are likely to recieve and what they mean.

Code Meaning
200 & 201 You did everything right
400 Not all required parameters were provided
401 Authentication failed
402 Request could not be processed
403 The account cannot perform the request
409 Duplicate request detected
424 Transaction failed
500 & above Processing: We are not sure of the status. It has possibly delivered or it could still deliver

It is safer to mark requests that return error codes outside 2** and 4** clearly defined above as pending!

Fetch Balance

This is used to fetch user wallet balance.

URL: https://sirpdata.com/api/balance

Parameters:

Parameter Description
none none

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "balance":"1908.51"        
        },
        "time":"2024-07-12 16:56:14"
    }

    Failure

    {
        "code":"401",
        "description": {
            "errorResponse":"Authentication failed"
        },
        "time":"2024-07-13 20:22:54"
    }                
                
            

Buy Airtime

This is used to purchase airtime for all networks.

URL: https://sirpdata.com/api/airtime

Parameters:

Parameter Description
networkId The ID of the network to recharge from. It can be either '1' for MTN, '2' for Airtel, '3' for Glo or '4' for 9mobile
type Type of airtime recharge. It has the value 'VTU'
phone Beneficiary phone number
amount Amount of airtime to be purchased. A minimum of N50
ref Custom user reference ID (optional)

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07033333333",
            "narration":"MTN VTU N200",
            "trueResponse":"VTU vending N200.00 for 07033333333",
            "amountCharged":"186.00",
            "ourRef":"202407140837823726ae834d34d",
            "userRef":"",
        },
        "time":"2024-07-12 16:56:14"
    }

    Failure

    {
        "code":"424",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07033333333",
            "narration":"MTN VTU N200",
            "errorResponse":"Invalid phone number",
            "amountCharged":"186.00",
            "ourRef":"202407140837823726ae834d34d",
            "userRef":""
        },
        "time":"2024-07-12 16:56:14"
    }


    OR

    {
        "code":"403",
        "description": {
            "errorResponse":"User account disabled. Please contact support"
        },
        "time":"2024-07-12 16:56:14"
    }                
                
            

Fetch Direct Gifting Bundles

This returns all direct gifting data currently available for the network provided.

URL: https://sirpdata.com/api/fetch_direct_gifting_bundles

Parameters:

Parameter Description
networkId The ID of the network whose bundles are to be fetched. It can be either '1' for MTN, '2' for Airtel, '3' for Glo or '4' for 9mobile

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "networkId":"4",
            "networkName":"9mobile",
            "bundles":[
                {
                    "planName":"9MOBILE 1.5GB/30DAYS",
                    "planId":"9mobile_1_5gb30days",
                    "networkPrice":"1000.00"
                    },
                {
                    "planName":"9MOBILE 4.5GB/30DAYS",
                    "planId":"9mobile_4_5gb30days",
                    "networkPrice":"2000.00"
                    },
                {
                    "planName":"9MOBILE 75GB/30DAYS",
                    "planId":"9mobile_75gb30days",
                    "networkPrice":"15000.00"
                    },
            ]
        }
    }

    Failure

    {
        "code":"424",
        "description": {
            "errorResponse":"No bundle found"
        }
    }
                
            

Buy Data

This is used to purchase data bundles for all networks.

URL: https://sirpdata.com/api/data

Parameters:

Parameter Description
networkId The ID of the network to recharge from. It can be either '1' for MTN, '2' for Airtel, '3' for Glo or '4' for 9mobile
datatypeId Type of data bundle to recharge. It has the values SME, SME2, CG and DIRECT-GIFTING
planId This is the ID of the data bundle to be purchased. DIRECT-GIFTING bundles can be fetched using the endpoint above. For others, please refer to PLAN/BOUQUET IDs/DISCOs
phone Beneficiary phone number
ref Custom user reference ID (optional)

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07033333333",
            "narration":"MTN SME Data 5GB",
            "trueResponse":"You have successfully gifted 2347033333333 with 5GB of Data. valid till 8/11/2024 12:00:00 PM",
            "amountCharged":"186.00",
            "ourRef":"202407140837823726ae834d34d",
            "userRef":"",
        },
        "time":"2024-07-12 16:56:14"
    }

    Failure

    {
        "code":"424",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07033333333",
            "narration":"MTN SME Data 5GB",
            "errorResponse":"Invalid phone number",
            "amountCharged":"186.00",
            "ourRef":"202407140837823726ae834d34d",
            "userRef":""
        },
        "time":"2024-07-12 16:56:14"
    }


    OR

    {
        "code":"403",
        "description": {
            "errorResponse":"User account disabled. Please contact support"
        },
        "time":"2024-07-12 16:56:14"
    }                
                
            

Fetch Cable TV Bouquets

This returns all bouquets currently available for the cableType. You can also refer to PLAN/BOUQUET IDs/DISCOs

URL: https://sirpdata.com/api/fetch_cable_tv_bouquets

Parameters:

Parameter Description
cableType Either 'DSTV', 'GOTV' or 'STARTIMES'

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "cableType":"DSTV",
            "bouquets":[
                {
                    "planName":"DSTV HDPVR/XTRAVIEW_ADDON",
                    "planId":"dstv_hdpvrxtraview_addon",
                    "providerPrice":"40000.00"
                    },
                {
                    "planName":"DSTV PADI",
                    "planId":"dstv_padi",
                    "providerPrice":"45000.00"
                    },
                {
                    "planName":"DSTV CONFAM",
                    "planId":"dstv_confam",
                    "providerPrice":"50000.00"
                }
            ]
        }
    }

    Failure

    {
        "code":"424",
        "description": {
            "errorResponse":"No bouquet found"
        }
    }
                
            

Verify Cable TV Customer Info

This is used to ensure that payment is about to be made to the correct Cable TV customer.

URL: https://sirpdata.com/api/verify_cable_tv_customer

Parameters:

Parameter Description
cableType Either 'DSTV', 'GOTV' or 'STARTIMES'
smartcardNo The smartcard or IUC number of the customer's decoder

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "smartcard":"7031xxxxxx",
            "customerName":"Customer Name",
            "customerNumber":"1176237165",
            "status":"Open"
        }
    }

    Failure

    {
        "code":"424",
        "description": {
            "errorResponse":"Verification failed"
        }
    }
                
            

Cable TV Payment

This is used pay for cable tv subscriptions and Topup.

URL: https://sirpdata.com/api/cabletv

Parameters:

Parameter Description
cableType Either 'DSTV', 'GOTV' or 'STARTIMES'
bouquetId This is the bouquet being paid for. All the bouquets have fixed amounts while the bouquet with 'Topup' has custom amount to be specified in the 'amount' parameter.
smartcardNo The smartcard or IUC number of the customer's decoder
amount Amount to be credited to the decoder account (leave empty if bouquet selected is not 'Topup')
ref Custom user reference ID (optional)

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"7031xxxxxx",
            "narration":"DSTV Yanga @ 5000",
            "trueResponse":"Payment successful",
            "amountCharged":"4950.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":"",
        },
        "time":"2024-07-17 15:22:42"
    }

    Failure

    {
        "code":"424",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07033333333",
            "narration":"DSTV Yanga @ 5000",
            "errorResponse":"Payment failed",
            "amountCharged":"4900.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":""
        },
        "time":"2024-07-17 15:22:42"
    }
                
                
            

Verify Electricity Meter Info

This is used to ensure that payment is about to be made to the correct customer.

URL: https://sirpdata.com/api/verify_electricity_meterno

Parameters:

Parameter Description
discoId For Disco IDs, please refer to PLAN/BOUQUET IDs/DISCOs
meterNo This is the electricity account number attached to the customer's postpaid or prepaid meter.

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "meterNo":"3122XXXXXX",
            "customerName":"Akinjide Akin Flat 4",
            "customerAddress":"102 Akinjide Close USA Avenue Abuja"
        }
    }

    Failure

    {
        "code":"424",
        "description": {
            "errorResponse":"Verification failed"
        }
    }
                
            

Electricity Bill Payment

This is used to make payments for electricity.

URL: https://sirpdata.com/api/electricity

Parameters:

Parameter Description
discoId For Disco types and their IDs, please refer to PLAN/BOUQUET IDs/DISCOs
meterNo This is the electricity account number attached to the customer's postpaid or prepaid meter.
amount Amount to be credited to the meter account
ref Custom user reference ID (optional)

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"3122XXXXXX",
            "narration":"EEDC PREPAID N5000",
            "trueResponse": {
                "meterNo":"3122XXXXXX",
                "Token":"82376716826361231"
                },
            "amountCharged":"5000.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":"",
        },
        "time":"2024-07-17 15:22:42"
    }

    Failure

    {
        "code":"424",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"3122XXXXXX",
            "narration":"EEDC PREPAID N5000",
            "errorResponse":"Payment failed",
            "amountCharged":"5000.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":""
        },
        "time":"2024-07-17 15:22:42"
    }
                
                
            

Educational PINs

This is used to purchase examination result checker PINs.

URL: https://sirpdata.com/api/educational-pins

Parameters:

Parameter Description
examType This can be either 'waec_pin', 'neco_pin', 'utme_pin' or 'nabteb_pin'
quantity The number of examination result checker PINs needed.
phone Phone number of the beneficiary
ref Custom user reference ID (optional)

Sample Responses (JSON)

                
    Success

    {
        "code":"200",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07035XXXXXX",
            "narration":"3 NECO PIN(s)",
            "trueResponse": {
                "pin1":"857256XXXXXXXXX",
                "pin2":"823767XXXXXXXXX"
                },
            "amountCharged":"2400.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":"",
        },
        "time":"2024-07-17 15:22:42"
    }

    Failure

    {
        "code":"424",
        "description": {
            "userEmail":"your-email@xyz.com",
            "recipient":"07035XXXXXX",
            "narration":"3 NECO PIN(s)",
            "errorResponse":"Payment failed",
            "amountCharged":"2400.00",
            "ourRef":"202407171522426934ae834d34d",
            "userRef":""
        },
        "time":"2024-07-17 15:22:42"
    }