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

# Purchase airtime

> Purchase airtime



## OpenAPI

````yaml POST /api/v1/airtime/buy
openapi: 3.1.0
info:
  title: Dancity API
  description: >-
    Paths below match the server base URL + global prefix `api`. Merchant:
    `Authorization: Bearer dcy_live_...` and `channel: API`. App: JWT. See
    Guides for flows.
  version: 1.0.0
servers:
  - url: https://api.dancity.app
    description: Production
  - url: http://localhost:6565
    description: Local development
security: []
tags:
  - name: VAS
    description: >-
      Merchant API (`/api/v1`): catalog GETs (wallet, services, products, plans)
      and purchase routes; `channel: API` on POST buys; app education & betting
      where listed
  - name: Products & services
    description: 'Catalog GETs: all services; products and plans with optional query filters'
  - name: Wallet
    description: Get wallet by id (JWT)
  - name: Transactions
    description: Fetch your transactions and requery one by id for current status
  - name: Betting
    description: Betting funding
  - name: Education
    description: Education pins
  - name: eSIM
    description: eSIM catalog and purchase
  - name: Webhook
    description: Outbound events Dancity POSTs to your configured HTTPS URL
paths:
  /api/v1/airtime/buy:
    post:
      tags:
        - VAS
      summary: Purchase airtime
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - product
                - phone
                - amount
              properties:
                product:
                  type: string
                  description: >-
                    Product name from catalog. Hyphens and underscores are
                    treated as spaces (e.g. MTN-Airtime, MTN_Airtime, MTN
                    Airtime).
                  example: MTN Airtime
                phone:
                  type: string
                  example: 080*******
                amount:
                  type: number
                  minimum: 50
                  maximum: 1000
                customerRef:
                  type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              example:
                success: true
                message: Airtime purchase processed
                data:
                  _id: 6a1c3ba6f269d84e04f098cc
                  tranxId: DNTY174825YP565I
                  service: AIRTIME
                  product: MTN Airtime
                  tranxType: DEBIT
                  status: FAILED
                  currency: NGN
                  remarks: Airtime purchase for 09037346247
                  amount: 100
                  fee: 0
                  amountPaid: 98.5
                  balanceBefore: 5276
                  balanceAfter: 5177.5
                  number: '09037346247'
                  customerRef: ''
                  channel: API
                  paymentMedium: MAIN WALLET
                  tranxDate: '2026-05-31T13:46:14.825Z'
                  apiResponse: Airtime purchase failed
                  isReversal: false
                  quantity: 0
                  createdAt: '2026-05-31T13:46:14.827Z'
        '400':
          description: Bad request
          content:
            application/json:
              example:
                success: false
                message: Validation failed
                statusCode: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                success: false
                message: Invalid API key or IP not allowlisted
                statusCode: 401
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                success: false
                message: Sorry, something went wrong. Please try again later
                statusCode: 500
      security:
        - DancityApiKey: []
components:
  securitySchemes:
    DancityApiKey:
      type: http
      scheme: bearer
      bearerFormat: dcy_live_...
      description: Merchant API key from the Dancity dashboard.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.