API reference
Nine endpoints. One header.
Authorization: Bearer <your-api-key>
Content-Type: application/json| Environment | Base URL |
|---|---|
| Production | https://api.getelectric.ng/api/v2 |
| Staging | https://stagingapi.getelectric.ng/api/v2 |
Live and test are not separate hosts. Your key decides which mode you are in.
The endpoints
| Endpoint | What for | |
|---|---|---|
GET | /reseller/me | Who the key belongs to, and its mode |
POST | /reseller/meters/verify | Check an electricity meter |
POST | /reseller/targets/verify | Check a cable TV smartcard |
POST | /reseller/orders | Buy something |
GET | /reseller/orders | Your recent orders |
GET | /reseller/orders/{reference} | One order |
GET | /reseller/catalogue/services | What you can sell |
GET | /reseller/catalogue/services/{service}/providers | Who sells it |
GET | /reseller/catalogue/providers/{provider}/plans | Their plans and prices |
Plus one webhook we send you, order.settled.
Everything shares one envelope
{
"success": true,
"status": "success",
"code": 200,
"message": "OK",
"data": { }
}code is the HTTP status repeated, not an error code. There are no error
codes. Errors explains what that means for your error
handling.
Every response carries X-Request-Id. Log it.
Only one call spends money
Place an order. Everything else is a read.
That endpoint is also the only one with idempotency to understand, the only one that can return a failure with a body, and the only one allowed your whole in-flight budget. If you read one reference page properly, read that one.
This reference is generated
These pages come from the same contract the service is tested against, and a test fails the build if the two disagree: an endpoint cannot ship undocumented, and a documented endpoint cannot vanish. So if a page here disagrees with what the API did, that is a bug worth reporting rather than a stale page.
Every page is also available as markdown, at the same address with .md on the
end, and the index lists them all. Point your own tools
at those.