Retrieve details about a specific bank account stored on the Stripe account.
curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99 \
-u STRIPE_SECRET_KEY:
#include <C_CkRest.h>
#include <C_CkStringBuilder.h>
#include <C_CkJsonObject.h>
void ChilkatSample(void)
{
HCkRest rest;
BOOL success;
BOOL bTls;
int port;
BOOL bAutoReconnect;
HCkStringBuilder sbResponseBody;
HCkJsonObject jsonResponse;
const char *id;
const char *object;
const char *account;
const char *account_holder_name;
const char *account_holder_type;
const char *bank_name;
const char *country;
const char *currency;
BOOL default_for_currency;
const char *fingerprint;
const char *last4;
const char *routing_number;
const char *status;
const char *customer;
rest = CkRest_Create();
// URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99
bTls = TRUE;
port = 443;
bAutoReconnect = TRUE;
success = CkRest_Connect(rest,"api.stripe.com",port,bTls,bAutoReconnect);
if (success != TRUE) {
printf("ConnectFailReason: %d\n",CkRest_getConnectFailReason(rest));
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
return;
}
CkRest_SetAuthBasic(rest,"STRIPE_SECRET_KEY","");
sbResponseBody = CkStringBuilder_Create();
success = CkRest_FullRequestNoBodySb(rest,"GET","/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99",sbResponseBody);
if (success != TRUE) {
printf("%s\n",CkRest_lastErrorText(rest));
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
return;
}
jsonResponse = CkJsonObject_Create();
CkJsonObject_LoadSb(jsonResponse,sbResponseBody);
id = CkJsonObject_stringOf(jsonResponse,"id");
object = CkJsonObject_stringOf(jsonResponse,"object");
account = CkJsonObject_stringOf(jsonResponse,"account");
account_holder_name = CkJsonObject_stringOf(jsonResponse,"account_holder_name");
account_holder_type = CkJsonObject_stringOf(jsonResponse,"account_holder_type");
bank_name = CkJsonObject_stringOf(jsonResponse,"bank_name");
country = CkJsonObject_stringOf(jsonResponse,"country");
currency = CkJsonObject_stringOf(jsonResponse,"currency");
default_for_currency = CkJsonObject_BoolOf(jsonResponse,"default_for_currency");
fingerprint = CkJsonObject_stringOf(jsonResponse,"fingerprint");
last4 = CkJsonObject_stringOf(jsonResponse,"last4");
routing_number = CkJsonObject_stringOf(jsonResponse,"routing_number");
status = CkJsonObject_stringOf(jsonResponse,"status");
customer = CkJsonObject_stringOf(jsonResponse,"customer");
CkRest_Dispose(rest);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jsonResponse);
}
{
"id": "ba_1BnETKGswQrCoh0XzgjB3t99",
"object": "bank_account",
"account": "acct_18qpKxGswQrCoh0X",
"account_holder_name": "Jane Austen",
"account_holder_type": "individual",
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": false,
"fingerprint": "L2j4aSuWk1MZMDZ5",
"last4": "6789",
"metadata": {},
"routing_number": "110000000",
"status": "new",
"customer": "cus_CBbg3iRMzWBjoe"
}