Currently, it seems as though Connect's Accounts
does everything the Customers
does, e.g. it is possible to add a bank card directly to the Accounts
account. So just creating an Accounts
object for a user seems enough, but would there ever be a case I would have to create a Customers
object?
For example, in the tutorial (https://stripe.com/docs/connect/payments-fees
), the TOKEN could simply provide the Accounts
publishable key:
stripe.charges.create({
amount: 1000,
currency: 'usd',
source: {TOKEN},
destination: {CONNECTED_STRIPE_ACCOUNT_ID}
});
For clarification, is source
where the funds will be pulled from, and destination
is where the funds will be headed? And the funds will be deposited into the destination
's default bank account?
Also, when an Accounts
gets created via API, will the newly connected account be viewable via the platform's dashboard? And also be able to view transactions and balance?
Lastly, when transferring funds, by not defining the source, does that mean the funds will be pulled from the platform account's balance?
var stripe = require('stripe')(PLATFORM_SECRET_KEY);
stripe.transfers.create(
{
amount: 1000,
currency: "usd",
destination: "default_for_currency"
},
{stripe_account: CONNECTED_STRIPE_ACCOUNT_ID}
);
Will accept/upvote the answer. Thank you in advance.
When developing a Platform there are two functions you're generally interested in: paying out and taking payment from users. Stripe divides these functions up into two separate object types.
An Account
is an object to represent a user that you pay out to. An account can have an External Account
(a bank account, or in some cases, a debit card) attached. For compliance reasons an account will need to provide some personal information verify the user's identity.
There are three types of accounts you can connect to a Platform:
Standard
(formerly called Standalone
), which are normal Stripe accounts. You connect a Standard Stripe account to your platform through an OAuth-based flow.Custom
(formerly Managed
), which give you much more control over
the user experience, but require more work on your end: you control custom accounts entirely through the API and are responsible for building a dashboard, sign-up forms, and other account management interfaces. Express
accounts, which lie somewhere between Standard and Custom. Stripe provides Express users with an easy sign-up form and a lite dashboard.https://stripe.com/docs/connect/connecting-to-accounts
A Customer
is an object you can save a Credit Credit, Bank Account, Bitcoin Receiver, etc to and then charge / take payment from. https://stripe.com/docs/api#customers
Stripe offers the ability to create a Customer
object if you'd like to store a card and charge it into the future. If you're only interested in a one-off transactions, you could simply take and use a token obtained with Checkout / Stripe.js / mobile sdk and your publishable key.
You can find examples of payment flows using a token for a one-off payment and a Customer here, https://stripe.com/docs/charges
To be clear, there is not a way to pay out to a Customer object or charge the bank account or debit card attached to an Account.
In your first example:
source
is a token, tok_xxxyyyyzzz
, generally obtained via Stripe.js / Checkout / mobile SDK which you'd pass to your backend. If you saved the source to a Customer
on your account, you could pass customer: cus_xxxyyyzzz
instead to charge the default source
on that Customer
.
https://stripe.com/docs/connect/payments-fees#charging-through-the-platform
destination
is the Account
you'd like the funds to flow through. Charging with destination
is most often used with Custom Accounts. When charging this way, funds will move from your Platform to the balance of the destination
Account. If that account is set to automatic transfers, funds will move to their default bank account automatically when those funds become available for transfer.
The flow looks like this:
Charge (token or customer on Platform) -> Platform Balance -> Custom Account Balance (destination) -> Custom Account Bank Account
If you need more control and granularity of the movement of funds from a Custom Account's balance to their bank account(s), you can set the Custom Account to manual transfers. Read more about that here, https://stripe.com/docs/connect/bank-transfers#payout-information
If you're creating Custom Accounts
or users are connecting their Standard Accounts
through the OAuth process, they should be viewable in your dashboard: https://dashboard.stripe.com/applications/users
If you'd like specific detail for the balance of a Connected Account, you'll want to make a call to retrieve their balance or balance transactions, while authenticating with the Stripe Account header (their account id, e.g. acct_xxxyyyyzzzz
)
https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header https://stripe.com/docs/api#balance_history
Finally, the example you've provided is passing the Stripe-Account header, {stripe_account: CONNECTED_STRIPE_ACCOUNT_ID}
, so it is happening on a connected account --- it is transferring funds from the Connected Account's balance to their default bank account. This would be used if your Connected Account were on manual transfers.
The way you make a transfer from the Platform's balance to a Connected Account is outlined here. https://stripe.com/docs/connect/special-case-transfers#transferring-to-another-stripe-account
As the name "special case transfer" implies, these Platform -> Connected Account
transfers should only happen in limited circumstances (there is not currently a way to move funds from Connected Account -> Platform).
ripe = require('stripe')(PLATFORM_SECRET_KEY);
stripe.transfers.create(
{
amount: 1000,
currency: 'usd',
destination: {CONNECTED_STRIPE_ACCOUNT_ID},
source_transaction: {CHARGE_ID}
}
);
Overall building a Connect flow that works for your needs can be a complex but rewarding undertaking --- I'd recommend chatting with Stripe's support folks if you get stuck on specifics, https://support.stripe.com/email
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With