Introduction Last Updated: 04-01-2024

The Autopilot API is a RESTful API that allows you to integrate all automation cloud services like Data, Airtime, & Airtime to cash available on the Autopilot platform on your application. The API is built using restful endpoints, standard HTTP verbs which uses standard HTTP response codes to indicate if an API request is successful or not.

Services available on the Autopilot API include:
  • DATA
  • AIRTIME
  • CABLE
  • AUTOMATED AIRTIME TO CASH
  • MOMO CASHIN TRANSFER

Information

Do you need help with integration?

Note

Do you need help with your integration or do you need to ask questions? Kindly create a skype group and add our skype developer account

Environment

Autopilot makes use of two base API endpoint for both sandbox/development and production environment to communicate with our API's

Environment Purpose Base URL
Sandbox/development The sandbox/development environment is used majorly during the product development phase. Note - every single transaction that happens via the sandbox will not. involve real money. No actual value will be spent. Coming Soon!!! https://autopilotng.com/api/test
Production The production environment is used when the product is about to go live and ready to be used by the general public. https://autopilotng.com/api/live

Note

We recommend storing these credentials in environment variables or using a key management tool to keep track of them. You could use one of the following: AWS Secret Manager, HashiCorp Vault, Azure Secret Manager, and so on.

API Keys & Authorization

API Keys

Every API request to Autopilot's endpoints must include an API key If you do not include an API key with your request, or if you use an incorrect or outdated key, Autopilot will reject it and return an error.

Autopilot offers two types of keys: test keys and live keys. When you're ready to go live, use your test keys in your sandbox or development environment, and your live keys when you're ready to go live.

When you sign up for Autopilot, your API keys are generated automatically. To obtain your keys, please go to the dashboard, click on the Account Settings link, and look for your API key under the API & Webhook tabs.

You will see two api key, the one to use will be dependent on the state of your application

Authorization

Every communication with an API will require the API key, which must be sent via a header 'Authorization'. We strongly advise you to keep your API key on your own server and only make it available to team members who absolutely need to have it.

See the code sample below for an example.

curl --location --request POST {{baseUrl}}/v1/load/wallet-balance \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
       '{
          "email":  "{{email}}" 
        }'
Security

While we strongly recommend you to keep your keys private, we recognize that bad things do happen. If your key has been compromised or you suspect something has gone wrong, we strongly advise you to generate a new key right away. When you generate a new key, all previous keys become invalid, and Autopilot will not honor requests sent with those keys.

Errors

For all of our transactions, Autopilot employs standard HTTP response codes. The error codes range from the 200s to the 500s. Success is indicated by HTTP response codes in the 2xx range. Depending on the action taken, we will typically send you a 200 or a 201. Those in the 4xx range indicate an error that was not detected based on the information provided (e.g., a required parameter was omitted or access is denied from a resource etc.). Error codes in the 5xx range indicate a problem on our end (we are humans after all). See below:

Code Meaning What happened
200 OK Everything is fine. You're cleared for take off.
201 Created Everything is still fine, but this time around, we created a resource for you on our end. We are kind like that.
401 Unauthorized You didn't provide a valid API key.
409 Conflict The request conflicted with another one. There's a high likelihood that we have already treated this request.
424 Failed Ouch! We couldn't accept this request, you omitted a required parameter or it's an outright failure from us. Don't break a sweat, reconfirm, again.
429 Too Many Request You're hitting our API too quickly. Pump your breaks, captain.
5xx Server Error We messed up and we are sorry 😞, We advise that you check that you have not been debited for the transaction

Getting started

To begin using Autopilot as your preferred By Now, Data, Airtime, Airtime2Cash, Cable Automation solution, you must first create an account. Simply register via the our platform. When you're finished, log-on into your account, go to the account settings page, check the API & Webhook tabs, and copy your Autopilot api key. We'll be needing it soon. To begin integrating Autopilot as a customer, simply place your API key in the header section of your request. When you finish this process, you'll be halfway there.

Information

Do you need help with integration?

Note

Do you need help with your integration or do you need to ask questions? Kindly create a skype group and add our skype developer account

Get Wallet Balance

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Query Wallet Balance

This endpoint allows you to query your wallet balance, it returns a json array

{{baseUrl}}/v1/load/wallet-balance

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/wallet-balance \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
       '{
          "email":  "{{email}}"
        }'
Sample Response Code

           {
                "status": true,
                "code": 200,
                "data": {
                    "product": {
                        "wallet": "82318.60"
                    }
                }
            }
        

Sell Data

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Endpoint Available Under This Section

To integrate the Autopilot Buy Data API, the endpoints below applies:

  • Get Networks: This endpoint allows you to query all the networks that we have. It returns json array for networks.
  • Get Data Types: (Using the "networkId" gotten in the first step), this endpoint allows you to query all the data types that we have. It returns json array for data types.
  • Get Data Plans: (Using the "networkId" & "dataType" gotten in the first and second step above), this endpoint allows you to query all the data plans that we have. It returns json array for data plans.
  • Purchase Data: (Using the "networkId", "dataType", "planId" gotten in the first, second, third step above, and other parameters that will be shown below under purchase data), this endpoint allows you to shoot your "buy data products" request to our system. It returns json array for "Buy Data.
Get Networks

This endpoint allows you to query all the networks that we have. It returns json array for networks.

{{baseUrl}}/v1/load/networks

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/networks \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        '{
          "networks":  "all"
         }'
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "network": "MTN",
                        "networkId": 1
                    },
                    {
                        "network": "AIRTEL",
                        "networkId": 2
                    },
                    {
                        "network": "GLO",
                        "networkId": 3
                    },
                    {
                        "network": "9MOBILE",
                        "networkId": 4
                    }
                ]
            }
        }
    
Get Data Types

This endpoint allows you to query all the data types that we have. It returns json array for data types.

{{baseUrl}}/v1/load/data-types

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/data-types \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "networkId": "1"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "SME"
                    },
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "CORPORATE GIFTING"
                    },
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "DIRECT GIFTING"
                    }
                ]
            }
        }
    
Get Data Plans

This endpoint allows you to query all the data plans that we have. It returns json array for data plans.

{{baseUrl}}/v1/load/data

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/data \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "networkId": "1",
                "dataType": "SME"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "planName": "500MB [SME] 30DAYS",
                        "planId": "MTN_SME_500MB_30DAYS",
                        "description": "Get 500MB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "500MB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "135",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "1GB [SME] 30DAYS",
                        "planId": "MTN_SME_1GB_30DAYS",
                        "description": "Get 1GB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "1GB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "270",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "2GB [SME] 30DAYS",
                        "planId": "MTN_SME_2GB_30DAYS",
                        "description": "Get 2GB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "2GB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "540",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "3GB [SME] 30DAYS",
                        "planId": "MTN_SME_3GB_30DAYS",
                        "description": "Get 3GB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "3GB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "810",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "5GB [SME] 30DAYS",
                        "planId": "MTN_SME_5GB_30DAYS",
                        "description": "Get 5GB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "5GB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "1350",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "10GB [SME] 30DAYS",
                        "planId": "MTN_SME_10GB_30DAYS",
                        "description": "Get 10GB SME Plan Valid for 30 days",
                        "Validity": "30 days",
                        "type": "SME",
                        "bundle": "10GB",
                        "mtnPrice": "0",
                        "mtnStatus": "ACTIVE",
                        "ourPrice": "2700",
                        "ourStatus": "ACTIVE"
                    }
                ]
            }
        }
    
Purchase Data

This endpoint allows you to shoot your "buy data products" request to our system. It returns json array for "Buy Data.

{{baseUrl}}/v1/data

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/data \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "networkId": "1",
                "dataType": "DIRECT GIFTING",
                "planId": "MTN_DG_100MB_DAILY",
                "phone": "0816****841",
                "reference":"20240105026122870221aw285u"
            }
        
Sample Response Code


        Success Response (200)

        {
            "status": true,
            "code": 200,
            "data": {
                "message": "You have successfully gifted 100 MB Daily Plan to 2348****04841.. Partner new balance is 40006.51",
                "reference": "EAZY202405010218176G173H17"
            },
            "time": "2024-05-01 02:18:20"
        }

        Failed Response (424)

        {
            "status": false,
            "code": 424,
            "data": {
                "message": "The broadband phone number you entered is not eligible to buy this bundle. Kindly call 217 or 08031021700 to move your broadband phone number to the Home Broadband Plan.. Partner new balance is 40356.51"
            },
            "time": "2024-05-01 01:59:26"
        }
    

Buy Airtime

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Endpoint Available Under This Section

To integrate the Autopilot Buy Airtime API, the endpoints below applies:

  • Get Networks: This endpoint allows you to query all the networks that we have. It returns json array for networks.
  • Get Airtime Types: (Using the "networkId" gotten in the first step), this endpoint allows you to query all the airtime types that we have. It returns json array for airtime types.
  • Purchase Airtime: (Using the "networkId", "airtimeType", gotten in the first, second step above, and other parameters that will be shown below under purchase airtime), this endpoint allows you to shoot your "buy airtime products" request to our system. It returns json array for "Buy airtime.
Get Networks

This endpoint allows you to query all the networks that we have. It returns json array for networks.

{{baseUrl}}/v1/load/networks

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/networks \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        '{
          "networks":  "all"
         }'
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "network": "MTN",
                        "networkId": 1
                    },
                    {
                        "network": "AIRTEL",
                        "networkId": 2
                    },
                    {
                        "network": "GLO",
                        "networkId": 3
                    },
                    {
                        "network": "9MOBILE",
                        "networkId": 4
                    }
                ]
            }
        }
    
Get Airtime Types

This endpoint allows you to query all the airtime types that we have. It returns json array for airtime types.

{{baseUrl}}/v1/load/airtime-types

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/airtime-types \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "networkId": "1"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "VTU"
                    },
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "AWUF"
                    },
                    {
                        "network": "MTN",
                        "networkId": 1,
                        "name": "SNS"
                    }
                ]
            }
        }
    
Purchase Airtime

This endpoint allows you to shoot your "buy airtime products" request to our system. It returns json array for "Buy Airtime".

{{baseUrl}}/v1/airtime

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/airtime \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        for VTU
            {
                "networkId": "1",
                "airtimeType": "VTU",
                "amount": "10",
                "phone": "0816****382",
                "reference": "202306281235-DDYUDHYVRGDGD"
            }
        for SNS with quantity specified
            {
                "networkId": "1",
                "airtimeType": "SNS",
                "amount": "100",
                "phone": "0816****382",
                "quantity": "1",
                "reference": "202306281235-DDYUDHYVRGDGD"
            }
        for SNS with quantity not specified (default will be 1 )
            {
                "networkId": "1",
                "airtimeType": "SNS",
                "amount": "100",
                "phone": "0816****382",
                "reference": "202306281235-DDYUDHYVRGDGD"
            }

        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "networkDiscovered": "AIRTEL",
                "message": "Recharge Successful Momo New Float Balance Is N850.00 Your New Commission Balance Is N34.04",
                "reference": "EAZY20240501040907LET2ZU07"
            },
            "time": "2024-05-01 04:09:13"
        }
    

Sabimen Cable TV Subscription

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Endpoint Available Under This Section

To integrate the Autopilot Cable TV API, the endpoints below applies:

  • Get Cable Types: This endpoint allows you to query all the Cables that we have. It returns json array for Cables.
  • Get Cable Packages: (Using the "cableType" gotten in the first step), this endpoint allows you to query all the cable packages that we have. It returns json array for cable packages.
  • Validate SmartCardNo: This endpoint allows you to validate SMARTCARD or IUC number. It returns json array for the validated details. (Not needed for SHOWMAX)
  • Cable TV Subscription: (Using the "cableType", "planId", gotten in the first, second step above, and other parameters that will be shown below under Cable TV Subscription), this endpoint allows you to shoot your "Cable TV Subscription" request to our system. It returns json array for "Cable TV Subscription.
Get Cable Types

This endpoint allows you to query all the cables that we have. It returns json array for cable.

{{baseUrl}}/v1/load/cable-types

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/cable-types \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "cables": "all"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "cableType": "DSTV",
                        "cableId": 1
                    },
                    {
                        "cableType": "GOTV",
                        "cableId": 2
                    },
                    {
                        "cableType": "STARTIMES",
                        "cableId": 3
                    },
                    {
                        "cableType": "SHOWMAX",
                        "cableId": 4
                    }
                ]
            }
        }
    
Get Cable Packages

This endpoint allows you to query all the cable packages that we have. It returns json array for cable packages.

{{baseUrl}}/v1/load/cable-packages

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/load/cable-packages \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "cableType": "GOTV"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "product": [
                    {
                        "planName": "GOtv Smallie - monthly",
                        "planId": "GOTV_SMALLIE_MONTHLY",
                        "description": "Get GOtv Smallie - monthly",
                        "type": "GOTV",
                        "multichoicePrice": "1300",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "1300",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Jinja Bouquet",
                        "planId": "GOTV_JINJA",
                        "description": "Get GOtv Jinja Bouquet",
                        "type": "GOTV",
                        "multichoicePrice": "2700",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "2700",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Jolli Bouquet",
                        "planId": "GOTV_JOLLI",
                        "description": "Get GOtv Jolli Bouquet",
                        "type": "GOTV",
                        "multichoicePrice": "3950",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "3950",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Max Bouquet",
                        "planId": "GOTV_MAX",
                        "description": "Get GOtv Max Bouquet",
                        "type": "GOTV",
                        "multichoicePrice": "5700",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "5700",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Supa Bouquet",
                        "planId": "GOTV_SUPA",
                        "description": "Get GOtv Supa Bouquet",
                        "type": "GOTV",
                        "multichoicePrice": "7600",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "7600",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Smallie - yearly",
                        "planId": "GOTV_SMALLIE_YEARLY",
                        "description": "Get GOtv Smallie - yearly",
                        "type": "GOTV",
                        "multichoicePrice": "10200",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "10200",
                        "ourStatus": "ACTIVE"
                    },
                    {
                        "planName": "GOtv Supa Plus",
                        "planId": "GOTV_SUPA_PLUS",
                        "description": "Get GOtv Supa Plus Bouquet",
                        "type": "GOTV",
                        "multichoicePrice": "12500",
                        "multichoiceStatus": "ACTIVE",
                        "ourPrice": "12500",
                        "ourStatus": "ACTIVE"
                    }
                ]
            }
        }
    
Validate Smartcard or Iuc Number

This endpoint allows you to validate SMARTCARD or IUC number. It returns json array for the validated details.

{{baseUrl}}/v1/validate/smartcard-no

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/validate/smartcard-no \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "cableType": "GOTV",
                "smartCardNo": "460****771"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "validate": {
                    "customerName": "DANIEL AKINDE",
                    "smartCardNo": "460****771",
                    "dueDate": "Apr Sun, 2024",
                    "currentPackage": "GOTV SMALLIE",
                    "renewalAmount": -1170,
                    "status": "OPEN"
                }
            }
        }
    
Cable TV Subscription

This endpoint allows you to shoot your "subscribe cable TV products" request to our system. It returns json array for "cable TV".

The key "paymentTypes" this key has two option "TOP_UP" and "FULL_PAYMENT"
If the "paymentTypes" key, is set to "TOP_UP" we will topup the decoder with the amount specified in the "amount" key.
If the "paymentTypes" key, is set to "FULL_PAYMENT" we will use the price set for the package based on planId.

{{baseUrl}}/v1/cable

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/cable \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        When paymentTypes is TOP_UP
            {
                "cableType": "GOTV",
                "planId": "GOTV_JOLLI",
                "amount": "100",
                "paymentTypes": "TOP_UP",
                "customerName": "DANIEL AKINDE",
                "smartCardNo": "460****771",
                "reference": "2024010704123289238864542435S"
            }

        When paymentTypes is FULL_PAYMENT
            {
                "cableType": "GOTV",
                "planId": "GOTV_JOLLI",
                "paymentTypes": "FULL_PAYMENT",
                "customerName": "DANIEL AKINDE",
                "smartCardNo": "460****771",
                "reference": "2024010704123289238864542435S"
            }

        Showmax Payload
            {
                "cableType": "SHOWMAX",
                "planId": "SHOWMAX_ENTERTAINMENT_MOBILE_ONLY_1",
                "paymentTypes": "FULL_PAYMENT",
                "phoneNo": "08166**00000",
                "reference": "2024010704123289238864542435S"
            }
        
Sample Response Code

        GOTV RESPONSE
            {
                "status": true,
                "code": 200,
                "data": {
                    "message": "gotv cable tv subscription was successful on 460****771",
                    "reference": "EAZY20242804114628QJ630028"
                },
                "time": "2024-28-04 11:46:39"
            }

        SHOWMAX RESPONSE
            {
                "status": true,
                "code": 200,
                "data": {
                    "message": "Dstv Showmax subscription of NGN1200 was successful on 0816****382 Voucher : SHMIYEX54QE3TPX",
                    "reference": "EAZY20242804114628QJ630028"
                },
                "time": "2024-28-04 11:46:39"
            }
    

Momo Psb Cashin Transfer

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Endpoint Available Under This Section

To integrate the Autopilot Momo Psb Cashin Transfer API, the endpoints below applies:

  • Transfer : (Using the "amount", "phone", and other parameters that will be shown below under purchase airtime), this endpoint allows you to shoot your "cashin transfer" request to our system. It returns json array for "Momo Cashin Transfer.
Transfer Momo Cashin

This endpoint allows you to shoot your "transfer momo cashin products" request to our system. It returns json array for "Momo Cashin Transfer".

{{baseUrl}}/v1/momo-psb

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/momo-psb \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "amount": "10",
                "phone": "0816****382",
                "reference": "202306281235-DDYUDHYVRGDGD"
            }
        
Sample Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "message": "Dear Daniel, you have successfully transferred N10 from your MoMo Wallet to J***t O****de, 234816***382 MoMo PSB wallet.",
                "reference": "EAZY20240901121154UTUM2B54"
            },
            "time": "2024-09-01 12:11:55"
        }
    

AUTOMATED AIRTIME 2 CASH

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

How It Works

To integrate the Automated Airtime2Cash API, the following steps applies:

  1. Send/Resend OTP: A One-Time-Password (OTP) is sent to the senderNumber.
  2. Verify OTP: The received OTP is then passed to the "verify-otp" endpoint, which returns a json response.
  3. Send Airtime: The received sessionId is then passed to the "send-airtime" endpoint, which returns a json response. By following these steps, you can securely send airtime to the receiverNumber with the explicit consent of the senderNumber holder.
OVERVIEW

Our Auto A2C integration allows you to Generate OTP, Verify OTP, Auto Send the airtime from the associated senderNumber using our API. Follow the steps below to seamlessly integrate this functionality into your application.

PREREQUISITES

To get started, please ensure to use the "Get All Networks" endpoint to get available endpoint Learn more about Networks here

STEP 1: Send Or Resend OTP

This API call initiates an A2C consent request by providing the key and value below. The senderNumber value should be passed as a required field in the request body. Upon successful call, the API will respond with an identififier.

This API call initiates an A2C consent request by providing the key and value below. The senderNumber value should be passed as a required field in the request body. Upon successful initiation, the API will respond with a session ID.

To Send/Resend OTP request, send a POST request to the endpoint below:

{{baseUrl}}/v1/send-resend/auto-airtime-to-cash-otp

Request Body Parameters

  • network (required): The networkId Gotten From The "Get All Networks" Endpoint.
  • senderNumber (required): The Phone Number Where The Airtime Will Be Sent From.

cURL Sample Request

curl --location --request POST {{baseUrl}}/v1/send-resend/auto-airtime-to-cash-otp \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "network": "1",
                "senderNumber": "08166XXX382"
            }
        
Sample Response Code

            {
                "status": true,
                "code": 200,
                "data": {
                    "message": "A verification otp has been resent sent to 0816XXXX382",
                    "identifier": "972AQJT45035UTIBN8KI7Q3UA6R43536788901CEBAA38AF0987654312AD79AC6630"
                },
                "time": "2023-08-11 04:36:34"
            }
    

STEP 2: Verify OTP

This API call verifies the OTP received by the senderNumber. Make sure to include the "identifier" key and value in the request body received from Step 1 above.

To verify the A2C request using the One-Time Password (OTP) received by the senderNumber, send a POST request to the endpoint below:

{{baseUrl}}/v1/verify/auto-airtime-to-cash-otp

Request Body Parameters

  • identifier (required): The sessionId Is Gotten From The Step 1
  • otp (required): The One-Time Password (OTP) received by the senderNumber.

cURL Sample Request

curl --location --request POST {{baseUrl}}/v1/verify/auto-airtime-to-cash-otp \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
            {
                "identifier": "972AQJT45035UTIBN8KI7Q3UA6R43536788901CEBAA38AF0987654312AD79AC6630",
                "otp": "636527"
            }
        
Sample Response Code

            {
                "status": true,
                "code": 200,
                "data": {
                    "message": "Otp Validated Successfully for 0816XXXX382",
                    "airtimeBalance": "₦2795.69",
                    "tariffPlan": "SMEPlus 186 Prepaid",
                    "tariffType": "Prepaid",
                    "sessionId": "09JUYT56YROB60AQDRQH7KR6V2264880044F87241EFBA1FC6ERTYHGFDRTE5OFHV6MI9GV0XQ62B098TXJVTFFXR"
                },
                "time": "2023-02-11 07:44:27"
            }
    

STEP 3: Send Airtime

This API call verifies the sessionId received in step 2 above. Make sure to include the "network, amount, quantity, pin" key and value in the request body received from Step 1 and 2 above.

To send airtime request, send a POST request to the endpoint below:

{{baseUrl}}/v1/send-airtime/auto-airtime-to-cash

Request Body Parameters

  • network (required): The networkId Gotten From The "Get All Networks" Endpoint.
  • amount (required): The Airtime Worth Which The senderNumber Will Like To Send.
  • quantity (required): How Many Times Would You Like To Send The Above Amount eg(1,2,3).
  • pin (required): The Phone Number Transaction Pin.
  • sessionId (required): The sessionId Is Gotten From The Step 2
  • reference (required): A Unique Identifier Learn more about our Reference style here

cURL Sample Request

curl --location --request POST {{baseUrl}}/v1/send-airtime/auto-airtime-to-cash \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        {
            "network": "1",
            "amount": "50",
            "quantity": "10",
            "pin": "1234",
            "sessionId": "09JUYT56YROB60AQDRQH7KR6V2264880044F87241EFBA1FC6ERTYHGFDRTE5OFHV6MI9GV0XQ62B098TXJVTFFXR",
            "reference": "202311080164009762037Q2EW6A2C"
        }
        
Sample Response Code


        
        All Success Response (200)

        {
            "status": true,
            "code": 200,
            "data": {
                "message": "Hello Chief! 5 out of 5 were successful",
                "info": {
                    "success": 5,
                    "failed": 0,
                    "unsure": 0
                },
                "details": [
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 23481XXXX4841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1100,
                        "senderBalanceAfter": 1050,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1449,
                        "receiverBalanceAfter": 1499,
                        "reference": "A2C|20231108011435D37B35329936|5028805605177416"
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1050,
                        "senderBalanceAfter": 1000,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1499,
                        "receiverBalanceAfter": 1549,
                        "reference": "A2C|202311080114355489F684FC41|17139115200210102186"
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1000,
                        "senderBalanceAfter": 950,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1549,
                        "receiverBalanceAfter": 1599,
                        "reference": "A2C|20231108011435BD2AC7557EAA|01404145341623380579"
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 950,
                        "senderBalanceAfter": 900,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1599,
                        "receiverBalanceAfter": 1649,
                        "reference": "A2C|20231108011435B1096BDFEA7A|9085642457659538882"
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 900,
                        "senderBalanceAfter": 850,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1649,
                        "receiverBalanceAfter": 1699,
                        "reference": "A2C|202311080114350499166CA991|56198431599154719666"
                    }
                ]
            },
            "time": "2023-08-11 01:14:35"
        }

        Partial Success Response (201)

        {
            "status": true,
            "code": 201,
            "data": {
                "message": "Hello Chief! 0 Failed 3 Successful and 1 Unsure out  of the transactions",
                "info": {
                    "success": 3,
                    "failed": 0,
                    "unsure": 1
                },
                "details": [
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1741,
                        "senderBalanceAfter": 1691,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 979,
                        "receiverBalanceAfter": 1029,
                        "reference": "A2C|20231108022351BE6C9B7413B2|65198309504275259309"
                    },
                    {
                        "status": "unsure",
                        "message": "The system is temporarily unable to process your request. Please try after sometime."
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1691,
                        "senderBalanceAfter": 1641,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1029,
                        "receiverBalanceAfter": 1079,
                        "reference": "A2C|2023110802235174067409863B|21452402654898467015"
                    },
                    {
                        "status": "success",
                        "message": "Yello! You have gifted N50.0 to 234816XXXX841. Share link https://mtnapp.page.link/myMTNNGApp with 234816XXXX841 to download new MyMTN app for exciting offers.",
                        "senderNumber": "0816XXXX382",
                        "senderBalanceBefore": 1641,
                        "senderBalanceAfter": 1591,
                        "receiverNumber": "0816XXXX841",
                        "receiverBalanceBefore": 1079,
                        "receiverBalanceAfter": 1129,
                        "reference": "A2C|202311080223513366F1F13A91|3808905090881541439"
                    }
                ]
            },
            "time": "2023-08-11 02:23:51"
        }

        
        All Failed Response (424)

        {
            "status": false,
            "code": 424,
            "data": {
                "message": "Dear Sender You do not have sufficient balance to process this request. Your Current Balance is ₦191.38 and you are trying to send ₦50 worth of airtime in multiples of 10",
                "reference": null
            },
            "time": "2023-08-11 02:00:38"
        }
        
    

GET TRANSACTION STATUS

This endpoint allows you to retrieve data such as status of transaction using the reference you supplied.

Authorization

Every communication with an API will require the API key. Learn more about our Authorization here

Product Available For Requery

To integrate the Autopilot Transaction Status Requery API.

The product below must be used in lower case as a suffix to the url

Any product with two words with space eg RECHARGE CARD should be passed as recharge-card

  • DATA
  • AIRTIME
  • AIRTIME TO CASH

{{baseUrl}}/v1/transaction/status/{{data}}

{{baseUrl}}/v1/transaction/status/{{airtime-to-cash}}

Sample Request Code
curl --location --request POST {{baseUrl}}/v1/transaction/status/{{data}} \
     --header 'Content-Type: application/json' \
     --header 'Accept: application/json' \
     --header 'Authorization: {{Bearer AUTOPILOT_API_KEY}}' \
     --data-raw 
        {
            "reference": "202404011021SGTYYUUDUDUDURTY"
        }
    
Sample DATA Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "type": "Data",
                "message": "You have successfully gifted 100 MB Daily Plan to 2348*****4841.. Partner new balance is 40006.51",
                "yourReference": "20232806094208VBLWM308RRT",
                "ourReference": "20232806094208VBLWM308RRT"
            },
            "time": "2024-01-04 09:42:16"
        }
    
Sample AIRTIME Response Code

        {
            "status": true,
            "code": 200,
            "data": {
                "type": "Airtime",
                "message": "You have topped up N10.00 to 2348*****7382. Your balance is now N477,204.00. ref: 2023062720284751203431431",
                "yourReference": "202328061236344C0YP834RRT",
                "ourReference": "202328061236344C0YP834RRT"
            },
            "time": "2023-28-06 12:36:41"
        }
    

Make sure you follow our htpp status code rule

How To Generate Reference

This section contains the recommended format of generating reference

Reference Format

The Reference should be a string in the unix format YYYYMMDDHHII consisting of today’s date + current hour and minute (e.g: 202306280331) and can be concatenated with any other alphanumeric string as desired (e.g: 202306280331Y5WSUG49ERTYGT or 2023062803314738492849).

Note

  • MUST BE 25 CHARACTERS MINIMUM & 30 CHARCTERS MAXIMUM
  • FIRST 12 CHARACTERS MUST BE NUMERIC
  • FIRST 12 CHARACTERS MUST COMPRISE OF TODAY’S DATE
  • DATE & TIME SHOULD BE IN AFRICA/LAGOS Timezone OR GMT +1

Example: 202306280331Y5WSUG49ERTYGT

Introduction

Learn how to listen to events whenever certain actions occur on your integration.

What are webhooks?

During a transaction lifecycle, Autopilot sends events that your application can listen to. A webhook is an accessible URL on your server to which we send payloads. For example, Autopilot sends webhook events when a transaction has been initiated, failed and when it's successful

By using webhooks, you can tightly integrate your backend application with Autopilot. The platform currently supports one kind of webhook: Data. Webhook follow a common set of rules:

  • Webhook should be reachable from the public internet. During development and you are on localhost, tunnelling services like Ngrok are supported.
  • Webhook should accept HTTP POST requests with JSON payload
  • Webhook should respond with http response codes 200
  • Webhook should respond as fast as possible.
  • Webhook should be ready to accept the same call multiple times: in case of network or remote server failure.
  • Responding to an event

    You should respond to a webhook event with a 200 OK. We consider this an acknowledgement of your application. If your application responds with any status outside of the 2xx range, we will consider it unacknowledged

    We Strongly Advise You To Make use of our key "code" http status code just as we have define the http status code

    Supported Event

    • DATA
    
                    {
                        "status": true,
                        "code": 200,
                        "data": {
                            "type": "Data",
                            "message": "You have successfully gifted 100 MB Daily Plan to 2348*****4841.. Partner new balance is 40006.51",
                            "yourReference": "20232806094208VBLWM308",
                            "ourReference": "20232806094208VBLWM308"
                        },
                        "time": "2023-28-06 09:42:16"
                    }
                
    • AIRTIME
    
                    {
                        "status": true,
                        "code": 200,
                        "data": {
                            "type": "Airtime",
                            "networkDiscovered": "AIRTEL",
                            "message": "Recharge Successful Momo New Float Balance Is N850.00 Your New Commission Balance Is N34.04",
                            "yourReference": "202328061236344C0YP834",
                            "ourReference": "202328061236344C0YP834"
                        },
                        "time": "2023-28-06 12:36:41"
                    }
            

    Idempotent Webhooks

    We strongly suggest you make webhooks idempotent. That means, you should always check the webhook reference and make sure that you're not processing the same webhook more than once.

    Setting up webhook

    In other to take advantage of webhooks, you will have to first set up a publicly available URL that Autopilot can have access to. To set up one, kindly go to your dashboard, click on the Account Settings link and check under the API & Webhook tabs, there, you will find an input box for your webhook.