1
votes

How can I transfer money from one stripe account to another stripe account ?
I am following this code from here:

\Stripe\Stripe::setApiKey(PLATFORM_SECRET_KEY);
\Stripe\Transfer::create(array(
  'amount' => 1000,
  'currency' => "hkd",
  'destination' => {CONNECTED_STRIPE_ACCOUNT_ID}
));

But getting this error:

Type: Stripe\Error\InvalidRequest

Message: Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number. You can use the the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com /docs/api#balance).

But in my test account from where I have to transfer there is around $3000 and still I am getting the above error.

see this: test-account-balance

2

2 Answers

2
votes

This happens with me also. My mistake was I was using live secret key. you can check

  1. You are using test connected Account Id (You have to connect the customer in test mode also. Live and Test connected Ids are different).
  2. You are using Test secret key for the testing.
  3. Create one customer with card no. 4000 0000 0000 0077 and charge it. Using this balance you can transfer amount to another account.
2
votes

Generally, you can only transfer funds from a platform's account to one of its connected accounts (not the other way around).

When accepting payments on behalf of a connected account, you need to create the charge, either directly on the connected account (using the Stripe-Account header) or through the platform (using the destination parameter). In both cases, you'd use the application_fee parameter to (optionally) take your cut out of the transaction.

If you want to transfer funds outside of a charge, this is known as a special-case transfer. As the name implies, these transfers should only be used in certain specific scenarios and are subject to some constraints -- most importantly, the volume of special-case transfers must stay under 10% of the overall volume processed by your platform.

In order to transfer funds, the funds must be available. Generally, when you accept a charge, the funds from the charge are initially "pending". After a delay (which varies by country and by account), they become "available" and can be transferred.

In test mode, you can create charges with the special testing number 4000 0000 0000 0077 so that funds become immediately available. This way you don't have to wait to test transfers.

You can check the status of both parts of your account's balance ("pending" and "available") with the "retrieve balance" API call.