Bills Payment
Data Purchase

Data Bundles

Purchase mobile data bundles for all major Nigerian network providers. Retrieve available providers, view data plans, and purchase data subscriptions seamlessly.


Get Data Providers

Retrieve a list of available internet data providers.

Endpoint

GET https://api.budpay.com/api/v2/internet

Sample Request

curl https://api.budpay.com/api/v2/internet \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-X GET

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "Fetched successfully",
    "data": [
        {
            "id": 1,
            "provider": "AIRTEL",
            "providerLogoUrl": "assets/images/bills/Airtel-Data.jpg"
        },
        {
            "id": 2,
            "provider": "MTN",
            "providerLogoUrl": "assets/images/bills/MTN-Data.jpg"
        },
        {
            "id": 3,
            "provider": "GLO",
            "providerLogoUrl": "assets/images/bills/GLO-Data.jpg"
        },
        {
            "id": 4,
            "provider": "9MOBILE",
            "providerLogoUrl": "assets/images/bills/9mobile-Data.jpg"
        },
        {
            "id": 5,
            "provider": "SMILE4G",
            "providerLogoUrl": "assets/images/bills/Smile-Payment.jpg"
        }
    ]
}

Try it out

Response Fields

FieldTypeDescription
successBooleanIndicates if request was successful
codeStringResponse code
messageStringResponse message
dataArrayArray of data provider objects

Provider Object Fields

FieldTypeDescription
idIntegerProvider ID
providerStringNetwork provider name
providerLogoUrlStringURL path to provider logo image

Get Data Plans

Retrieve available data plans for a specific provider.

Endpoint

GET https://api.budpay.com/api/v2/internet/plans/{provider}

Sample Request

curl https://api.budpay.com/api/v2/internet/plans/MTN \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-X GET

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "Internet Data Plans Fetched successfully",
    "data": [
        {
            "id": 1,
            "name": "MTN N100 100MB - (24 Hours)",
            "amount": "100"
        },
        {
            "id": 2,
            "name": "MTN N25 20MB - (24 Hours)",
            "amount": "25"
        },
        {
            "id": 3,
            "name": "MTN N200 200MB - 2 days",
            "amount": "200"
        },
        {
            "id": 43,
            "name": "SME Data Share N50,000 150GB",
            "amount": "50000"
        }
    ]
}

Try it out

Request Parameters

ParameterTypeRequiredDescription
providerStringYesNetwork provider name (MTN, AIRTEL, GLO, 9MOBILE, SMILE4G)

Response Fields

Plan Object Fields

FieldTypeDescription
idIntegerUnique plan ID
nameStringData plan name with details (data size, validity)
amountStringPlan price in Naira

Purchase Data Bundle

Purchase a data bundle for a mobile number.

Endpoint

POST https://api.budpay.com/api/v2/internet/data

Sample Request

curl https://api.budpay.com/api/v2/internet/data \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Encryption: Signature_HMAC-SHA-512" \
-H "Content-Type: application/json" \
-d '{
    "provider": "MTN",
    "number": "07036218209",
    "plan_id": "238",
    "reference": "2459392959593939"
}' \
-X POST

Sample Response

{
    "success": true,
    "code": "00000",
    "message": "SUCCESSFUL",
    "data": {
        "orderNo": "211104130931335009",
        "reference": "25696593r9622",
        "status": "Delivered",
        "errorMsg": null
    }
}

Try it out

Request Parameters

Header Parameters

Field NameDescriptionRequired
AuthorizationBearer token with your secret keyYes
EncryptionSignature_HMAC-SHA-512 for request encryptionYes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
providerStringYesNetwork provider name (MTN, AIRTEL, GLO, 9MOBILE, SMILE4G)
numberStringYesRecipient mobile number
plan_idStringYesData plan ID from plans endpoint
referenceStringYesUnique transaction reference

Response Fields

FieldTypeDescription
successBooleanIndicates if purchase was successful
codeStringResponse code
messageStringResponse message
data.orderNoStringOrder number from provider
data.referenceStringYour transaction reference
data.statusStringDelivery status (Delivered, Pending, Failed)
data.errorMsgStringError message if any (null on success)

Supported Providers

ProviderNetworkDescription
MTNMTN NigeriaMTN data bundles
AIRTELAirtel NigeriaAirtel data bundles
GLOGlo NigeriaGlo data bundles
9MOBILE9mobile Nigeria9mobile data bundles
SMILE4GSmile TelecomSmile 4G data plans

Purchase Status

StatusDescription
DeliveredData bundle delivered successfully
PendingPurchase being processed
FailedPurchase failed (check errorMsg)

Error Handling

400 Bad Request

{
    "success": false,
    "message": "Invalid request parameters"
}

401 Unauthorized

{
    "success": false,
    "message": "Authentication failed"
}

422 Validation Error

{
    "success": false,
    "message": "Validation error",
    "errors": {
        "number": ["Invalid phone number format"],
        "plan_id": ["Plan ID is required"]
    }
}

Best Practices

Tip: Always fetch the latest data plans before purchase to ensure accurate pricing and availability.

  1. Fetch Latest Plans: Query plans endpoint before each purchase
  2. Validate Phone Number: Ensure phone number matches the provider's network
  3. Unique References: Generate unique reference IDs for each transaction
  4. Check Balance: Verify wallet balance before purchase
  5. Store Order Numbers: Save order numbers for customer support queries
  6. Handle Status: Implement proper handling for pending and failed statuses
  7. User Confirmation: Display plan details for user confirmation before purchase

Data Purchase Workflow

💡

Process Flow: Get providers → Select provider → Get plans → Select plan → Purchase data

  1. Get Providers: Fetch available data providers
  2. Select Provider: User selects their network provider
  3. Get Plans: Retrieve data plans for selected provider
  4. Display Plans: Show plans with data size, validity, and price
  5. User Selection: User selects plan and enters phone number
  6. Generate Reference: Create unique transaction reference
  7. Purchase Data: Submit purchase request
  8. Track Status: Monitor delivery status
  9. Notify User: Inform user of successful delivery

Security Considerations

⚠️

Security: The Encryption header with HMAC-SHA-512 signature is required for all data purchase requests.

  • HMAC Signature: Always include the Encryption: Signature_HMAC-SHA-512 header
  • Server-Side Only: Never expose secret keys in frontend code
  • HTTPS Only: All requests must use secure HTTPS connections
  • Reference IDs: Use unpredictable reference IDs to prevent replay attacks
  • Validate Input: Sanitize phone numbers and plan IDs before submission

Next Steps