This documentation exposes the functionality of Vomule API service to third party systems interested in vending electricity via this service. The service accepts connections via HTTP on a standard SSL/TLS port, with ReSTful API. All responses are JSON formatted.
To start vending, now that you have an account, go to My Applications
and create an application. There can only be one application under each category. To register, click
on add new application button. Select Electricity for category. If you already have
an application under this category, you can't have another.
Adding an application
After a successful application creation, you will receive an email confirming the application details. The API key is very useful, and must be kept a secret as far as possible. If anyone knows your apikey, they can start selling electricity on your funds.
After a successful creation, you can start vending electricity via API or the portal. To vend via the portal, simply go to
Electricity and start vending.
API key
API url is https://api.vomule.net. Your full url should look like https://api.vomule.net/elec/buy/APIKEY?meter=12345678&amount=50
Below is full documentation for available functions
Performs a basic customer check on the given meter number, as means to verify the meter number. Though not mandatory, it is extremely important that customer check is performed before every purchase
https://api.vomule.net/elec/check/APIKEY?meter=1234567890
{
"maxvend": "LEC LOC_4",
"minvend": "MS HELP DANKIE",
"datetime": "2021-10-31 20:07:30",
"amount": null,
"owner": "MS HELP DANKIE",
"meternumber": "07000000773",
"code": 200,
"message": "Successfully completed",
"reply": "success",
"text": "Buy electricity for MS HELP DANKIE?"
}
Performs electricity vending for the given meter number and amount. It is crucial to call this method after having called check.
https://api.vomule.net/elec/buy/APIKEY?meter=1234567890&amount=50
{
"code": 200,
"text": "Transaction completed successfully",
"transid": "lC3erHlo8dhy79Tq",
"meternumber": "07000000773",
"owner": "MS HELP DANKIE",
"token": "7416 1856 2289 3922 4021,3591 5331 5528 5256 2191,9408 9980 1969 5783 8055",
"meter": "07000000773",
"receipt": "37255/438",
"balance": 998878.68,
"commission": 2.7,
"tokens": 3,
"units": "6.6",
"amount": "90.00",
"nako": "2021-10-30T22:00:00.000000Z",
"created_at": "2021-10-31T18:03:25.000000Z",
"reply": "success"
}
Performs a reprint of the token for the given meter number. This fetches the last xxx purchase records of the specified meter number. You can specify the number of records to fetch. 1 record defaults if count is not specified
https://api.vomule.net/elec/reprint/APIKEY?meter=1234567890
Fetch 5 records
https://api.vomule.net/elec/reprint/5/APIKEY?meter=1234567890
{
"data": [
{
"transid": "lC3erHlo8dhy79Tq",
"meter": "07000000773",
"owner": "MS HELP DANKIE",
"amount": "90.00",
"tokens": 3,
"token": "7416 1856 2289 3922 4021,3591 5331 5528 5256 2191,9408 9980 1969 5783 8055",
"units": "6.60",
"receipt": "37255/438",
"balance": "998878.68",
"commission": "2.70",
"nako": "2021-10-30T22:00:00.000000Z",
"created_at": "2021-10-31T18:03:25.000000Z"
},
{
"transid": "XGIx43pmCxJAxVLo",
"meter": "07000000773",
"owner": "MS HELP DANKIE",
"amount": "5.00",
"tokens": 3,
"token": "7416 1856 2289 3922 4021,3591 5331 5528 5256 2191,9408 9980 1969 5783 8055",
"units": "6.60",
"receipt": "37255/438",
"balance": "998965.98",
"commission": "0.15",
"nako": "2021-10-27T22:00:00.000000Z",
"created_at": "2021-10-28T15:25:54.000000Z"
}
],
"code": 200,
"text": "Successfully completed",
"reply": "success"
}
Fetches the account balance. For any application, two consecutive balance requests may yield different values. This is because the balance fetched is the amount at that specific time, and my be altered by a different request after this one.
No parameters expected
https://api.vomule.net/elec/balance/APIKEY
{
"code": 200,
"balance": "998,878.68"
}
Your API has to implement the following test scenarios in order to be content that it is complete. The responses used in the test scenarios will be what you can expect in production. Please carefully ensure that you implement these test scenarios using the test API specified in Appendices
Note that purchases performed on electricity are non-refundable, NOT only test purchases, but all purchases.
Demo account login details
demo@vomule.net demo12345
Implement the scenarios below, to handle all different kinds of responses. All these scenarios are implemented to always produce the expected results. As a result, subsequent transactions on any test case may produce the same result for all requests. All tokens are separated into groups of 4 digits
| Meter # | Result | Comments |
|---|---|---|
| 07000000021 | Will produce vend | Will produce vend |
| 07000000286 | Will produce vend including FBE due | Will produce vend including FBE due |
| 07000000674 | Will produce vend plus Key Change Tokens x 2 i.e. Total of 3 Tokens | 3 tokens separated with commas. Two tokens are activation tokens, and the other is the units token |
| 07000000773 | Will produce vend plus Key Change Tokens x 2 i.e. Total of 3 Tokens | 3 tokens separated with commas. Two tokens are activation tokens, and the other is the units token |
| 07000000849 | Will produce vend including FBE due, plus Arrears deduction | Will produce vend including FBE due, plus Arrears deduction |
| 07000000070 | Block meter | Will fail with message: Meter blocked |
| 07104785303 | Location without meter | Will fail with message: Location without meter |
| 07000000088 | Location without consumer | Will fail with message: Location without consumer |
This section explains the parameters in details, and specifies their types. These apply to all request and response parameters
| Parameter | Type | Comments |
|---|---|---|
| address1 | string | Owner address line 1 |
| address2 | string | Owner address line 2 |
| address3 | string | Owner address line 3 |
| amount | number | Purchase amount; must be a valid currency value. Only . is allowed, otherwise, only numbers. Minimum amount is found in minvend parameter, as does maximum amount. |
| balance | number | Balance remaining after a particular purchase, or at the time it is queried |
| code | number | Response code, see below |
| commission | number | Commission earned on this purchase. Commissions are added back to your account for every purchase |
| created_at | datetime | The datetime string representing UTC time when this purchase was recorded. Datetime uses ISO datetime format (yyyy-MM-dd hh:mm:ss) |
| data | list | A list of records, each containing any of the parameters laid out in this table. This is mostly used for reprints |
| location | string | The owner's location |
| maxvend | number | Maximum vend amount |
| minvend | number | Minimum vend amount |
| meter | number | The meter number to purchase for |
| owner | string | The owner of the meter number |
| postal | string | The postal address of the owner |
| receipt | number | Receipt number for this purchase |
| town | string | The owner's town |
| token | string | Token generated for this purchase. If there are multiple tokens, they're separated with commas. Each token is separated into groups of 4 digits |
| tokens | number | Number of tokens in the response |
| transid | string | The transaction id. This may be used as reference to reprint tokens, query data, etc in the future |
| units | number | Units obtained for this purchase in kwH |
This section covers in details the response codes to expect when using this service.
| Code | Code name | Meaning |
|---|---|---|
| 200 | SUCCESS | Action performed successfully |
| 500 | General errors, most of which are undocumented and/or dynamic | |
| 501 | ERR_INSUFFICIENT_FUNDS | You do not have enough funds to perform this action |
| 502 | API_PENDING | Application is still pending |
| 503 | API_SUSPENDED | Application has been suspended |
| 504 | API_INVALID | API key cannot be found |
| 505 | API_NOT_APPLICABLE | Attempting to use an application which is NOT applicable to the service, such as trying to send SMS with electricity API |
This section lays out some important points to take care of when using this API
i2dffcdlwvoiceyyoewnp7nqrr2ltbxsUse this API key to perform tests on your application. This will NOT charge your account. All your APIs are production APIs. Whenever you use them, you will be charged. Test API key works only with test meter numbers layed out in test scenarios section.