#dishant_api

1 messages ยท Page 1 of 1 (latest)

stiff yewBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272491602874466405

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

deep aspen
#

๐Ÿ‘‹ happy to help

dusk ferry
#

hi

#

can you help me with this?

deep aspen
#

do you mean you want to retrieve a payout by ID

dusk ferry
#

CanI get the Gross amout from payout objects?

#

I did this API code but I am not getting the gross amount

#

can I get this gross and fees from sumamry?

deep aspen
#

but you don't actually need the data.source expansion

#

because the Balance Transaction will have the information needed

#

const balanceTransactions = await stripe.balanceTransactions.list({
payout: 'po_xxx',
type: 'charge',
});

#

and then you sum the list

dusk ferry
#

Got it, Thanks for the sugegstion

deep aspen
#

let me know if you need any more help

dusk ferry
#

Does this approach contain refunds as well in balance transaction list?

#

If not then how can I get refunds as well?

deep aspen
#

no you would need another call to list all balance transactions of type refund

dusk ferry
#

okay, got it
Thanks

#

that's it for now

dusk ferry
#

Based on payment intent Id can I get the payout Id?

deep aspen
#

it's not that easy

#

the other way around is possible

#

let me think of this for a second

dusk ferry
#

ok

deep aspen
#

ok I found it

#

1st you need to find the balance_transaction of the PI

#

to do so you retrieve the PI by ID and expand on ["latest_charge.balance_transaction"]

#

the balance transaction contains a property called available_on

#

you can then use the List Payouts API to get any Payout by passing arrival_date[gte] set to the available_on from the balance txn

dusk ferry
#

ohhkk
Understood!