Sample code for 30+ languages & platforms
PowerShell Requires Chilkat v11.7.0+

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 PowerShell Downloads

PowerShell
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

$lookupKey = New-Object Chilkat.StringBuilder
$lookupKey.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"
$cmd.SetString("curl -X GET `"https://api.stripe.com/v1/prices?active=true&lookup_keys%5B%5D=@LOOKUP@&limit=2`"")
$cmd.Append(" -u `"@KEY@:`"")
$cmd.Append(" -H `"Stripe-Version: 2026-10-28.endive`"")
$replaced = $cmd.Replace("@LOOKUP@",$lookupKey.GetEncoded("url_rfc3986","utf-8"))
$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
}

if (($json.SizeOfArray("data") -ne 1) -or ($json.BoolOf("has_more") -eq $true)) {
    $("Expected one active price for this lookup key.")
    exit
}

$("id = " + $json.StringOf("data[0].id"))
$("lookup_key = " + $json.StringOf("data[0].lookup_key"))
$("currency = " + $json.StringOf("data[0].currency"))
$("unit_amount_decimal = " + $json.StringOf("data[0].unit_amount_decimal"))
$("type = " + $json.StringOf("data[0].type"))