VendPower Developers

API Documentation

REST API for electricity, betting wallets, cable TV, mobile data, airtime, and Vend Airtime to Cash. Authenticate with an approved X-API-Key.

JSON over HTTPS X-API-Key auth Idempotent purchases
All systems normal

Base URL

https://api.vendpower.ng/api/v1

Purchase electricity

X-API-Key
POST/electricity/purchase

Vend prepaid / postpaid electricity. Pending purchases return 201 — poll GET /transactions/{id}.

curl -X POST "https://api.vendpower.ng/api/v1/electricity/purchase" \
  -H "X-API-Key: YOUR_X_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "disco_code": "IKDC",
    "meter_type": "PREPAID",
    "meter_number": "12345678901",
    "amount": 2000,
    "customer_phone": "08031234567",
    "idempotency_key": "VP_UNIQUE_KEY_001"
  }'

Authentication

Send your approved API key on every request. Keep it on your server only.

HeaderValueRequired
X-API-KeyYOUR_X_API_KEYYes
Content-Typeapplication/jsonYes
Acceptapplication/jsonRecommended

Authentication failures (401 / 403 / 429) are listed in Authentication.

Parameters

Body parameters

NameTypeRequiredDescription
disco_codestringYesFrom GET /electricity/discos
meter_typestringYesPREPAID or POSTPAID
meter_numberstringYesValidated meter number
amountnumberYesFace amount in NGN
customer_phonestringYesCustomer phone
idempotency_keystringYesYour unique purchase key (recommended VP…). Re-sending the same key returns 409 with the original transaction — never charges twice.

Responses

200 OK — Success · 201 Created — Pending

{
  "success": true,
  "message": "Electricity purchase completed successfully.",
  "data": {
    "id": 101,
    "reference": "VP_UNIQUE_KEY_001",
    "idempotency_key": "VP_UNIQUE_KEY_001",
    "status": "success",
    "category": "electricity",
    "amount": 2000,
    "charge": 2000,
    "token": "1234-5678-9012-3456",
    "units": "45.2"
  }
}

Errors

Errors specific to this endpoint, in addition to common authentication and validation failures.

CodeHTTPWhen
VALIDATION_ERROR422Request body failed validation or business rules.
INSUFFICIENT_BALANCE400 / 402Wallet balance is too low for this purchase.
DUPLICATE_IDEMPOTENCY409This idempotency_key was already used — requery the returned transaction.
SERVICE_UNAVAILABLE503Upstream provider or service is temporarily unavailable.

Notes

  • Pending purchases return HTTP 201 — poll GET /transactions/{id} until success, failed, or refunded.

VendPower Developer API