Welcome to the API documentation fo Afiliate Login, Airtime, Date Purchase, Cable & Electricity Purchase
POST yoursiteurl.vendutility.com/api/v1/auth/
Description: This API endpoint handles user login by validating the provided email and password. If the credentials are correct, it generates JWT access and refresh tokens for the authenticated user. If the credentials are invalid, it returns an error message.
{ "email": "[email protected]", "password": "user_password" }
Fields:
{ "status": true, "BearerToken": "access_token_here", "refresh_token": "refresh_token_here" }
{ "status": false, "message": "User does not exist" }
{ "status": false, "message": "Invalid credentials" }
{ "status": false, "message": "An error occurred: [error_details]" }
POST yoursiteurl.vendutility.com/api/v1/airtime/
Description: This API allows an authenticated user to purchase airtime. It checks the user's wallet balance and processes the purchase with an external service provider's API. The wallet is debited with the airtime amount, and the transaction is logged.
{ "card_phone_number": "08012345678", "card_amount": "1000", "card_network": 1 }
Fields:
{ "status": true, "data": { "id": 123, "customer": "[email protected]", "amount": "1000.00", "phone_number": "08012345678", "wallet_balance": "1500.00", "old_wallet_balance": "2500.00", "status": "Transaction Successful", "api_transaction_id": "transaction_reference_token", "transaction_response": "API response text here", "active_api": "Plugin Name" } }
data (object): Contains details of the transaction.
{ "status": false, "message": "Invalid Input Amount" }
{ "status": false, "message": "Card amount must be a valid integer" }
{ "status": false, "message": "Insufficient Fund In Wallet, You Currently have #500" }
{ "status": false, "message": "An error occurred: [error_details]" }
POST yoursiteurl.vendutility.com/api/v1/buy_data/
Description: This API allows the user to buy data by specifying the phone number, mobile network, data plan, and plan type. It performs balance validation, checks available plans, and processes the purchase using a third-party gateway.
{ "phone_number": "user_phone_number", "mobile_network": 1, "data_plan": "data_plan_code", "plantype": "plan_type" }
Fields:
{ "status": true, "data": { "transaction_id": "transaction_reference_token", "amount": 1000, "phone_number": "user_phone_number", "status": "Transaction Successful" } }
{ "status": false, "message": "Insufficient Wallet Balance" }
{ "status": false, "message": "Invalid Data Plan" }
{ "status": false, "message": "Transaction Not Successful" }
POST yoursiteurl.vendutility.com/api/v1/cable/
Description: This API allows the user to purchase cable subscription for services like DSTV, GOTV, or Startimes. It requires the Smart IUC number, cable network, and cable plan.
{ "smartIUCNumber": "IUC_number_here", "cable_network": 1, "cable_plan": "cable_plan_code" }
Fields:
{ "status": true, "data": { "transaction_id": "transaction_reference_token", "amount": 3000, "smartIUCNumber": "IUC_number_here", "status": "Transaction Successful" } }
{ "status": false, "message": "Insufficient Wallet Balance" }
{ "status": false, "message": "Invalid Cable Plan" }
{ "status": false, "message": "Transaction Not Successful" }
POST yoursiteurl.vendutility.com/api/v1/electricity/
Description: This API allows the user to purchase electricity. The request must include the meter number, service type, and amount to be purchased.
{ "meter_number": "1234567890", "service_type": "prepaid", "amount": 1000 }
Fields:
{ "status": true, "data": { "transaction_id": "transaction_reference_token", "amount": 1000, "status": "Transaction Successful" } }
{ "status": false, "message": "Invalid Meter Number" }
{ "status": false, "message": "Insufficient Wallet Balance" }
{ "status": false, "message": "Transaction Not Successful" }
POST yoursiteurl.vendutility.com/api/v1/validate-smart_cable/
Description: This API validates the Smart IUC (Identification Code) for a user to proceed with their electricity purchase or validation.
{ "smart_iuc": "smart_iuc_code_here" }
Fields:
{ "status": true, "data": { "valid": true, "message": "Smart IUC is valid." } }
{ "status": false, "message": "Invalid Smart IUC" }
{ "status": false, "message": "An error occurred: [error_details]" }
POST yoursiteurl.vendutility.com/api/v1/validate_electricity/
Description: This API validates the meter number before allowing the user to proceed with the electricity purchase.
{ "meter_number": "1234567890" }
Fields:
{ "status": true, "data": { "valid": true, "message": "Meter number is valid." } }
{ "status": false, "message": "Invalid Meter Number" }
{ "status": false, "message": "An error occurred: [error_details]" }