Retrieves the current account balance, based on the authentication that was used to make the request.
curl https://api.stripe.com/v1/balance \
-u STRIPE_SECRET_KEY:
Chilkat.Rest rest = new Chilkat.Rest();
bool success;
// URL: https://api.stripe.com/v1/balance
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = await rest.ConnectAsync("api.stripe.com",port,bTls,bAutoReconnect);
if (success != true) {
Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
Debug.WriteLine(rest.LastErrorText);
return;
}
rest.SetAuthBasic("STRIPE_SECRET_KEY","");
Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = await rest.FullRequestNoBodySbAsync("GET","/v1/balance",sbResponseBody);
if (success != true) {
Debug.WriteLine(rest.LastErrorText);
return;
}
Chilkat.JsonObject jsonResponse = new Chilkat.JsonObject();
jsonResponse.LoadSb(sbResponseBody);
string object;
bool livemode;
int i;
int count_i;
string currency;
int amount;
int source_typesCard;
object = jsonResponse.StringOf("object");
livemode = jsonResponse.BoolOf("livemode");
i = 0;
count_i = jsonResponse.SizeOfArray("available");
while (i < count_i) {
jsonResponse.I = i;
currency = jsonResponse.StringOf("available[i].currency");
amount = jsonResponse.IntOf("available[i].amount");
source_typesCard = jsonResponse.IntOf("available[i].source_types.card");
i = i + 1;
}
i = 0;
count_i = jsonResponse.SizeOfArray("pending");
while (i < count_i) {
jsonResponse.I = i;
currency = jsonResponse.StringOf("pending[i].currency");
amount = jsonResponse.IntOf("pending[i].amount");
source_typesCard = jsonResponse.IntOf("pending[i].source_types.card");
i = i + 1;
}
{
"object": "balance",
"available": [
{
"currency": "usd",
"amount": 0,
"source_types": {
"card": 0
}
}
],
"livemode": false,
"pending": [
{
"currency": "usd",
"amount": 0,
"source_types": {
"card": 0
}
}
]
}