0
votes

How to set commission for Buyer & Seller both using stripe connect. I am using https://stripe.com/docs/connect/charges-transfers. we want to hold money on our stripe account until job completed by seller. The amount is submitted by client(buyer) to out stripe platform .then, on job completing, it would be transferred to seller stripe account. (how to set commission for both while creating charge by the client(buyer) to our stripe platform account )?

input : Only pass application_fee without accountId

let chargeEntity = await stripe.charges.create({
amount,
//description: "Sample Charge",
source: sourceTokenId,
currency: currency,
customer: customerId,
application_fee_amount:application_fee,
//on_behalf_of:accountId
});

output :

"message": "Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter)."
1

1 Answers

0
votes

If you're using separate charges and transfers, there's no ability to pass an application fee.

Instead, simply withhold the funds you'd like to keep on your platform when you create the transfer, calling stripe.transfers.create. For example, if you created a charge for $100, only transfer $90, your platform retains $10 (minus any Stripe fees on the original $100 charge).

If you would rather use application_fee_amount, look at the destination payment flow; you could create the charge with destination but pass capture: false and then capture funds once work is completed. https://stripe.com/docs/connect/destination-charges#application-fee