6

Is it possible to transfer an amount from one Connected-Account to another Connected-Account? both are connected under one Stripe account. I know i can split the transfer between both accounts like

$transfer = \Stripe\Transfer::create(array(
 "amount" => 7000,
 "currency" => "usd",
 "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID1}",
));


$transfer = \Stripe\Transfer::create(array(
 "amount" => 2000,
 "currency" => "usd",
 "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID2}",
));

But i want to transfer 9000 in 1st account and then from 1st Account to another. i had try to transfer using CONNECTED_STRIPE_ACCOUNT_ID1 secret key to transfer in CONNECTED_STRIPE_ACCOUNT_ID2 but got error like no such account available.

individual transfer are working perfect but want it from one account to another.

please Help.

Aaron Fahey
  • 699
  • 1
  • 7
  • 20
Meera Tank
  • 699
  • 5
  • 13

3 Answers3

5

No, you cannot transfer funds from one connected account to another.

What you could do, if you are eligible for it, is to use the separate charges & transfers flow, in which case you would create the charge on your own account (the platform's), then create as many transfers as needed to move funds from your account's balance to each connected account.

Ywain
  • 16,854
  • 4
  • 51
  • 67
3

You can't transfer from connected accounts -

Better way is to take all amount in your main stripe account and then you can transfer from your main account to CONNECTED_STRIPE_ACCOUNT_ID1 and CONNECTED_STRIPE_ACCOUNT_ID2 etc

When you redirect to stripe to connect account - stripe redirect back to your page with "code" value -

App::import('Vendor', 'StripeOAuth/StripeOAuth');
$oauth = new StripeOAuth(YOUR_CLIENT_ID, YOUR_SECRET_KEY);
$access_token = $oauth->getAccessToken($_GET['code']);
$publishable_key = $oauth->getPublishableKey($_GET['code']);
$refresh_token = $oauth->getRefreshToken($_GET['code']); 
$stripe_account_id = $oauth->getUserId($_GET['code']);

This $stripe_account_id is CONNECTED_STRIPE_ACCOUNT_ID1 (Your were using secret key of connected account but instead of that $stripe_account_id will work)

Now you can take all charge on main stripe account and transfer to connected account as you wish -

\Stripe\Stripe::setApiKey(YOUR_SECRET_KEY[![enter image description here][1]][1]);

// Create a Charge:
$charge = \Stripe\Charge::create(array(
  "amount" => 10000,
  "currency" => "usd",
  "source" => "tok_visa",
  "transfer_group" => "{ORDER10}",
));

// Create a Transfer to a connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 7000,
  "currency" => "usd",
  "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));

// Create a second Transfer to another connected account (later):
$transfer = \Stripe\Transfer::create(array(
  "amount" => 2000,
  "currency" => "usd",
  "destination" => "{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}",
  "transfer_group" => "{ORDER10}",
));

Amount flow will work like showing in this diagram

A J
  • 3,970
  • 14
  • 38
  • 53
3

I don't think the selected answer is correct.

You can move funds between accounts.

First the account needs to be express/custom. Then use this snippet to take funds from the account.

stripe.charges.create({
  amount: 1500,
  currency: "usd",
  source: "{{CONNECTED_STRIPE_ACCOUNT_ID}}"
});

Then transfer back to the account you want to send to from your platform.

stripe.transfers.create({
  description: 'Moving funds.',
  amount: 100,
  currency: 'usd',
  destination: StripeAccountIdTo
});

Documentation link

Enjoy.

Sean Patnode
  • 121
  • 1
  • 4