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

# Electricity

> Vend electricity for a meter.

Submit an electricity purchase after the meter and amount have been confirmed. Successful prepaid purchases may return the token, units, meter details, and customer name for the receipt.

## Request body

<ParamField body="customer_id" type="string" required>
  Meter number or customer identifier for the electricity provider.
</ParamField>

<ParamField body="product_name" type="string" required>
  Electricity product selected from List products.
</ParamField>

<ParamField body="amount" type="number">
  Required when the product has `amount_required: true`.
</ParamField>

<ParamField body="reference" type="string" required>
  Unique transaction reference from your system. Must be 15 to 40 characters.
</ParamField>

## Request

```json theme={null}
{
  "customer_id": "45705225097",
  "product_name": "jos-electric-prepaid",
  "amount": 1000,
  "reference": "merchant-ref-8905fff6767"
}
```

## Successful response

```json theme={null}
{
  "status": true,
  "message": "Purchase processed successfully.",
  "data": {
    "reference": "merchant-ref-8905fff6767",
    "customer_id": "45705225097",
    "service": "electricity",
    "provider": "Jos Electric",
    "product_name": "jos-electric-prepaid",
    "quantity": 1000,
    "paid_amount": 990,
    "transaction_status": "successful",
    "token": "7060-8360-1787-0933-6869",
    "units": "4.5",
    "meter_number": "45705225097",
    "customer_name": "UMAR MOHD AWWAL",
    "customer_address": "NEW MILE 3",
    "disco": "Jos Electric - JED",
    "remark": "7060-8360-1787-0933-6869\n\n(4.5 KWH)"
  }
}
```

## Processing response

```json theme={null}
{
  "status": true,
  "message": "Purchase is processing.",
  "data": {
    "reference": "merchant-ref-8905fff6767",
    "customer_id": "45705225097",
    "service": "electricity",
    "provider": "Jos Electric",
    "product_name": "jos-electric-prepaid",
    "quantity": 1000,
    "paid_amount": 990,
    "transaction_status": "processing"
  }
}
```

## Failed response

```json theme={null}
{
  "status": false,
  "message": "Error message"
}
```
