> ## 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.

# Buy Data

> Purchase a data bundle for a specified recipient.



## OpenAPI

````yaml POST /v1/databundle
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/databundle:
    post:
      description: Purchase a data bundle for a specified recipient.
      requestBody:
        description: Data bundle purchase details.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataPurchaseRequest'
        required: true
      responses:
        '200':
          description: Data bundle purchased successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataPurchaseResponse'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DataPurchaseRequest:
      type: object
      required:
        - recipient_phone
        - recipient_network
        - plan_id
      properties:
        recipient_phone:
          description: Phone number of the recipient in E.164 format
          type: string
        recipient_network:
          description: Network of the recipient
          type: string
        plan_id:
          description: ID of the data bundle plan to be purchased
          type: string
        reference:
          description: Unique reference for the transaction
          type: string
        webhook_url:
          description: URL to receive status updates
          type: string
    DataPurchaseResponse:
      type: object
      properties:
        transaction_id:
          description: Unique identifier for the data purchase
          type: string
        status:
          description: Status of the data purchase
          type: string
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````