Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
curl https://api.stripe.com/v1/customers/cus_CBbgVLJqv487Oq \
-u STRIPE_SECRET_KEY: \
-X DELETE
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
CkRest rest = new CkRest();
boolean success;
// URL: https://api.stripe.com/v1/customers/cus_CBbgVLJqv487Oq
boolean bTls = true;
int port = 443;
boolean bAutoReconnect = true;
success = rest.Connect("api.stripe.com",port,bTls,bAutoReconnect);
if (success != true) {
System.out.println("ConnectFailReason: " + rest.get_ConnectFailReason());
System.out.println(rest.lastErrorText());
return;
}
rest.SetAuthBasic("STRIPE_SECRET_KEY","");
CkStringBuilder sbResponseBody = new CkStringBuilder();
success = rest.FullRequestNoBodySb("DELETE","/v1/customers/cus_CBbgVLJqv487Oq",sbResponseBody);
if (success != true) {
System.out.println(rest.lastErrorText());
return;
}
CkJsonObject jsonResponse = new CkJsonObject();
jsonResponse.LoadSb(sbResponseBody);
boolean deleted;
String id;
deleted = jsonResponse.BoolOf("deleted");
id = jsonResponse.stringOf("id");
}
}
{
"deleted": true,
"id": "cus_CBbgVLJqv487Oq"
}