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

# Buy Electricity

> Buy electricity for a prepaid or postpaid meter. Validate the meter with Meter Enquiry
first and send the returned `customer_name`. Your naira wallet is debited for the amount
plus the bill payment fee.

Prepaid purchases return the meter token in `bill.token`, and the units bought in
`bill.units`.

The response carries the outcome: `successful`, `failed` (already refunded to your
wallet), or `pending`, which settles later and is announced by a `bill.successful` or
`bill.failed` webhook.

In production this endpoint is subject to [IP whitelisting](/api-reference/ip-whitelisting).




## OpenAPI

````yaml post /v1/bills/electricity
openapi: 3.0.3
info:
  title: Glyde Public API
  description: Glyde API for payments, collections, transfers, and virtual accounts
  version: 1.0.0
servers:
  - url: https://api.useglyde.co
    description: Production
  - url: https://sandbox.useglyde.co
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Account verification and bank listing
  - name: Collection
    description: Accept payments from customers
  - name: Transfers
    description: Send money to bank accounts. Available in NGN and ZAR
  - name: Transactions
    description: Transaction history and details
  - name: Settlements
    description: Settlement management
  - name: Wallet
    description: Per-currency wallet balances
  - name: Verification
    description: Identity verification
  - name: Virtual Accounts
    description: Virtual account management
  - name: Bills
    description: Buy airtime, data, electricity and cable TV from your naira wallet
paths:
  /v1/bills/electricity:
    post:
      tags:
        - Bills
      summary: Buy Electricity
      description: >
        Buy electricity for a prepaid or postpaid meter. Validate the meter with
        Meter Enquiry

        first and send the returned `customer_name`. Your naira wallet is
        debited for the amount

        plus the bill payment fee.


        Prepaid purchases return the meter token in `bill.token`, and the units
        bought in

        `bill.units`.


        The response carries the outcome: `successful`, `failed` (already
        refunded to your

        wallet), or `pending`, which settles later and is announced by a
        `bill.successful` or

        `bill.failed` webhook.


        In production this endpoint is subject to [IP
        whitelisting](/api-reference/ip-whitelisting).
      operationId: buyElectricity
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reference
                - service_code
                - meter_number
                - customer_name
                - amount
              properties:
                reference:
                  type: string
                  maxLength: 255
                  description: >-
                    Your unique reference for this purchase, used for
                    idempotency and tracking.
                  example: bill_abc125
                service_code:
                  type: string
                  description: >-
                    An electricity service code from List Billers
                    (`category=electricity`).
                  example: ikeja-electric-prepaid
                meter_number:
                  type: string
                  maxLength: 50
                  description: The customer's meter number.
                  example: '04123456789'
                customer_name:
                  type: string
                  maxLength: 255
                  description: The customer name returned by Meter Enquiry.
                  example: John Doe
                amount:
                  type: number
                  minimum: 100
                  description: >-
                    Amount in naira, at least 100, with at most 2 decimal
                    places.
                  example: 5000
                address:
                  type: string
                  maxLength: 255
                  description: The meter's address.
                  example: 12 Allen Avenue, Ikeja
                phone_number:
                  type: string
                  maxLength: 20
                  description: The customer's phone number.
                  example: '08031234567'
                email:
                  type: string
                  format: email
                  description: The customer's email address.
                  example: john@example.com
                access_token:
                  type: string
                  description: Required only when Meter Enquiry returned an `access_token`.
      responses:
        '200':
          $ref: '#/components/responses/BillPurchase'
        '401':
          description: Unauthenticated
        '403':
          description: Request came from an IP address that isn't whitelisted
        '422':
          $ref: '#/components/responses/BillPurchaseError'
        '503':
          $ref: '#/components/responses/BillsUnavailable'
components:
  responses:
    BillPurchase:
      description: >-
        The purchase was accepted. Check `data.status`: `successful`, `failed`
        (refunded), or `pending` (settles later by webhook). The message is
        `Bill payment successful`, `Bill payment failed` or `Bill payment is
        processing` to match.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: success
              message:
                type: string
                example: Bill payment successful
              data:
                type: object
                properties:
                  reference:
                    type: string
                    description: Glyde's reference for the transaction.
                    example: 550e8400-e29b-41d4-a716-446655440000
                  merchant_reference:
                    type: string
                    description: The `reference` you sent.
                    example: bill_abc125
                  type:
                    type: string
                    example: debit
                  amount:
                    type: string
                    description: The bill amount in naira, excluding the fee, as a string.
                    example: '5000'
                  status:
                    type: string
                    enum:
                      - successful
                      - failed
                      - pending
                    example: successful
                  fee:
                    type: string
                    description: The bill payment fee in naira, as a string.
                    example: '0'
                  bill:
                    $ref: '#/components/schemas/BillDetails'
                  created_at:
                    type: string
                    example: '2026-10-21T10:30:00.000000Z'
    BillPurchaseError:
      description: >-
        Validation error, insufficient funds, duplicate reference, unavailable
        bundle or bouquet, a limit breach, a missing webhook URL, or no naira
        wallet. No funds were debited.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              message:
                type: string
                example: Insufficient funds, can not process this bill payment.
              errors:
                type: object
                nullable: true
    BillsUnavailable:
      description: >-
        Bill payments are switched off for your business, or the biller could
        not be reached. Try again shortly.
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: failed
              message:
                type: string
                example: >-
                  Bill payments are temporarily unavailable. Please try again
                  shortly.
              errors:
                type: object
                nullable: true
  schemas:
    BillDetails:
      type: object
      description: The bill attached to a bill payment transaction.
      properties:
        category:
          type: string
          enum:
            - airtime
            - data
            - electricity
            - cable
          example: electricity
        service_code:
          type: string
          example: ikeja-electric-prepaid
        customer_identifier:
          type: string
          description: The phone, meter or smartcard number the bill was bought for.
          example: '04123456789'
        customer_name:
          type: string
          nullable: true
          example: John Doe
        product_code:
          type: string
          nullable: true
          description: The data `bundle_id` or cable `bouquet_id`, when one was bought.
          example: null
        product_name:
          type: string
          nullable: true
          example: null
        token:
          type: string
          nullable: true
          description: The prepaid electricity token, once the purchase is successful.
          example: 1234-5678-9012-3456-7890
        units:
          type: string
          nullable: true
          description: The electricity units bought, when the biller returns them.
          example: 42.5 kWh
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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