In stripe how to transfer fund from connect account to admin account?

727 Views Asked by At

I want to create Escrow feature using Stripe payment gateway. And for this I've 3 connected account.

a) A connected account which has payment method added it and this account is making the payment.

b) A connected account without any specified payment method in it (escrow amount will be held in this account)

c) A connected account with a payment method added to it (escrow amount will be released to this account)

I tried two different ways to achieve this.

  1. I am creating one payment intent from the first connected account to the platform account balance and then creating another payment intent from the platform account to the second connected account(escrow) and then creating another payment intent to transfer fund from the second connected account to third connected account. This flow partially works. But I've two issues. Firstly when creating payment intent from first connected account to platform mail account, it takes around 5-7 days to make the amount available, then only I can transfer the amount to the second connected account as escrow. But I need this process instantly. Secondly I can't transfer amount from second connected account to the third connected account using payment intent (May be because the second connected account don't have payment gateway added to it).

  2. I tried the same flow with charge api instead of payment intent. In that case while transferring amount from first connected account to platform main account using charge api the amount is deducted from the connect account, but it goes to the "Held in reserve" balance, though there is no negative balance in the connect account. How can I transfer the amount from connect account to the platform's active balance?

    const createPaymentIntent = await stripe.paymentIntents.create({
            amount: 6500,
            currency: 'usd',
            payment_method_types: ['card'],
            customer: sourceCustomerId,
            payment_method: sourcePaymentMethod,
            on_behalf_of: destinationAccount,
            transfer_data: {
                destination: destinationAccount,
              },
        });

        const paymentIntent = await stripe.paymentIntents.confirm(
            createPaymentIntent.id,
            { payment_method: 'pm_card_visa' }
        );

        const charge = await stripe.charges.create({
            amount: 9500,
            currency: 'usd',
            source: destinationAccount,
            description: 'My First Test Charge',
          });
1

There are 1 best solutions below

0
On

When using Express or Custom accounts, the platform is ultimately responsible for negative balance on the Connected accounts. So if you try to debit an Express or Custom account and that account has no available balance, then:

  • The connected account's balance will go negative
  • The platform account will have a reserve to offset the negative balance

If you want to have the funds in your platform account, then you should either make sure the connected account has enough available balance for the charge, or get funds by directly using application_fee_amount when creating the PaymentIntent (instead of creating a Charge).