Reputation: 528
I have an endpoint that is receiving events from Connected Stripe accounts. The webhook listens for the account.updated
event type. It works as expected. However, when I look at the object sent to my endpoint, I'm not sure what would indicate that the account is in "enabled" status. I ask because if the Connected account was successfully set up, I would like to then give the customer the ability to access their Stripe dashboard. If it's not, then I would want for them to be able to finish the account setup process. Any insight would be appreciated. This is what I get from the Stripe webhook:
{
"id": "EXAMPLEID",
"object": "event",
"account": "ACCOUNT",
"api_version": "2020-03-02",
"created": 1608614938,
"data": {
"object": {
"id": "ACCOUNTNUMBER",
"object": "account",
"business_profile": {
"mcc": null,
"name": null,
"support_address": null,
"support_email": null,
"support_phone": null,
"support_url": null,
"url": null
},
"capabilities": {
"transfers": "active"
},
"charges_enabled": true,
"country": "US",
"default_currency": "usd",
"details_submitted": true,
"email": null,
"payouts_enabled": true,
"settings": {
"bacs_debit_payments": {
},
"branding": {
"icon": null,
"logo": null,
"primary_color": null,
"secondary_color": null
},
"card_payments": {
"statement_descriptor_prefix": null,
"decline_on": {
"avs_failure": false,
"cvc_failure": false
}
},
"dashboard": {
"display_name": "Books For Everyone",
"timezone": "Etc/UTC"
},
"payments": {
"statement_descriptor": null,
"statement_descriptor_kana": null,
"statement_descriptor_kanji": null
},
"sepa_debit_payments": {
},
"payouts": {
"debit_negative_balances": true,
"schedule": {
"delay_days": 2,
"interval": "daily"
},
"statement_descriptor": null
}
},
"type": "express",
"created": 1608614884,
"external_accounts": {
"object": "list",
"data": [
{
"id": "ID_NUMBER_HERE",
"object": "bank_account",
"account": "ACCOUNT_NUMBER_HERE",
"account_holder_name": null,
"account_holder_type": null,
"available_payout_methods": [
"standard"
],
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"default_for_currency": true,
"fingerprint": "x9ELfUw7u81waQkl",
"last4": "6789",
"metadata": {
},
"routing_number": "110000000",
"status": "new"
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/accounts/ACCOUNT_NUMBER/external_accounts"
},
"login_links": {
"object": "list",
"total_count": 0,
"has_more": false,
"url": "/v1/accounts/ACCOUNT_NUMBER/login_links",
"data": [
]
},
"metadata": {
},
"requirements": {
"current_deadline": null,
"currently_due": [
],
"disabled_reason": null,
"errors": [
],
"eventually_due": [
"individual.dob.day",
"individual.dob.month",
"individual.dob.year",
"individual.ssn_last_4"
],
"past_due": [
],
"pending_verification": [
]
},
"tos_acceptance": {
"date": 1608614937
}
},
"previous_attributes": {
"capabilities": {
"transfers": "inactive"
},
"charges_enabled": false,
"details_submitted": false,
"payouts_enabled": false,
"requirements": {
"currently_due": [
"tos_acceptance.date",
"tos_acceptance.ip"
],
"disabled_reason": "requirements.past_due",
"eventually_due": [
"individual.dob.day",
"individual.dob.month",
"individual.dob.year",
"individual.ssn_last_4",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"past_due": [
"tos_acceptance.date",
"tos_acceptance.ip"
]
},
"tos_acceptance": {
"date": null
}
}
},
"livemode": false,
"pending_webhooks": 1,
"request": {
"id": "ID_NUMBER_HERE",
"idempotency_key": null
},
"type": "account.updated"
}
Upvotes: 3
Views: 835
Reputation: 7459
Because there are now multiple things an account might be used for, there isn't necessarily one single attribute to check for being "enabled" overall. Mostly you'll want to look at the capabilities
(docs, API reference) such as in your data where you see transfers: 'active'
, which indicates that account is currently enabled for transfers.
You'll also want to keep an eye on the requirements
hash (docs, API ref), which is how Stripe will inform you that additional information is needed now (or eventually).
Upvotes: 2