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

# Buy Electricity

> Deducts NGN balance and purchases prepaid/postpaid electricity token.

Purchases prepaid/postpaid electricity token for a verified meter.

### Environment Notes

* **Production key** -> uses the live business NGN wallet balance and runs the live purchase flow.
* **Test key** -> uses the sandbox business NGN wallet balance and completes without vending real electricity.


## OpenAPI

````yaml POST /bills/electricity
openapi: 3.0.0
info:
  title: NexaPay Business API
  version: 1.0.0
  description: Server-to-server merchant integration API documentation.
servers:
  - url: https://api.nexapay.ng/api/v1/business
    description: Production Server
security: []
tags: []
paths:
  /bills/electricity:
    post:
      tags:
        - Bills
      summary: Purchase electricity token/payout
      description: Deducts NGN balance and purchases prepaid/postpaid electricity token.
      parameters:
        - $ref: '#/components/parameters/BusinessEnvHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                businessId:
                  type: string
                electricity:
                  type: string
                  description: The disco code (e.g. ikeja-electric).
                amount:
                  type: number
                meterNumber:
                  type: string
                type:
                  type: string
                  enum:
                    - prepaid
                    - postpaid
              required:
                - electricity
                - amount
                - meterNumber
                - type
      responses:
        '202':
          description: Transaction initiated.
      security:
        - ApiKeyAuth: []
components:
  parameters:
    BusinessEnvHeader:
      name: x-business-env
      in: header
      required: false
      schema:
        type: string
        enum:
          - prod
          - test
        default: prod
      description: Target environment selector (live production vs. simulated sandbox).
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Merchant API Key (e.g., nexa-prod-... or nexa-test-...)

````