URL: /api/cableapi
Methods: POST
, GET
This API endpoint allows users to purchase cable Tv Subscription.
To access this endpoint, users must include their API key and secret key in the request headers.
See usage example in the code snippets below:
POST request to purchase tv subscription:
Content-Type: application/json api-key: your-api-key secret-key: your-secret-key { "number": "0000000000", "firstLevel": "DSTV", "secondLevel": "dstv padi" }
Response:
- Status Code: 200 { "message": "Transaction successful", "cableHistory": { "transactionId": "1234567890", "email": "user@example.com", "activity": "DSTV", "message": "dstv padi", "status": "Success", "recipient": "0000000000", "amount": 2950, "initialBalance": 3000, "finalBalance": 50, "Method": API, } }
{ "error": "Transaction failed", "cableHistory": { "transactionId": "0000000000", "email": "user@example.com", "activity": "DSTV", "message": "dstv padi", "status": "Failed", "recipient": "0000000000", "amount": 2950, "initialBalance": 3000, "finalBalance": 3000 "Method": API, } }
See usage example in the code snippets below:
GET request for available firstLevel and secondLevel:
Content-Type: application/json api-key: your-api-key secret-key: your-secret-key
Response:
- Status Code: 200 { "DSTV": { "available": true, "secondLevel": [ "dstv padi" ], "amount": [ 2950 ] } }