Cable TV subscription API for Nigerian apps

Offer DStv, GOtv and StarTimes subscriptions with package discovery, decoder verification and transaction tracking through the RizPay bill payment API.

Already registered? Open API settings and follow the business-access steps. Sandbox purchases do not deliver real services.

Reviewed

Cable TV checkout combines two choices: the customer's provider and the package they want. Keep package names and billing periods visible instead of presenting a list of unexplained prices. Verify the decoder or smart-card number against the selected product.

Design the checkout

Let the customer confirm the account and package together. Use the product catalogue as the source of cost and availability; do not infer a package price from digits in its label. A request being accepted does not by itself mean the subscription is active.

Discover current products

Use a sandbox key with the view_products scope. Keep the key in a server environment variable. The request below reads the catalogue; it does not buy a service.

bash
curl --fail-with-body --silent --show-error --max-time 20 \
  -H "Authorization: Bearer ${RIZPAY_API_KEY:?Set a sandbox API key}" \
  "https://my.rizpay.app/api/partners/sandbox/v1/products/cabletv"

Read products from data and their details from attributes. Follow pagination.total_pages when you need the complete list. Select an actual returned ID, not a guessed or documentation-example ID. Catalogue availability can change: refresh an unavailable selection and let the customer choose again.

Cable TV packages have fixed catalogue costs. Read price.amount, then calculate the retail price in your own system. Preserve the selected package label and the price the customer confirmed for the receipt. If either changes before purchase, ask for confirmation again instead of quietly charging a new total.

Confirm the payment target

Before purchasing, POST to /purchases/verify with product_id and smart_number. Continue only when data.verified is true and the customer confirms the returned details. Keep smart numbers as strings. Verification must correspond to the selected provider and package.

Prepare one purchase per order

The purchase request uses product_id, service, smart_number, external_reference. Enable the relevant purchase permission (purchase_cable_tv) and read_transactions for status checks. Confirm your key's permissions against the authentication reference when moving from sandbox to production.

This is the JSON body shape for a sandbox purchase. Replace every dollar-prefixed placeholder before sending it, using the product you selected and your stored order reference. The service value must be the one on the product you selected: a purchase whose service does not match its product is rejected in production even though the sandbox accepts it. Leave the optional phone number out of a sandbox cable body: the sandbox picks its outcome from the first recipient field present, so a phone number would replace the smart number as the fixture selector. The recipient values below are sandbox fixtures, not real recipients. For variable-amount products, choose an amount within the selected product's limits.

json
{
  "product_id": "$RIZPAY_PRODUCT_ID",
  "smart_number": "1212121212",
  "service": "$RIZPAY_SELECTED_PRODUCT_VALUE",
  "external_reference": "$RIZPAY_ORDER_REFERENCE"
}

Send the body to POST /api/partners/sandbox/v1/purchases. Generate and persist the reference once for the order, following the documented format. Do not make a new reference simply because a request timed out. Keep product selection, pricing and authorization on your server; a browser or mobile app must never contain the partner secret.

Follow the result

Persist data.id from an accepted purchase and inspect data.attributes.status. An accepted request can still be pending. Read the existing purchase with GET /purchases/:id and reconcile signed webhook events with your stored order. If the response was lost, look up the existing external reference before considering another purchase.

A DUPLICATE_REFERENCE response establishes that a reference has already been used; it does not prove fulfillment. Retrieve the existing transaction and check its status. Only successful is a completed purchase. Handle failed and reversed outcomes according to the returned transaction and your own ledger; do not issue a second refund because the same event arrives again.

Can I automatically change a customer's package?

Do not promise an upgrade, downgrade or recurring renewal unless the selected product and supported workflow cover it. This integration submits the chosen subscription purchase; your application must obtain the customer's confirmation.

Before accepting real orders

Test a successful purchase, an unresolved pending result and a failure. Confirm that a repeated submit cannot make a second local order and that the receipt reflects the final state. Use the sandbox's configured test recipients rather than arbitrary phone or meter numbers. Sandbox delivery is simulated and is not a measurement of live biller reliability.

Read the product reference, sandbox guide and pricing explanation before enabling production access.