> For the complete documentation index, see [llms.txt](https://capitalsage.gitbook.io/sagecloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://capitalsage.gitbook.io/sagecloud/electricity/purchase.md).

# Purchase

## Electricity Purchase

<mark style="color:green;">`POST`</mark> `https://sagecloud.ng/api/v2/electricity/purchase`

This endpoint allows you to purchase electricity.

#### Headers

| Name          | Type   | Description             |
| ------------- | ------ | ----------------------- |
| Authorization | string | Check the Headers page. |

#### Request Body

| Name            | Type   | Description                                    |
| --------------- | ------ | ---------------------------------------------- |
| reference       | string | A unique key generated by you                  |
| type            | string | The biller type. e.g ibadan\_electric\_prepaid |
| account\_number | string | The meter no.                                  |
| amount          | string | Amount to be purchased                         |
| phone           | string | Phone number of the customer                   |

{% tabs %}
{% tab title="200 Purchase Successful.
NOTE: status can be "success" or "pending"" %}

```
{    
    "success": true,
    "status": "success",
    "message": "ELECTRICITY purchase successful",
    "data": {
        "token": "61679094489051385767",
        "unit": "100 kWh",
        "amount": "100",
        "transId": 816243
    }
}
```

{% endtab %}

{% tab title="401 " %}

```
{    
    "message": "Unauthenticated."
}
```

{% endtab %}
{% endtabs %}
