PowerShell Requires Chilkat v11.7.0+
PowerShell
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 PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
# Requires an unlocked Chilkat bundle. See Global Unlock Sample.
# Supply a restricted sandbox key from merchant-controlled configuration.
$apiKey = "YOUR_STRIPE_TEST_KEY"
$curl = New-Object Chilkat.HttpCurl
$cmd = New-Object Chilkat.StringBuilder
$json = New-Object Chilkat.JsonObject
# curl -X GET "https://api.stripe.com/v1/balance" \
# -u "$STRIPE_API_KEY:" \
# -H "Stripe-Version: 2026-10-28.endive"
$cmd.SetString("curl -X GET `"https://api.stripe.com/v1/balance`"")
$cmd.Append(" -u `"@KEY@:`"")
$cmd.Append(" -H `"Stripe-Version: 2026-10-28.endive`"")
$replaced = $cmd.Replace("@KEY@",$apiKey)
$success = $curl.DoYourThing($cmd.GetAsString())
if ($success -ne $true) {
$("No HTTP response. Chilkat failure code: " + $curl.FailReason)
exit
}
$success = $curl.GetResponseJson($json)
if (($curl.StatusCode -ne 200) -or ($success -ne $true)) {
$("Stripe HTTP " + $curl.StatusCode + " Request-Id: " + $curl.GetResponseHeaderField("Request-Id"))
if ($success -eq $true) {
$($json.StringOf("error.message"))
}
exit
}
# Amounts are integer minor units. Read them as text to preserve large balances.
$availableIndex = 0
while (($availableIndex -lt $json.SizeOfArray("available"))) {
$json.I = $availableIndex
$("available: " + $json.StringOf("available[i].amount") + " " + $json.StringOf("available[i].currency"))
$availableIndex = $availableIndex + 1
}
$pendingIndex = 0
while (($pendingIndex -lt $json.SizeOfArray("pending"))) {
$json.I = $pendingIndex
$("pending: " + $json.StringOf("pending[i].amount") + " " + $json.StringOf("pending[i].currency"))
$pendingIndex = $pendingIndex + 1
}