Visual Basic 6.0 Requires Chilkat v11.7.0+
Visual Basic 6.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 Visual Basic 6.0 Downloads
Dim success As Long
success = 0
' Requires an unlocked Chilkat bundle. See Global Unlock Sample.
' Supply a restricted sandbox key from merchant-controlled configuration.
Dim apiKey As String
apiKey = "YOUR_STRIPE_TEST_KEY"
Dim curl As New ChilkatHttpCurl
Dim cmd As New ChilkatStringBuilder
Dim json As New ChilkatJsonObject
Dim replaced As Long
Dim lookupKey As New ChilkatStringBuilder
success = 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"
success = cmd.SetString("curl -X GET ""https://api.stripe.com/v1/prices?active=true&lookup_keys%5B%5D=@LOOKUP@&limit=2""")
success = cmd.Append(" -u ""@KEY@:""")
success = 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 <> 1) Then
Debug.Print "No HTTP response. Chilkat failure code: " & curl.FailReason
Exit Sub
End If
success = curl.GetResponseJson(json)
If ((curl.StatusCode <> 200) Or (success <> 1)) Then
Debug.Print "Stripe HTTP " & curl.StatusCode & " Request-Id: " & curl.GetResponseHeaderField("Request-Id")
If (success = 1) Then
Debug.Print json.StringOf("error.message")
End If
Exit Sub
End If
If ((json.SizeOfArray("data") <> 1) Or (json.BoolOf("has_more") = 1)) Then
Debug.Print "Expected one active price for this lookup key."
Exit Sub
End If
Debug.Print "id = " & json.StringOf("data[0].id")
Debug.Print "lookup_key = " & json.StringOf("data[0].lookup_key")
Debug.Print "currency = " & json.StringOf("data[0].currency")
Debug.Print "unit_amount_decimal = " & json.StringOf("data[0].unit_amount_decimal")
Debug.Print "type = " & json.StringOf("data[0].type")