Bills PaymentsElectricityElectricity Recharge

Electricity Recharge

This endpoint allows users to recharge electricity (prepaid or postpaid) by specifying provider details, meter number, amount, and meter type.

Endpoint

POST https://backendapi.sayswitchgroup.com/api/v1/electricity/recharge

cURL Request Example

curl -X POST https://backendapi.sayswitchgroup.com/api/v1/electricity/recharge \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_SECRET_KEY_HERE" \
  -d '{
    "provider": "IKEDC",
    "number": "1111111111111",
    "type": "prepaid",
    "amount": 1000,
    "reference": "2022051105275457530"
}

Sample Response

{
  "success": true,
  "code": "00000",
  "message": "SUCCESSFUL",
  "data": {
    "orderNo": "value_of_$orderNo",
    "reference": "value_of_$reference",
    "status": "value_of_$status",
    "errorMsg": "value_of_$errorMsg",
    "purchased_code": "value_of_$purchased_code",
    "units": "value_of_$units",
    "customer_name": "value_of_$customer_name",
    "customer_address": "value_of_$customer_address",
    "account_type": "value_of_$account_type",
    "date": "value_of_$bl->created_at"
  }
}

Response Field

FieldTypeDescription
successbooleanIndicates if the API call was successful
codestringStatus code (00000 means success)
messagestringSummary message (e.g. “SUCCESSFUL”)
data.orderNostringInternal order number assigned by the server
data.referencestringUnique transaction reference provided by the client
data.statusstringCurrent status of the transaction (e.g., “delivered”)
data.errorMsgstringAdditional info about the transaction (e.g., success reason)
data.purchased_codestringToken code (for prepaid recharges)
data.unitsstringQuantity of electricity units bought
data.customer_namestringName registered to the meter number
data.customer_addressstringAddress registered to the meter
data.account_typestringEither prepaid or postpaid
data.datestringTimestamp of the transaction