Skip to main content

AIRTIME AND DATA

These are suites of API that allows you vend airtime and data. Please note that the equivalent value of all data and airtime vended will be charged from your SQUAD WALLET.

API KEYS (Test Environment)

  1. Create an account on our sandbox environment: sandbox.squadco.com
  2. Retrieve keys from the bottom of the Get Started Page
Authorization

Any request made without the authorization key (secret key) will fail with a 401 (Unauthorized) response code.

info

The authorization key is sent via the request header as Bearer Token Authorization

Example: Authorization: Bearer sandbox_sk_94f2b798466408ef4d19e848ee1a4d1a3e93f104046f

VEND AIRTIME

This API allows you vend airtime. Minimum amount that can be vended is 50 naira.

POST
https://sandbox-api-d.squadco.com/vending/purchase/airtime

This API vends Airtime

Parameters

Body

phone_number*

String

11 digit phone number. Format: : '08139011943'

amount*

Integer

Amount is in Naira.

Responses

200:OK
Success
{ 
"status": 200,
"success": true,
"message": "Success",
"data": {
"reference": "app_08139011943_5000_1690387362399",
"amount": "5000.00",
"merchant_amount": "4900.00",
"phone_number": "08139011943",
"merchant_id": "T6AGJQEY",
"wallet_batch_id": "20230726160242715_490000_T6AGJQEY_AIRTIME_NGN",
"transaction_id": "app_08139011943_5000_1690387362399",
"type": "airtime",
"action": "debit",
"status": "pending",
"meta": "{"vending_status":"pending","status_code":"301","message":"pending confirmation","phonenumber":"08139011943","transaction_id":"app_08139011943_5000_1690387362399","network":"MTN"}",
"createdAt": "2023-07-26T16:02:43.341Z"
}
}
401:Unathorized
No Authorization
{
"success": false,
"message": "",
"data": {}
}
403:Forbidden
Invalid/Wrong API Keys
{
"success": false,
"message": "Merchant authentication failed",
"data": {}
}

Sample Request

{
"phone_number": "08139011943",
"amount": 5000
}

VEND DATA BUNDLES

POST
https://sandbox-api-d.squadco.com/vending/purchase/data

This is the data bundle vending endpoint.

Parameters

Body

phone_number*

String

11 digit phone number. Format: : '08139011943'

plan_code*

String

The plan code is gotten from the Get Plan Code endpoint and usually in the format: '1001'

Responses

200:OK
Success
{ 
"status": 200,
"success": true,
"message": "Success",
"data": {
"reference": "app_7062918558_100_1001_1679914203047",
"amount": "100.00",
"merchant_amount": "98.00",
"phone_number": "+2347062918558",
"merchant_id": "AABBCCDDEEFFGGHHJJKK",
"wallet_batch_id": "BC8BE65JWG44ZW7AN9KG",
"transaction_id": "edf867fa-8ad6-4eac-bd87-6e5f8ec9b945",
"type": "data",
"action": "debit",
"status": "success",
"meta": "{"vending_status":"success","status_code":"200","message":"successfully submitted for processing","phonenumber":"07062918558","transaction_id":"edf867fa-8ad6-4eac-bd87-6e5f8ec9b945","network":"MTN"}",
"createdAt": "2023-03-27T10:50:04.073Z"
}
}
401:Unathorized
No Authorization keys
{
"success": false,
"message": "",
"data": {}
}
403:Forbidden
Invalid/Wrong Keys
{
"success": false,
"message": "Merchant authentication failed",
"data": {}
}

Sample Request

{
"phone_number": "07062918558",
"amount": 100,
"plan_code": "1001"
}

GET DATA BUNDLES

This API returns all available data bundle plans for all telcos

GET
https://sandbox-api-d.squadco.com/vending/data-bundles?network=MTN

This API returns all available data bundle plans for all telcos

Parameters

Query

network*

String

Teleco ID: MTN, GLO, AIRTEL, 9MOBILE

Responses

200:OK
Success
{ 
"status": 200,
"success": true,
"message": "Success",
"data": [
{
"plan_name": "MTN data_plan",
"bundle_value": "100MB ",
"bundle_validity": " Daily Plan",
"bundle_description": " Daily Plan",
"bundle_price": "100",
"plan_code": "1001",
"network": "MTN"
},
{
"plan_name": "MTN data_plan",
"bundle_value": "200MB",
"bundle_validity": " 2-day Plan",
"bundle_description": " 2-day Plan",
"bundle_price": "200",
"plan_code": "1002",
"network": "MTN"
},
{
"plan_name": "MTN data_plan",
"bundle_value": "350MB",
"bundle_validity": " Weekly Plan",
"bundle_description": " Weekly Plan",
"bundle_price": "300",
"plan_code": "1003",
"network": "MTN"
},
{
"plan_name": "MTN data_plan",
"bundle_value": "750MB",
"bundle_validity": " 2-Week plan",
"bundle_description": " 2-Week plan",
"bundle_price": "500",
"plan_code": "1004",
"network": "MTN"
},
{
"plan_name": "MTN data_plan",
"bundle_value": "1500GB",
"bundle_validity": "365 days",
"bundle_description": "365 days",
"bundle_price": "450000",
"plan_code": "1111",
"network": "MTN"
}
]
}
401:Unathorized
No Authorization
{
"success": false,
"message": "",
"data": {}
}
403:Forbidden
Invalid/Wrong Keys
{
"success": false,
"message": "Merchant authentication failed",
"data": {}
}

GET ALL TRANSACTIONS

This API returns all transactions done by a merchant.

GET
https://api-d.squadco.com/vending/transactions?page=1&perPage=4&action=debit

This API returns all transactions done by a merchant.

Parameters

Query

page

Integer

The page of the transaction you want to view

perPage

Integer

Number of transaction you want to view per page

action

string

The type of transaction you want to see: 'debit'

Responses

200:OK
Response description
{ 
"status": 200,
"success": true,
"message": "Success",
"data": {
"count": 5,
"rows": [
{
"reference": "app_08139011943_5000_1690387362399",
"amount": "5000.00",
"merchant_amount": "4900.00",
"phone_number": "08139011943",
"merchant_id": "T6AGJQEY",
"wallet_batch_id": "20230726160242715_490000_T6AGJQEY_AIRTIME_NGN",
"transaction_id": "app_08139011943_5000_1690387362399",
"type": "airtime",
"action": "debit",
"status": "pending",
"meta": "{"vending_status":"pending","status_code":"301","message":"pending confirmation","phonenumber":"08139011943","transaction_id":"app_08139011943_5000_1690387362399","network":"MTN"}",
"createdAt": "2023-07-26T16:02:43.341Z"
},
{
"reference": "app_08132448598_500_1001_1690387247434",
"amount": "500.00",
"merchant_amount": "490.00",
"phone_number": "08132448598",
"merchant_id": "T6AGJQEY",
"wallet_batch_id": "20230726160047736_49000_T6AGJQEY_DATA__NGN",
"transaction_id": null,
"type": "data",
"action": "debit",
"status": "failed",
"meta": null,
"createdAt": "2023-07-26T16:00:48.212Z"
},
{
"reference": "app_08139011943_5000_1001_1690387152681",
"amount": "5000.00",
"merchant_amount": "4900.00",
"phone_number": "08139011943",
"merchant_id": "T6AGJQEY",
"wallet_batch_id": "20230726155914250_490000_T6AGJQEY_DATA__NGN",
"transaction_id": null,
"type": "data",
"action": "debit",
"status": "failed",
"meta": null,
"createdAt": "2023-07-26T15:59:15.602Z"
},
{
"reference": "app_08139011943_5000_1690363943917",
"amount": "5000.00",
"merchant_amount": "4900.00",
"phone_number": "08139011943",
"merchant_id": "T6AGJQEY",
"wallet_batch_id": "20230726093224159_490000_T6AGJQEY_AIRTIME_NGN",
"transaction_id": "app_08139011943_5000_1690363943917",
"type": "airtime",
"action": "debit",
"status": "pending",
"meta": "{"vending_status":"pending","status_code":"301","message":"pending confirmation","phonenumber":"08139011943","transaction_id":"app_08139011943_5000_1690363943917","network":"MTN"}",
"createdAt": "2023-07-26T09:32:24.638Z"
}
]
}
}
401:Unathorized
Response description
{
"success": false,
"message": "",
"data": {}
}
403:Forbidden
Response description
{
"success": false,
"message": "Merchant authentication failed",
"data": {}
}

GO LIVE

To go live, simply:

  1. Change the base URL for your endpoints from sandbox-api-d.squadco.com to api-d.squadco.com
  2. Sign up on our live enviroment
  3. Complete your KYC
  4. Use the secret keys provided on the dashboard to authenticate your live transactions