#dgsunesen
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- dgsunesen, 3 days ago, 13 messages
Thing is
On our platform, suppliers completes different task. For each task I'm able to tell which transfer they belong to. However, I'd also like to show when they can expect their payout to happen. And it seems that a payout can consist of more payments/transfers, so I'd like to be able to retrieve the estimated arrival of the payout (per transfer/payment)
Um that would go from the Payout (if you use Automatic Payout)
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Take this payout for instance:
https://dashboard.stripe.com/acct_1Jr0zGRIUZMV8wVM/test/payouts/po_1KyQdQRIUZMV8wVMwbi1YN4p
It's actually two tasks that got completed which would result in one payout
the end user would see each task they completed, and for each task I'd like to show the expected payout ๐
Hey! Taking over for my colleague. Let me catch up.
As the docs suggest, you can query the Balance Transactions based on payout: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
And find the Charge ID in source https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source
const payouts = await stripe.balanceTransactions.list(
{
type: 'payout',
expand: ['data.source'],
},
{
stripeAccount: '[account id here]',
}
);
would I be able to get the charge id then ?
for that specific payout that I sent you a link on I get this on the source
payout { id: 'po_1KyQdQRIUZMV8wVMwbi1YN4p', object: 'payout', amount: 414000, arrival_date: 1652313600, automatic: true, balance_transaction: 'txn_1KyQdRRIUZMV8wVM5EA4IVPT', created: 1652318168, currency: 'dkk', description: 'STRIPE PAYOUT', destination: 'ba_1Jr145RIUZMV8wVM9CQUp0eK', failure_balance_transaction: null, failure_code: null, failure_message: null, livemode: false, metadata: {}, method: 'standard', original_payout: null, reconciliation_status: 'completed', reversed_by: null, source_type: 'card', statement_descriptor: 'Shouter', status: 'paid', type: 'bank_account' }
Could you try this please?
const payouts = await stripe.balanceTransactions.list(
{
type: 'payout',
expand: ['data.source'],
},
{
stripeAccount: '[account id here]',
}
);
Give mes an arary of
{ id: 'txn_1ONmHYRIUZMV8wVMFMw0RGrW', object: 'balance_transaction', amount: -75000, available_on: 1703116800, created: 1702688587, currency: 'dkk', description: 'STRIPE PAYOUT', exchange_rate: null, fee: 0, fee_details: [], net: -75000, reporting_category: 'payout', source: { id: 'po_1ONmHXRIUZMV8wVMAIoC3rnE', object: 'payout', amount: 75000, arrival_date: 1702857600, automatic: true, balance_transaction: 'txn_1ONmHYRIUZMV8wVMFMw0RGrW', created: 1702688587, currency: 'dkk', description: 'STRIPE PAYOUT', destination: 'ba_1Jr145RIUZMV8wVM9CQUp0eK', failure_balance_transaction: null, failure_code: null, failure_message: null, livemode: false, metadata: {}, method: 'standard', original_payout: null, reconciliation_status: 'completed', reversed_by: null, source_type: 'card', statement_descriptor: 'Shouter', status: 'paid', type: 'bank_account' }, status: 'pending', type: 'payout' },
Oh, but that's not what I suggested. If you look at the docs carefully, you will see that the parameter you should use is payout, not type: 'payout'.
okay, I see
I just tried,
this is the result when I call it for a specific payout
Here you got the 2 Charges that went into the Payout
const payouts = await stripe.balanceTransactions.list(
{
type: 'payout',
expand: ['data.source'],
},
{
stripeAccount: 'acct_1Jr0zGRIUZMV8wVM',
}
);
I cannot somehow expand this to show me the charges that went into each payout?
I need to call the balanceTransactions.list per payout ?
That's not the right code, again.
Yes, you will have to call it per Payout.
but I would need to get the list of payouts first to get the ids for each payout ๐
You can directly list Payouts: https://stripe.com/docs/api/payouts/list
Yeah, and then I would call balanceTransactions for each of those to se if they have more than one charge attached