Get account balance


https://dash.stannp.com/api/v1/accounts/balance
Request
$ curl https://dash.stannp.com/api/v1/accounts/balance \
-u {API_KEY}:
define("API_KEY", "YOUR API KEY");
$opts = array(
    'http' => array(
        'method'  => 'GET',
        'header'  => 'Content-type: application/x-www-form-urlencoded'
    )
);
$context  = stream_context_create($opts);
$result = file_get_contents("https://dash.stannp.com/api/v1/accounts/balance?api_key=" . API_KEY, false, $context);
$response = json_decode($result, true);

print_r($response);
import requests

response = requests.get('https://dash.stannp.com/api/v1/accounts/balance?api_key={API_KEY}')
print(response.text)
var client = new RestClient("https://dash.stannp.com/api/v1/accounts/balance?api_key={API_KEY}");

var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);

Console.WriteLine(response.Content);
Response
{
    "success":true,
    "data": {
        "balance":"214.42"
    }
}

Top up balance

You can use the API to top up your balance if you have a saved card and set one to default.
https://dash.stannp.com/api/v1/accounts/topup

Parameters

net mandatory The amount to top up. Eg: "10.00". Be aware tax may be added on after.
Request
$ curl https://dash.stannp.com/api/v1/accounts/topup \
-u {API_KEY}: \
-d "net=10.00"
define("API_KEY", "YOUR API KEY");
$postdata = http_build_query(
    array(
        'net' => "10.00"
    )
);
$opts = array(
    'http' => array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
    )
);
$context  = stream_context_create($opts);
$result = file_get_contents("https://dash.stannp.com/api/v1/accounts/topup?api_key=" . API_KEY, false, $context);
$response = json_decode($result, true);

print_r($response);
import requests

data = {
    'net': '10.00',
}

response = requests.post('https://dash.stannp.com/api/v1/accounts/topup?api_key={API_KEY}', data=data)
print(response.text)
var client = new RestClient("https://dash.stannp.com/api/v1/accounts/topup?api_key={API_KEY}");

var request = new RestRequest(Method.POST);

request.AddParameter("net", "10.00");

IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content)
Response
{
   "success":true,
   "data":{
      "receipt_pdf":"https://www.stannp.com/invoice/12345-uhusdsfsi34545-fgfdfdb.pdf"
   }
}