AutoIt Requires Chilkat v11.7.0+
AutoIt
Stripe: Find a catalog price by its lookup key
See more Stripe Examples
Retrieve an active price by its catalog lookup key and read its price ID, currency, amount, and billing type.
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
$oLookupKey = ObjCreate("Chilkat.StringBuilder")
$oLookupKey.SetString("support_monthly_usd")
; curl -X GET "https://api.stripe.com/v1/prices?active=true&lookup_keys%5B%5D={lookupKey}&limit=2" \
; -u "$STRIPE_API_KEY:" \
; -H "Stripe-Version: 2026-10-28.endive"
$oCmd.SetString("curl -X GET ""https://api.stripe.com/v1/prices?active=true&lookup_keys%5B%5D=@LOOKUP@&limit=2""")
$oCmd.Append(" -u ""@KEY@:""")
$oCmd.Append(" -H ""Stripe-Version: 2026-10-28.endive""")
$iReplaced = $oCmd.Replace("@LOOKUP@",$oLookupKey.GetEncoded("url_rfc3986","utf-8"))
$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
If (($oJson.SizeOfArray("data") <> 1) Or ($oJson.BoolOf("has_more") = True)) Then
ConsoleWrite("Expected one active price for this lookup key." & @CRLF)
Exit
EndIf
ConsoleWrite("id = " & $oJson.StringOf("data[0].id") & @CRLF)
ConsoleWrite("lookup_key = " & $oJson.StringOf("data[0].lookup_key") & @CRLF)
ConsoleWrite("currency = " & $oJson.StringOf("data[0].currency") & @CRLF)
ConsoleWrite("unit_amount_decimal = " & $oJson.StringOf("data[0].unit_amount_decimal") & @CRLF)
ConsoleWrite("type = " & $oJson.StringOf("data[0].type") & @CRLF)