Electricity API Usage

Step 1: Operators Retrieval.

A request to the operator retrieval endpoint returns a list of currently supported operators. call API endpoint

https://api.blochq.io/v1/bills/electricity/operators
{
  "success": true,
  "data": [
    {
      "desc": "Kano Electricity Distribution Company",
      "id": "op_s3Lb7zJJLh7VGF67wTut7U",
      "name": "KEDCO",
      "sector": "Electricity"
    },
    {
      "desc": "Eko Electricity Distribution Company",
      "id": "op_JDODSOE7fJjdhtX6v64TK",
      "name": "EKEDC",
      "sector": "Electricity"
    },
    {
      "desc": "Enugu Electricity Distribution Company",
      "id": "op_hNYNSsTbHp7YZAxn8tNHKR",
      "name": "EEDC",
      "sector": "Electricity"
    },
    {
      "desc": "Ikeja Electricity Distribution Company",
      "id": "op_te89Caom34mWbZbTPuuk6s",
      "name": "IKEDC",
      "sector": "Electricity"
    },
    
    ...

  ],
  "message": "supported operators"
}

Description of Response Fields

FieldsDescription
idThe unique ID of this operator name
nameA simple and abbreviated name for this operator
sectorAn umbrella name for the sector under which this operator functions
descA more descriptive name/representation of this operator.

Step 2: Product Retrieval.

A request to the product retrieval endpoint returns a list of electricity products. call API endpoint

https://api.blochq.io/v1/bills/electricity/operators/{operator_id}/products"
{
  "success": true,
  "data": [
    {
      "category": "pctg_aLrTqmTXE8sdDavnKtxPJG",
      "desc": null,
      "fee_type": "FLEXIBLE",
      "id": "prd_Uc28gg954YHftPPoZEVrCp",
      "meta": null,
      "name": "Operator Bill Payment",
      "operator": "op_hFzVYtRLcheuGenZXB45Aq"
    }
  ],
  "message": "supported operators"
}

Description of Response Fields

FieldsDescription
idThe unique identifier of this product. (To be submitted during payment for this product.)
nameThe name of this product
descThe description of this product
fee_typeThe flexibility of the amount you can pay for this product. (One of FIXED , FLEXIBLE or RANGE ) See Payment Fee Type
categoryThe unique identifier of the product category.
operatorThe unique identifier of the service provider, that is, the disco.
metaExtra information about the product, if any, as supplied by the service provider.

Step 3: Customer Validation.

The customer validation endpoint must be called to verify the account or meter number of the customer. Upon successful validation, this endpoint returns customer information like address, minimum purchase value and last bill due among other things. It also returns a payment_reference, which must be provided when making a subsequent call for payment. Do note that this reference has an expiration time, hence it must be used quickly. call API endpoint

Retrieve the details of a customer matching the given parameters. This must be called before initiating a payment for the customer.

https://api.blochq.io/v1/bills/electricity/customers/:operatorID/:productNumber?meter_type={meter_type}
{
    "success": true,
    "data": {
        "account_number": null,
        "address": "17,ADEDUROSIMI STREET, SHOMOLU",
        "category": "prepaid",
        "debt": null,
        "email": "",
        "meta": {
            "business_unit": "",
            "last_transaction_date": "0001-01-01T00:00:00Z",
            "undertaking": ""
        },
        "meter_number": null,
        "minimum_payable": "5.86",
        "name": "MR AKINBOTE WALE",
        "payment_reference": "7c34f2fe4a7942e399c8c28f043334",
        "phone": "",
        "tariff_class": null,
        "tariff_rate": null,
        "unique_id": "62180004202"
    },
    "message": "customer details"
}

Description of Request Fields

FieldsDescription
operatorIDThe unique identifier of the electricity operator.
productNumberThe meter number/account number identifier assigned to the customer. For a postpaid customer: use the customer’s account number.

For a prepaid or a smart-meter customer: use the customer’s meter number.
categoryThe category of the customer account. Values could be postpaid ,prepaid or smart-meter .

Description of Response Fields

FieldsDescription
unique_idThe account/meter number assigned to the customer.
nameThe account name of the customer
addressThe address of the customer.
emailThe email address of the customer
phoneThe phone number of the customer.
debtThe current debt of customer, if any, in nairas.
minimum_payableThe minimum amount the customer must pay on their. next payment, in nairas.
payment_referenceThe reference to be presented when completing a payment for the customer, following the validation.
metaThe meta is a key-value object containing disco-specific information. The values may vary per call and/or operation
categoryThe customer account category.
account_numberThe customer account number applies to postpaid customers.
meter_numberThe customer meter number applies to prepaid and smart-meter customers.
tariff_classThe tariff classification of the customer with the disco.
tariff_rateThe tariff rate that applies to the customer’s tariff_class

Step 4: Payment Fulfillments.

After successful validation of a customer, a request is made to the payment endpoint to
complete a payment transaction in favour of the validated customer. call API endpoint

For some discos, it is required that the amount paid in a transaction should surpass the minimum payable amount of the customer. The minimum payable amount is contained in the response of a Customer Validation request.

https://api.blochq.io/v1/bills/electricity/payment
{
    "amount": 100000,
    "product_id": "prd_XHSjeVHW9MNi3LvHkL2tQc",
    "operator_id": "op_hFzVYtRLcheuGenZXB45Aq",
    "payment_reference": "ae4d32d2f7d940f191c0fe0ed5c2c8c4"
}
{
    "success": true,
    "data": {
        "amount": "1000.00",
        "created": "2022-10-25T15:01:08.862319",
        "account_number": "1015124143-01",
        "address": "OGUNSHADE ST 44 LEKKI LA",
        "business_unit": “LEKKI”,
        "current_debt": null,
        "customer_category": "prepaid",
        "e_receipt": “”,
        "meta": {
            "debt": 0,
            "debt_deduction": null,
            "meter_type": ""
        },
        "meter_number": "",
        "name": "FREDRICH ADEWALE",
        "operator": "EKEDC",
        "operator_receipt”: null,
        "operator_reference": "",
        "operator_vat": null,
        "payer": {
            "name": "BlocMobile"
        },
        "payment_reference": "ab486df3f40f42a49871763a7678e2c3",
        "previous_debt": null,
        "status": "ACTIVE",
        "tariff_class": null,
        "tariff_rate": null,
        "token": "2323234223233342323",
        "token_cost": null,
        "units": "108.2"
    },
    "message": "make payment"
}

Description of Request Fields

FieldsDescription
amountThe amount being paid ( in kobos. )
payment_referenceThe payment_reference value retrieved during Customer Validation.
product_idProduct Id of the service

Description of Response Fields

FieldsDescription
account_numberThe customer’s account number.
addressThe address of the customer.
amountAmount paid (in naira) .
business_unitThe business unit of the operator under which the customer falls.
createdThe date and time of the request.
current_debtThe amount currently owed by the customer.
e_receiptA unique invoice number generated for this transaction.
metaThe meta is a key-value object containing operator-specific information. The values may vary per call and/or operation.
meter_numberThe customer’s meter number.
nameThe name of the customer.
operator_receiptThe payment receipt, if any, provided by the operator.
operator_vatThe operator’s VAT charge for the transaction.
payment_referenceThe unique transaction identifier used for the transaction.
previous_debtPrevious amount owed by the customer, if any.
tariff_classThe tariff classification of the customer with the disco.
tariff_rateThe tariff rate that applies to the customer’s tariff_class .
tokenThe token generated for the transaction. ( Applies to prepaid-meter type transactions. )
token_costThe actual cost for the token, as specified by the operator. ( Applies to prepaid-meter type transactions. )
unitsThe energy value of the generated token. ( Applies to prepaid-meter type transactions. )