AutoIt Requires Chilkat v11.7.0+
AutoIt
Stripe: Show available and pending balances by currency
See more Stripe Examples
Read the available and pending account balances for every currency returned by Stripe.
Stripe documentation and cURL example
Chilkat AutoIt Downloads
Local $bSuccess = False
; Requires an unlocked Chilkat bundle. See Global Unlock Sample.
; Supply a restricted sandbox key from merchant-controlled configuration.
Local $sApiKey = "YOUR_STRIPE_TEST_KEY"
$oCurl = ObjCreate("Chilkat.HttpCurl")
$oCmd = ObjCreate("Chilkat.StringBuilder")
$oJson = ObjCreate("Chilkat.JsonObject")
Local $iReplaced
; curl -X GET "https://api.stripe.com/v1/balance" \
; -u "$STRIPE_API_KEY:" \
; -H "Stripe-Version: 2026-10-28.endive"
$oCmd.SetString("curl -X GET ""https://api.stripe.com/v1/balance""")
$oCmd.Append(" -u ""@KEY@:""")
$oCmd.Append(" -H ""Stripe-Version: 2026-10-28.endive""")
$iReplaced = $oCmd.Replace("@KEY@",$sApiKey)
$bSuccess = $oCurl.DoYourThing($oCmd.GetAsString())
If ($bSuccess <> True) Then
ConsoleWrite("No HTTP response. Chilkat failure code: " & $oCurl.FailReason & @CRLF)
Exit
EndIf
$bSuccess = $oCurl.GetResponseJson($oJson)
If (($oCurl.StatusCode <> 200) Or ($bSuccess <> True)) Then
ConsoleWrite("Stripe HTTP " & $oCurl.StatusCode & " Request-Id: " & $oCurl.GetResponseHeaderField("Request-Id") & @CRLF)
If ($bSuccess = True) Then
ConsoleWrite($oJson.StringOf("error.message") & @CRLF)
EndIf
Exit
EndIf
; Amounts are integer minor units. Read them as text to preserve large balances.
Local $iAvailableIndex = 0
While ($iAvailableIndex < $oJson.SizeOfArray("available"))
$oJson.I = $iAvailableIndex
ConsoleWrite("available: " & $oJson.StringOf("available[i].amount") & " " & $oJson.StringOf("available[i].currency") & @CRLF)
$iAvailableIndex = $iAvailableIndex + 1
Wend
Local $iPendingIndex = 0
While ($iPendingIndex < $oJson.SizeOfArray("pending"))
$oJson.I = $iPendingIndex
ConsoleWrite("pending: " & $oJson.StringOf("pending[i].amount") & " " & $oJson.StringOf("pending[i].currency") & @CRLF)
$iPendingIndex = $iPendingIndex + 1
Wend