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 <CkoRest.h>
#import <CkoStringBuilder.h>
#import <CkoJsonObject.h>
#import <NSString.h>
CkoRest *rest = [[CkoRest alloc] init];
BOOL success;
// URL: https://api.stripe.com/v1/customers/cus_CBbgVLJqv487Oq
BOOL bTls = YES;
int port = 443;
BOOL bAutoReconnect = YES;
success = [rest Connect: @"api.stripe.com" port: [NSNumber numberWithInt: port] tls: bTls autoReconnect: bAutoReconnect];
if (success != YES) {
NSLog(@"%@%d",@"ConnectFailReason: ",[rest.ConnectFailReason intValue]);
NSLog(@"%@",rest.LastErrorText);
return;
}
[rest SetAuthBasic: @"STRIPE_SECRET_KEY" password: @""];
CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
success = [rest FullRequestNoBodySb: @"DELETE" uriPath: @"/v1/customers/cus_CBbgVLJqv487Oq" sb: sbResponseBody];
if (success != YES) {
NSLog(@"%@",rest.LastErrorText);
return;
}
CkoJsonObject *jsonResponse = [[CkoJsonObject alloc] init];
[jsonResponse LoadSb: sbResponseBody];
BOOL deleted;
NSString *id = 0;
deleted = [jsonResponse BoolOf: @"deleted"];
id = [jsonResponse StringOf: @"id"];
{
"deleted": true,
"id": "cus_CBbgVLJqv487Oq"
}