Skip to main content
POST
/
api
/
external
/
v1
/
electricity
/
buy
Purchase electricity (vend / postpaid)
curl --request POST \
  --url https://api.dancity.app/api/external/v1/electricity/buy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'channel: <api-key>' \
  --data '
{
  "meterNumber": "<string>",
  "meterType": "prepaid",
  "amount": 501,
  "customerName": "<string>",
  "address": "<string>",
  "pin": "<string>",
  "billerCode": "<string>",
  "billerName": "<string>",
  "customerRef": "<string>",
  "saveAsBeneficiary": true,
  "beneficiaryName": "<string>",
  "promocode": "<string>",
  "deviceKey": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": "<unknown>"
}

Authorizations

Authorization
string
header
required

Merchant API key from the Dancity dashboard.

channel
string
header
required

Required on VAS (merchant /api/external/v1) requests. Use API for server integrations.

Body

application/json
meterNumber
string
required
meterType
enum<string>
required
Available options:
prepaid,
postpaid
amount
number
required
Required range: x >= 500
customerName
string
required
address
string
required
pin
string
required
billerCode
string

Optional Mongo ObjectId for biller

billerName
string
customerRef
string
saveAsBeneficiary
boolean
beneficiaryName
string
promocode
string
deviceKey
string

Response

OK

success
boolean
Example:

true

message
string
data
any