.NET Core C# Requires Chilkat v11.7.0+
.NET Core C#
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 .NET Core C# Downloads
bool success = false;
// Requires an unlocked Chilkat bundle. See Global Unlock Sample.
// Supply a restricted sandbox key from merchant-controlled configuration.
string apiKey = "YOUR_STRIPE_TEST_KEY";
Chilkat.HttpCurl curl = new Chilkat.HttpCurl();
Chilkat.StringBuilder cmd = new Chilkat.StringBuilder();
Chilkat.JsonObject json = new Chilkat.JsonObject();
int replaced;
Chilkat.StringBuilder lookupKey = new 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 != true) {
Debug.WriteLine("No HTTP response. Chilkat failure code: " + Convert.ToString(curl.FailReason));
return;
}
success = curl.GetResponseJson(json);
if ((curl.StatusCode != 200) || (success != true)) {
Debug.WriteLine("Stripe HTTP " + Convert.ToString(curl.StatusCode) + " Request-Id: " + curl.GetResponseHeaderField("Request-Id"));
if (success == true) {
Debug.WriteLine(json.StringOf("error.message"));
}
return;
}
if ((json.SizeOfArray("data") != 1) || (json.BoolOf("has_more") == true)) {
Debug.WriteLine("Expected one active price for this lookup key.");
return;
}
Debug.WriteLine("id = " + json.StringOf("data[0].id"));
Debug.WriteLine("lookup_key = " + json.StringOf("data[0].lookup_key"));
Debug.WriteLine("currency = " + json.StringOf("data[0].currency"));
Debug.WriteLine("unit_amount_decimal = " + json.StringOf("data[0].unit_amount_decimal"));
Debug.WriteLine("type = " + json.StringOf("data[0].type"));