#mancharface - connect balance transactions
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
No, not exactly, you would only be able to approximate this using the payment dates/available balance dates
alternatively, work from the other side: track all payments that get created/completed, and set up webhook handling for payouts too
then when a new payout is created, you can "check off" those payments included, and the payments you have left without a known payout are what you're looking for
https://stripe.com/docs/expand/use-cases#charges-in-payout
payout.createdevents
Okay, thanks for that. Another thing we'd been considering is getting the balance transaction id of the most recent payout to the connected account, then listing all BalanceTransaction objects starting_after the ID of the most recent payout. But that would require all balance transaction objects to stay in a strict order of when they were created. We plan to test this theory, but any idea if that's the case?
Yes, that order is fixed and most recent is first
The transactions are returned in sorted order, with the most recent transactions appearing first.
https://stripe.com/docs/api/balance_transactions/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay, cool. I guess the other consideration is that when a payout is created and a balance transaction object created, it would need to include as part of the payout all balance transaction objects that were before the timestamp of the payout object and after the timestamp of the prior payout object (aka everything still in the connected account's available balance). That's something else we can test too.
Bear in might the BT might be created for a payment but the balance wont be available until later, so manipulating the order like this is likely to be difficult. I'd suggest something more explicit like tracking the ids accounts for in known payouts vs not, as I described, but you are free to explore other options that get what you need!
Oh right. That's a great thought. Thank you. We'll keep exploring our options. Really appreciate your help! If you all take feature requests, that one would be helpful for us, recognizing maybe it's a niche case. Getting all BT objects not yet paid out would be awesome.
Again, thank you! Have a great day.