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

# Pay electricity

> Pay electricity via merchant VAS API. Scope: `vas:write`. Requires `Idempotency-Key`.

> [!NOTE]
>
> Call **Validate electricity** first. Pick `planId` from **List billers** (`category=electricity`) — use `plans[].planId` (slug, e.g. `ekedc_prepaid`), not `plans[].id`.


## OpenAPI

````yaml POST /api/v1/merchant/vas/electricity
openapi: 3.1.0
info:
  title: SendPadi Merchant API
  version: 1.0.0
  description: >-
    Merchant REST API. Authenticate with HMAC headers (`X-Api-Key`,
    `X-Timestamp`, `X-Signature`). Generate playground headers with [Sign
    requests (playground)](/guides/sign-requests).
servers:
  - url: https://api.sendpadi.com
    description: Production (test + live keys)
security: []
paths:
  /api/v1/merchant/vas/electricity:
    post:
      tags:
        - vas
      summary: Pay electricity
      description: >-
        Pay electricity via merchant VAS API. **Scope:** `vas:write`. Requires
        `Idempotency-Key` on this write.
      operationId: api-reference_vas_electricity
      parameters:
        - name: X-Timestamp
          in: header
          required: true
          description: Unix time in seconds
          schema:
            type: string
        - name: X-Signature
          in: header
          required: true
          description: HMAC-SHA256 signature
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: UUID. Required on money-moving writes.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                planId:
                  type: string
                  enum:
                    - aedc_prepaid
                    - aedc_postpaid
                    - aple_prepaid
                    - aple_postpaid
                    - bedc_prepaid
                    - bedc_postpaid
                    - eedc_prepaid
                    - eedc_postpaid
                    - ekedc_prepaid
                    - ekedc_postpaid
                    - ibedc_prepaid
                    - ibedc_postpaid
                    - ikedc_prepaid
                    - ikedc_postpaid
                    - jed_prepaid
                    - jed_postpaid
                    - kaedco_prepaid
                    - kaedco_postpaid
                    - kedco_prepaid
                    - kedco_postpaid
                    - phed_prepaid
                    - phed_postpaid
                    - yedc_prepaid
                    - yedc_postpaid
                  description: >-
                    Slug from List billers → `data.electricity.plans[].planId`
                    (e.g. `ekedc_prepaid`). Not the UUID `id`.
                meterNumber:
                  type: string
                amount:
                  type: integer
                customerPhone:
                  type: string
              required:
                - planId
                - meterNumber
                - amount
                - customerPhone
            example:
              planId: ekedc_prepaid
              meterNumber: '***********78'
              amount: 2000
              customerPhone: 080*******8
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              example:
                success: true
                message: OK
                data:
                  transactionId: vas_electricity_001
                  status: processing
                  token: '****-****-****'
              examples:
                success:
                  summary: Success
                  value:
                    success: true
                    message: OK
                    data:
                      transactionId: vas_electricity_001
                      status: processing
                      token: '****-****-****'
        '400':
          description: Purchase failed
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                purchase_failed:
                  summary: Purchase failed
                  value:
                    success: false
                    data:
                      transactionId: vas_electricity_****
                      reference: ELECTRICITY-************-****
                      status: FAILED
                      message: >-
                        We couldn't complete your electricity purchase. Please
                        check your meter number and details, then try again.
                    error: ''
              example:
                success: false
                data:
                  transactionId: vas_electricity_****
                  reference: ELECTRICITY-************-****
                  status: FAILED
                  message: >-
                    We couldn't complete your electricity purchase. Please check
                    your meter number and details, then try again.
                error: ''
        '401':
          description: Invalid HMAC signature
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
              examples:
                invalid_hmac_signature:
                  summary: Invalid HMAC signature
                  value:
                    success: false
                    message: Invalid request signature
                    error: true
                    errorCode: MERCHANT_AUTH_SIGNATURE_INVALID
              example:
                success: false
                message: Invalid request signature
                error: true
                errorCode: MERCHANT_AUTH_SIGNATURE_INVALID
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key id (sp_test_… / sp_live_…)

````

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