Skip to main content

Overview

Cable TV purchases are a two-step flow:
  1. Validate the smartcard number to confirm it exists and retrieve the customer name
  2. Buy the subscription using the validated details
Supported providers include DSTV, GOtv, Startimes, and others available in your catalog.

Authentication

Both endpoints require your merchant API key and the channel: API header.
Authorization: Bearer dcy_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
channel: API

Step 1 — Validate smartcard

POST /api/v1/cable/validate

Request body

FieldTypeRequiredDescription
smartcardNumberstringCustomer’s smartcard/decoder number
cablenamestringProvider name (e.g., "DSTV", "GOTV")
curl -sS -X POST "https://api.dancity.app/api/v1/cable/validate" \
  -H "Authorization: Bearer $DANCITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "channel: API" \
  -d '{
    "smartcardNumber": "1234567890",
    "cablename": "DSTV"
  }'

Sample response

{
  "success": true,
  "message": "Validation successful",
  "data": {
    "customerName": "John Doe"
  }
}
Always display customerName to the user for confirmation before proceeding to purchase. This prevents funding the wrong decoder.

Step 2 — Cable subscription

POST /api/v1/cable/buy

Request body

FieldTypeRequiredDescription
smartcardNumberstringSame number used in validation
cableplanstringplanId from GET /api/v1/plans/cable
customerNamestringName returned from validation step
customerRefstringYour internal reference ID
saveAsBeneficiarybooleanSave smartcard as beneficiary
beneficiaryNamestringLabel for saved beneficiary
promocodestringDiscount promo code
curl -sS -X POST "https://api.dancity.app/api/v1/cable/buy" \
  -H "Authorization: Bearer $DANCITY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "channel: API" \
  -d '{
    "smartcardNumber": "1234567890",
    "cableplan": "GOtv_Supa_Plus_monthly_N16_800",
    "customerName": "John Doe",
    "customerRef": "CABLE-REF-001"
  }'

Full purchase flow

1. GET /api/v1/plans/cable
   → list available plans and their names

2. POST /api/v1/cable/validate  { smartcardNumber, cablename }
   → confirm customer identity

3. Show customerName to user → user confirms

4. POST /api/v1/cable/buy
   → send smartcardNumber, cableplan, customerName
Do not proceed to purchase if the validation step fails. An invalid smartcard number will result in a failed transaction that may still debit your wallet.

Next steps