Retrieves the details of an existing customer. You need only supply the unique customer identifier that was returned upon customer creation.
curl https://api.stripe.com/v1/customers/cus_CBbgVLJqv487Oq \
-u STRIPE_SECRET_KEY:
var
rest: TChilkatRest;
success: Integer;
bTls: Integer;
port: Integer;
bAutoReconnect: Integer;
sbResponseBody: TChilkatStringBuilder;
jsonResponse: TChilkatJsonObject;
id: WideString;
object: WideString;
account_balance: Integer;
created: Integer;
currency: WideString;
default_source: Integer;
delinquent: Integer;
description: Integer;
discount: Integer;
email: Integer;
livemode: Integer;
shipping: Integer;
sourcesObject: WideString;
sourcesHas_more: Integer;
sourcesTotal_count: Integer;
sourcesUrl: WideString;
subscriptionsObject: WideString;
subscriptionsHas_more: Integer;
subscriptionsTotal_count: Integer;
subscriptionsUrl: WideString;
i: Integer;
count_i: Integer;
begin
rest := TChilkatRest.Create(Self);
// URL: https://api.stripe.com/v1/customers/cus_CBbgVLJqv487Oq
bTls := 1;
port := 443;
bAutoReconnect := 1;
success := rest.Connect('api.stripe.com',port,bTls,bAutoReconnect);
if (success <> 1) then
begin
Memo1.Lines.Add('ConnectFailReason: ' + IntToStr(rest.ConnectFailReason));
Memo1.Lines.Add(rest.LastErrorText);
Exit;
end;
rest.SetAuthBasic('STRIPE_SECRET_KEY','');
sbResponseBody := TChilkatStringBuilder.Create(Self);
success := rest.FullRequestNoBodySb('GET','/v1/customers/cus_CBbgVLJqv487Oq',sbResponseBody.ControlInterface);
if (success <> 1) then
begin
Memo1.Lines.Add(rest.LastErrorText);
Exit;
end;
jsonResponse := TChilkatJsonObject.Create(Self);
jsonResponse.LoadSb(sbResponseBody.ControlInterface);
id := jsonResponse.StringOf('id');
object := jsonResponse.StringOf('object');
account_balance := jsonResponse.IntOf('account_balance');
created := jsonResponse.IntOf('created');
currency := jsonResponse.StringOf('currency');
default_source := jsonResponse.IsNullOf('default_source');
delinquent := jsonResponse.BoolOf('delinquent');
description := jsonResponse.IsNullOf('description');
discount := jsonResponse.IsNullOf('discount');
email := jsonResponse.IsNullOf('email');
livemode := jsonResponse.BoolOf('livemode');
shipping := jsonResponse.IsNullOf('shipping');
sourcesObject := jsonResponse.StringOf('sources.object');
sourcesHas_more := jsonResponse.BoolOf('sources.has_more');
sourcesTotal_count := jsonResponse.IntOf('sources.total_count');
sourcesUrl := jsonResponse.StringOf('sources.url');
subscriptionsObject := jsonResponse.StringOf('subscriptions.object');
subscriptionsHas_more := jsonResponse.BoolOf('subscriptions.has_more');
subscriptionsTotal_count := jsonResponse.IntOf('subscriptions.total_count');
subscriptionsUrl := jsonResponse.StringOf('subscriptions.url');
i := 0;
count_i := jsonResponse.SizeOfArray('sources.data');
while i < count_i do
begin
jsonResponse.I := i;
i := i + 1;
end;
i := 0;
count_i := jsonResponse.SizeOfArray('subscriptions.data');
while i < count_i do
begin
jsonResponse.I := i;
i := i + 1;
end;
{
"id": "cus_CBbgVLJqv487Oq",
"object": "customer",
"account_balance": 0,
"created": 1516662781,
"currency": "usd",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": null,
"livemode": false,
"metadata": {},
"shipping": null,
"sources": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_CBbgVLJqv487Oq/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_CBbgVLJqv487Oq/subscriptions"
}
}