const account = await stripe.accounts.create({
country: 'US',
capabilities: {
treasury: {requested: true},
issuing: {requested: true}
}
});
const treasury_account =
await stripe.treasury.accounts.create({
account: account.token,
currency: 'usd'
});
const financial_account =
await stripe.financial_account.retrieve({
id: 'fa_123',
stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
//Financial Account Balances
const availableBalance = financial_account.balance.cash;
const inboundPendingBalance = financial_account.balance.inbound_pending;
const outboundPendingBalance = financial_account.balance.outbound_pending;
await stripe.accounts.update(
account.token,
{
payouts: {
schedule: {delay_days: 0, interval: 'hourly'}
}
}
);
await my_custom_event_handler(
'received_credits',
(received_credit) =﹥ {
await stripe.withdrawal.create({
description: 'Transfer 30% of credits to Capital repayment account',
type: 'balance_transfer',
account: treasury_account.token,
amount: received_credit.amount * 0.30,
currency: 'usd',
payment_method_data: {
account: capital_loan_account.token,
}
});
});
await stripe.issuing.cards.create({
currency: 'usd',
type: 'physical',
source_balance: treasury_account.token
});
仅需一次 API 请求即可创建账户对象。短短几分钟,便可完成用户注册、验证身份,并通过我们的银行伙伴快速开通账户。
const account = await stripe.accounts.create({
country: 'US',
capabilities: {
treasury: {requested: true},
issuing: {requested: true}
}
});
const treasury_account =
await stripe.treasury.accounts.create({
account: account.token,
currency: 'usd'
});