3

I'm adding Stripe Connect to my app to send payments to the users,I need to create a payment dashboard where each user can see all the payments that were sent to them( like payment history). I've read here https://stripe.com/docs/api/payouts/create that I can retrieve list of all payouts or individual payout(by submitting payout id), but I can't find information on how to get payout data per user. For example, if I have user John Doe, I want to get all the payout information for John only with 1 API call, is it possible in Stripe Connect?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
alia
  • 168
  • 1
  • 3
  • 15
  • how are you sending payments to the users - are you using direct charges, separate charges and transfers, or destination charges? See https://stripe.com/docs/connect/charges – alex Feb 06 '23 at 01:27

3 Answers3

0

If you want to retrieve the list of payments on the connected account, you should retrieve the list of Charges using the stripeAccount header.

You can also make use of the auto-pagination built into Stripe SDKs to loop through the list.

Example

for await (const charge of stripe.charges.list({stripeAccount: 'connected_account_id'})) {
    // Do something with charge
    console.log(charge);
  }

You may want to reach out to Stripe to check if you're eligible to use this beta where you can embed a payments dashboard component into your site : https://stripe.com/docs/connect/get-started-connect-embedded-uis

alex
  • 1,923
  • 11
  • 9
0

You can get payout data for a stripe connect account using:

const stripe = require('stripe')('API_KEY');

const payouts = await stripe.payouts.list({
  limit: 10,
}, { stripeAccount: 'Connect Account Id' });
Bello Damilola
  • 311
  • 3
  • 5
-1

If I understand goodly your question, you want to retrieve connected accounts' payouts.

You have to know that payout api using is when you move money on your account. In the other hand, if you want to move money to any connected account you need to use transfert api.

Code

You need to know user connect account

const stripe = require('stripe')('API_KEY');

const transfers = await stripe.transfers.list({
  destination: 'acct_id.....',
});
Quintoche
  • 42
  • 5
  • thank you for answer, but I need to retreive payout information for 1 connected account only, not all the connected accounts. – alia Feb 04 '23 at 18:30
  • @alia With this code, by putting the connected account id as destination parameter, you'll be able to retrieve all payout information of this connected account. – Quintoche Feb 05 '23 at 13:09