Updates the metadata, account_holder_name, and account_holder_type of a bank account belonging to a Customer. Other bank account details are not editable by design.
curl https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99 \
-u STRIPE_SECRET_KEY: \
-d metadata[key]=value \
-X POST
#include <C_CkRestW.h>
#include <C_CkJsonObjectW.h>
void ChilkatSample(void)
{
HCkRestW rest;
BOOL success;
BOOL bTls;
int port;
BOOL bAutoReconnect;
const wchar_t *strResponseBody;
HCkJsonObjectW jsonResponse;
const wchar_t *id;
const wchar_t *object;
const wchar_t *account;
const wchar_t *account_holder_name;
const wchar_t *account_holder_type;
const wchar_t *bank_name;
const wchar_t *country;
const wchar_t *currency;
BOOL default_for_currency;
const wchar_t *fingerprint;
const wchar_t *last4;
const wchar_t *routing_number;
const wchar_t *status;
const wchar_t *customer;
const wchar_t *name;
rest = CkRestW_Create();
// URL: https://api.stripe.com/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99
bTls = TRUE;
port = 443;
bAutoReconnect = TRUE;
success = CkRestW_Connect(rest,L"api.stripe.com",port,bTls,bAutoReconnect);
if (success != TRUE) {
wprintf(L"ConnectFailReason: %d\n",CkRestW_getConnectFailReason(rest));
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
return;
}
CkRestW_SetAuthBasic(rest,L"STRIPE_SECRET_KEY",L"");
CkRestW_AddQueryParam(rest,L"metadata[key]",L"value");
strResponseBody = CkRestW_fullRequestFormUrlEncoded(rest,L"POST",L"/v1/customers/cus_CBbg3iRMzWBjoe/sources/ba_1BnETKGswQrCoh0XzgjB3t99");
if (CkRestW_getLastMethodSuccess(rest) != TRUE) {
wprintf(L"%s\n",CkRestW_lastErrorText(rest));
CkRestW_Dispose(rest);
return;
}
jsonResponse = CkJsonObjectW_Create();
CkJsonObjectW_Load(jsonResponse,strResponseBody);
id = CkJsonObjectW_stringOf(jsonResponse,L"id");
object = CkJsonObjectW_stringOf(jsonResponse,L"object");
account = CkJsonObjectW_stringOf(jsonResponse,L"account");
account_holder_name = CkJsonObjectW_stringOf(jsonResponse,L"account_holder_name");
account_holder_type = CkJsonObjectW_stringOf(jsonResponse,L"account_holder_type");
bank_name = CkJsonObjectW_stringOf(jsonResponse,L"bank_name");
country = CkJsonObjectW_stringOf(jsonResponse,L"country");
currency = CkJsonObjectW_stringOf(jsonResponse,L"currency");
default_for_currency = CkJsonObjectW_BoolOf(jsonResponse,L"default_for_currency");
fingerprint = CkJsonObjectW_stringOf(jsonResponse,L"fingerprint");
last4 = CkJsonObjectW_stringOf(jsonResponse,L"last4");
routing_number = CkJsonObjectW_stringOf(jsonResponse,L"routing_number");
status = CkJsonObjectW_stringOf(jsonResponse,L"status");
customer = CkJsonObjectW_stringOf(jsonResponse,L"customer");
name = CkJsonObjectW_stringOf(jsonResponse,L"name");
CkRestW_Dispose(rest);
CkJsonObjectW_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",
"name": "Liam Thomas"
}