Hi, I'm building a platform for clients using the Stripe PHP API that sells subscriptions on a monthly basis to license content. I have an agreement with my clients to share 50% of the fee charged for each subscription.
I used the following code snippet to create the subscription:
$stripe->subscriptions->create([ 'customer' => '{{CUSTOMER}}', 'items' => [['price' => '{{PRICE}}']], 'expand' => ['latest_invoice.payment_intent'], 'application_fee_percent' => 10, 'transfer_data' => ['destination' => '{{CONNECTED_STRIPE_ACCOUNT_ID}}'], ]);
I would like to know how to automatically transfer half of my 10% to another connected account (my account)...can anyone help me?
Given a subscription on the platform, you can transfer funds to multiple connected accounts after charging .
Alternatively, you can keep the same code you shared here and transfer 5% of the app fee separately to another connected account . You will listen to the
invoice.paid
event and when creating the transfer, pass thesource_transaction
parameter which transfers funds from a charge . These funds will not be available until the original charge is settled.