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

# Get Airtime Status

> Retrieve the purchase history of airtime with a reference code.



## OpenAPI

````yaml GET /v1/airtime/{referencecode}
openapi: 3.0.1
info:
  title: Delaphone CPaaS API
  description: APIs for sending SMS, purchasing data bundles, and buying airtime.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.delaphonegh.com
security:
  - bearerAuth: []
paths:
  /v1/airtime/{referencecode}:
    get:
      description: Retrieve the purchase history of airtime with a reference code.
      parameters:
        - name: referencecode
          in: path
          description: Reference code for the airtime transaction.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Airtime status successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AirtimeStatus'
        '400':
          description: Invalid reference code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: Insufficient Permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAirtimeError404'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
components:
  schemas:
    AirtimeStatus:
      type: object
      properties:
        success:
          description: Indicates whether the SMS request was successful
          type: boolean
        status:
          description: Status of the SMS message
          type: integer
          example: 200
        message:
          description: Text message that was sent
          type: string
          example: Airtime status retrieved successfully
        data:
          type: array
          description: Array of details for each recipient
          items:
            type: object
            properties:
              recipient_phone:
                description: The recipient's phone number
                type: string
              recipient_network:
                description: The recipient's phone number
                type: string
              message_id:
                description: Unique identifier for the message
                type: string
              status:
                description: Status of the SMS message
                type: string
              date_created:
                description: Date and time the message was sent
                type: string
              amount:
                description: Amount purchased
                type: string
            required:
              - recipient
              - message_id
              - status
    Error:
      required:
        - error
        - message
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: object
          properties:
            status:
              type: integer
              format: int32
            title:
              type: string
              example: Invalid Request Value
            detail:
              type: string
    Error401:
      required:
        - error
        - message
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: object
          properties:
            status:
              type: integer
              format: int32
              example: 401
            title:
              type: string
              example: Authentication failed
              description: 'Title of the error (default: Authentication failed)'
            detail:
              type: string
    Error403:
      required:
        - error
        - message
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: object
          properties:
            status:
              type: integer
              format: int32
              example: 403
            title:
              type: string
              example: Insufficient permissions
              description: 'Title of the error (default: Authentication failed)'
            detail:
              type: string
    GetAirtimeError404:
      required:
        - error
        - message
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: object
          properties:
            status:
              type: integer
              format: int32
              example: 404
            title:
              type: string
              example: Not found
              description: The requested resource was not found
            detail:
              type: string
              example: 'No airtime request found with reference: {reference}'
    Error500:
      required:
        - error
        - message
      type: object
      properties:
        success:
          type: boolean
          default: false
        error:
          type: object
          properties:
            status:
              type: integer
              format: int32
              example: 500
            title:
              type: string
              example: Internal server error
              description: 'Title of the error (default: Authentication failed)'
            detail:
              type: string
              example: >-
                We could not fulfil your request. Kindly try again in a few
                moments
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````