C# Requires Chilkat v11.7.0+
C#
Stripe: Check where a refund stands
See more Stripe Examples
Read the current status of a saved refund, including the reason for a pending or failed refund when available.
Stripe documentation and cURL example
Chilkat 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;
string refundId = "re_FROM_REFUND_RECORD";
// curl -X GET "https://api.stripe.com/v1/refunds/{refundId}" \
// -u "$STRIPE_API_KEY:" \
// -H "Stripe-Version: 2026-10-28.endive"
cmd.SetString("curl -X GET \"https://api.stripe.com/v1/refunds/@ID@\"");
cmd.Append(" -u \"@KEY@:\"");
cmd.Append(" -H \"Stripe-Version: 2026-10-28.endive\"");
replaced = cmd.Replace("@ID@",refundId);
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;
}
Debug.WriteLine("id = " + json.StringOf("id"));
Debug.WriteLine("status = " + json.StringOf("status"));
Debug.WriteLine("amount = " + json.StringOf("amount"));
Debug.WriteLine("currency = " + json.StringOf("currency"));
if (json.StringOf("status") == "failed") {
Debug.WriteLine("Failure reason: " + json.StringOf("failure_reason"));
}
if (json.StringOf("status") == "pending") {
Debug.WriteLine("Pending reason: " + json.StringOf("pending_reason"));
}