> ## Documentation Index
> Fetch the complete documentation index at: https://baas-api-docs.rexmfbank.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Buy a cable TV subscription

> Debits the partner Master account and pays a cable TV bouquet.
`amount` must match the selected bouquet. `service_type` is
case-insensitive. Requires an `Idempotency-Key` header. Name enquiry
is recommended, but unlike electricity it is not enforced.




## OpenAPI

````yaml /openapi.yaml post /services/bills-payment/cable-tv
openapi: 3.1.0
info:
  title: Rex Banking-as-a-Service API
  version: 1.0.0
  summary: Embed real bank accounts, transfers, and collections into your product.
  description: |
    The Rex BaaS API lets you provision virtual bank accounts, move money
    between them, accept inbound transfers, collect at merchant terminals, and
    pay bills for your end customers — all under your own brand, backed by a
    real bank ledger.

    This reference covers every endpoint your integration will call. If
    you're just getting started, read **[Getting Started](/introduction)**
    and **[Authentication](/authentication)** first — most integration
    questions are answered there, not in the endpoint list.

    All endpoints are versioned under `/baas/api/v1` and return JSON. See
    **[Errors](/errors)** for the shared error envelope, and
    **[Sandbox vs. Live](/guides/sandbox-vs-live)** for how test and
    production credentials differ.
  contact:
    name: Rex BaaS Support
    email: baas-support@rexmfbank.com
  license:
    name: Proprietary — for approved Rex BaaS partners only
servers:
  - url: https://api.rexmfbank.com/baas/api/v1
    description: Rex BaaS API
security:
  - BearerAuth: []
tags:
  - name: Authentication
    description: Register a partner account, verify it, log in, and manage credentials.
  - name: Onboarding
    description: |
      The one-time KYB (Know Your Business) flow every partner completes
      before going live — business details, a compliance representative,
      supporting documents, and signing the partner agreement.
  - name: Wallet
    description: >-
      Your business's own settlement balance — the account every virtual account
      nets into.
  - name: Virtual Accounts
    description: |
      The core product — dedicated bank account numbers you issue to your
      own end users, with full transfer and transaction capabilities.
  - name: Webhooks
    description: Configure where and how Rex notifies your system of events in real time.
  - name: Partner Settings
    description: >-
      Account security, team members, disputes, and document management for your
      own partner account.
  - name: Services
    description: |
      The catalog of optional products a partner can subscribe to. Virtual
      accounts are not in this list — they are available without a
      subscription. Bills payment is.
  - name: Bills Payment
    description: |
      Buy airtime, data, electricity, and cable TV for your end customers.
      Each purchase debits your own Master account. Requires a Bills Payment
      subscription — see **[Services](/guides/service-subscriptions)**.
paths:
  /services/bills-payment/cable-tv:
    post:
      tags:
        - Bills Payment
      summary: Buy a cable TV subscription
      description: |
        Debits the partner Master account and pays a cable TV bouquet.
        `amount` must match the selected bouquet. `service_type` is
        case-insensitive. Requires an `Idempotency-Key` header. Name enquiry
        is recommended, but unlike electricity it is not enforced.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - smartcard_number
                - service_type
                - amount
                - phone
                - tariffTypeId
              properties:
                smartcard_number:
                  type: string
                  minLength: 5
                  maxLength: 50
                service_type:
                  type: string
                  enum:
                    - DSTV
                    - GOTV
                    - STARTIMES
                    - dstv
                    - gotv
                    - startimes
                amount:
                  type: number
                  minimum: 100
                  maximum: 1000000
                  description: Must match the selected bouquet.
                phone:
                  type: string
                  pattern: ^0\d{10}$
                tariffTypeId:
                  type: string
                  description: Bouquet identifier from **List TV bouquets**.
                email:
                  type: string
                  format: email
                  nullable: true
                customer_reference:
                  type: string
                  nullable: true
                  maxLength: 100
            example:
              smartcard_number: '1234567890'
              service_type: DSTV
              amount: 10500
              phone: '08012345678'
              tariffTypeId: DSTV_COMPACT
              email: customer@example.com
              customer_reference: customer-123
      responses:
        '200':
          description: 'Purchased. `data` is a bills transaction with `bill_type: cable`.'
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/BillsTransaction'
        '400':
          description: '`INSUFFICIENT_BALANCE`, or a missing `Idempotency-Key`'
        '403':
          description: '`NOT_SUBSCRIBED`'
        '404':
          description: '`PROVIDER_UNAVAILABLE`'
        '409':
          description: '`MASTER_NOT_PROVISIONED` or `DUPLICATE_REFERENCE`'
        '422':
          description: '`INVALID_PLAN_AMOUNT`, `DAILY_CAP_EXCEEDED`, or `VALIDATION_FAILED`'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: |
        Required on purchase endpoints. Use a new key for each intended
        purchase, and reuse that same key when retrying the same request
        after a timeout. A completed key replays the original response. The
        same key with a different body is rejected. Keys expire after 24
        hours. A missing key returns `400` with no `error_code`.
      schema:
        type: string
        maxLength: 255
  schemas:
    SuccessEnvelope:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        message:
          type: string
        data:
          description: Endpoint-specific payload — see each operation.
    BillsTransaction:
      type: object
      description: |
        A bills-payment debit against the partner Master account. `id` and
        every `*_id` are strings. Money fields are decimal strings.
      properties:
        id:
          type: string
          example: '101'
        company_id:
          type: string
          example: '28'
        master_savings_id:
          type: string
          example: '55'
        bill_type:
          type: string
          enum:
            - airtime
            - data
            - electricity
            - cable
        direction:
          type: string
          enum:
            - debit
        amount:
          type: string
          example: '1000.00'
        fee_amount:
          type: string
          example: '0.00'
        balance_after:
          type: string
          example: '49000.00'
        reference:
          type: string
          example: PROVIDER-REFERENCE
        status:
          type: string
          example: successful
        narration:
          type: string
        savings_transaction_id:
          type: string
          example: '9001'
        meta:
          type: object
          additionalProperties: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk_live_... / sk_sandbox_...
      description: |
        See **[Authentication](/authentication)** for the full explanation
        of session tokens vs. API keys and when each is used.

````