I'm using Stripe API and Stripe Connect. I want to transfer money from Customers to Express Connected account. I want to use direct charges, but it's not clear from the docs, how should I use it. The documentation says:
To directly charge on the connected account, perform a standard
create charge request using your platform’s secret key while
authenticated as the connected account:
curl https://api.stripe.com/v1/charges \
-u {STRIPE_SECRET_TOKEN}: \
-d amount=1000 \
-d currency=usd \
-d source=tok_visa \
-H "Stripe-Account: {CONNECTED_STRIPE_ACCOUNT_ID}"
As far as I understand, that means that connected account will be charged. However the documentation doesn't say how can I move to the connected account.
No, this request would charge the customer's payment source (represented by the token in the source
parameter -- in this example, it's a static test token, but in a live integration you'd generate a token from the customer's card using Checkout or Elements), and the funds would be sent to the connected account specified in the Stripe-Account
header.
If you wish to take a cut out of this transaction, you'd need to add an application_fee
parameter. The funds would then automatically be split when creating the charge, with the application fee being added to your platform's balance and the remainder (charge amount minus your application fee and Stripe's own fees) being added to the connected account's balance.