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:
Dim rest As New ChilkatRest
Dim success As Long
' URL: https://api.stripe.com/v1/balance
Dim bTls As Long
bTls = 1
Dim port As Long
port = 443
Dim bAutoReconnect As Long
bAutoReconnect = 1
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect)
If (success <> 1) Then
Debug.Print "ConnectFailReason: " & rest.ConnectFailReason
Debug.Print rest.LastErrorText
Exit Sub
End If
success = rest.SetAuthBasic("STRIPE_SECRET_KEY","")
Dim sbResponseBody As New ChilkatStringBuilder
success = rest.FullRequestNoBodySb("GET","/v1/balance",sbResponseBody)
If (success <> 1) Then
Debug.Print rest.LastErrorText
Exit Sub
End If
Dim jsonResponse As New ChilkatJsonObject
success = jsonResponse.LoadSb(sbResponseBody)
Dim object As String
Dim livemode As Long
Dim i As Long
Dim count_i As Long
Dim currency As String
Dim amount As Long
Dim source_typesCard As Long
object = jsonResponse.StringOf("object")
livemode = jsonResponse.BoolOf("livemode")
i = 0
count_i = jsonResponse.SizeOfArray("available")
Do 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
Loop
i = 0
count_i = jsonResponse.SizeOfArray("pending")
Do 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
Loop
{
"object": "balance",
"available": [
{
"currency": "usd",
"amount": 0,
"source_types": {
"card": 0
}
}
],
"livemode": false,
"pending": [
{
"currency": "usd",
"amount": 0,
"source_types": {
"card": 0
}
}
]
}