Menu
Introduction Getting started SMS Promotional - Large campaigns Transactional - Basic Transactional (Alerts) - Virtual Number Route Transactional (Alerts) - Priority Routing Transactional (OTPs & Alerts) - Special route International route to Nigeria International route to Other Countries SMS DLR SMS DLR Webhooks Voice Voice OTP Voice Broadcasts Voice DLR Campaigns SMS - Get Groups SMS Initiate Units Transfer Units to Sub-Account Transfer Units to Other Account Check Units Balance Sender IDs Register Sender IDs Check Sender ID status Categories Add Customer Remove Customer Virtual Number Inbox webhook VTU (Airtime & Data) Purchase Airtime Get Data Plans Purchase Data Plan Bill Payments (Electricity, Cable TV...) Verify Customer Buy Electricity Fetch TV Plans Buy TV Subscription Carrier Billing Run USSD Query Run Shortcode Query Query Status Carrier Callback Tools Create Sub-Account Check DND Status Check Service Status 3rd-party integrations ZOHO
Bill Payments - Purchase TV Subscription This API allows you to activate, change or renew TV subscriptions from supported service providers.
POST
https://api.textng.xyz/bp-purchase-tv/
PHP code
<?php
 // Using cURL POST
  $key="YOUR-ACCOUNT-KEY";
  $customer_id="SMARTCARD NUMBER";
  $plan_id="PLAN_ID from Fetch TV plans API";
  $amount="AMOUNT from Fetch TV plans API";
  $service_provider="dstv, gotv, startimes";
  $phone="Phone number of the subscriber";
  $quantity="Number of months";
  $response = httpPost("https://api.textng.xyz/bp-purchase-electricity/",array("key"=>"$key","customer_id"=>$customer_id,"plan_id"=>"$plan_id","service_provider"=>"$service_provider","amount"=>$amount,"phone"=>$phone,"quantity"=>$quantity));
  // using php curl
  function httpPost($url, $data) {
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $response = curl_exec($curl);
      curl_close($curl);
      echo $response;
  }
?>
Parameters
Parameters Example Description
Key XXXXX-XXXX-XXXXX Your developer API key. This authorizes every request and can be found on your Developer Dashboard.
service_provider * dstv Any of the following service providers; dstv, gotv, startimes
customer_id * 45053841594 Smartcard number (depending on the selected service).
plan_id * dstv-padi Plan ID from Fetch TV Plans API
amount * 4400 Amount from Fetch TV Plans API
phone * 0701001000 Phone number of subscriber
quantity 1 Number of months
Responses
Your transaction response will appear in JSON format as shown below.
Succesful query (JSON)
{
    "status": true,
    "message": "TV Subscription initiated & successful",
    "data": {
        "service_name": "DSTV Subscription",
        "customer_id": "45053841594",
        "unit_price": "XXXX",
        "quantity": 1,
        "request_id": XXXX-XXXX-XXXX-XXXX,
        "status": "success"
    }
}
{
    "status": true,
    "message": "TV Subscription initiated but pending",
    "data": {
        "service_name": "DSTV Subscription",
        "customer_id": "45053841594",
        "unit_price": "XXXX",
        "quantity": 1,
        "request_id": XXXX-XXXX-XXXX-XXXX,
        "status": "pending"
    }
}
Error (JSON)
{
    "status": false,
    "message": "Unable to process order at this time",
    "reason": ""
}