Skip to main content
POST
Buy electricity

Authorizations

Authorization
string
header
required

See Authentication for the full explanation of session tokens vs. API keys and when each is used.

Headers

Idempotency-Key
string
required

Required on purchase endpoints. Use a new key for each intended purchase, and reuse that same key when retrying the same request after a timeout. A completed key replays the original response. The same key with a different body is rejected. Keys expire after 24 hours. A missing key returns 400 with no error_code.

Maximum string length: 255

Body

application/json
meter_number
string
required
Required string length: 9 - 15
service_type
string
required

Disco code. Must match the name enquiry.

Maximum string length: 150
amount
number
required
Required range: 100 <= x <= 1000000
phone
string
required
Pattern: ^0\d{10}$
customer_reference
string | null
Maximum string length: 100

Response

Purchased. data is a bills transaction with bill_type: electricity.

status
enum<string>
Available options:
success
message
string
data
object

A bills-payment debit against the partner Master account. id and every *_id are strings. Money fields are decimal strings.