#deepak_payouts-balance-transactions

1 messages ยท Page 1 of 1 (latest)

uncut impBOT
#

๐Ÿ‘‹ 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/1236012013113704529

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

weak orchid
waxen gazelle
#

I want to sum of them?

#

Is that possible?

#

Like total Payout in last 30 days

weak orchid
#

You would need to do that on your end.

waxen gazelle
#

oh okay

weak orchid
#

You can use the List API to get all paid payouts for the past 30 days using the status and arrival_date filters

#

Same with status pending

#

Then sum them

#
available_payouts = stripe.Payouts.list(status='paid')
 paid_total = sum([payout.amount for payout in available_payouts])
waxen gazelle
#

Awesome!

weak orchid
#

Happy to help ๐Ÿ™‚

waxen gazelle
#

message
:
"Received unknown parameter: status"

#

$paidlist = \Stripe\BalanceTransaction::all(['limit' => 100, 'status'=> 'paid', 'type' => 'charge'], ['stripe_account' => $account_token]);

weak orchid
#

That's Balance transaction

#

I showed you the Payout APIs

waxen gazelle
#

ohh

#

so do I need to use payout one

weak orchid
#

Well I thought you wanted to get payouts, so I pointed you to the payouts API

waxen gazelle
#

Yeah I see

weak orchid
#

Balance Transactions make sense too if that's what you want. But we don't expose the status property in the List API filters.

#

In that case, you could get all the balance transfers for the past 30 days and sort them into separate lists depending on the status property

#

Then total the amount s for each list

waxen gazelle
#

Sounds good

quiet havenBOT