#EdwinZ
1 messages · Page 1 of 1 (latest)
Hello! You can retreive detailed balance information using the Balance API: https://stripe.com/docs/api/balance
The context for this is I will have the charges and will need to know the values of these given a specific charge. Will that then be the balance transaction endpoint? The balance endpoint doesn't appear to accept any parameters.
Yeah, Balance Transactions show you the specific granular details of money movement into and out of your Stripe balance.
You may also be interested in this approach to see which Charges are included in a Payout: https://stripe.com/docs/expand/use-cases#charges-in-payout
Would it be correct to say that it is based off of the status? For example, if the status were "available", then the amount would show under "Available to pay out". If the status is "pending", it would show under "available soon"?
What I'm getting at is I need to recreate that Stripe screen outside of stripe.
Essentially yes, that's correct. You won't be able to make an exact recreation of those values though. The way the Dashboard calculates those numbers is slightly different from the way the API calculates balances, so while the numbers will often be the same they may be slightly off in some cases.
Thank you for that info. Can you expand upon scenarios where they may not be the same? How would I know if it is "In transit to bank"?
I honestly don't know all of the details and nuance myself. Why do you need to reproduce this information outside of Stripe?
Our agents are currently using that information to know if they should use reverse_transfer during a refund. We are creating a return process in Salesforce, the goal being for our agents to not have to bounce between systems.
Gotcha. For the "in transit to bank" part you would need to look at the Payout and see if its status is in_transit or not, and you can also look at the arrival_date: https://stripe.com/docs/api/payouts/object
Thank you!
One more question for you, how would I go about getting a payout Id if I have the charge Id?
Each Charge has a balance_transaction: https://stripe.com/docs/api/charges/object#charge_object-balance_transaction
That Balance Transaction has an available_on date: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-available_on
Usually that will be paid out the same day (for automatic payouts) so you can list Payouts created around the same time: https://stripe.com/docs/api/payouts/list#list_payouts-created
However, it's usually better to keep track of this on your end by listening for payout.created Events, checking which Charges are in each one as they happen, and storing that information in your database.
We were hoping to avoid storing this in Salesforce and only retrieving on an as needed basis, we have a very high volume, and these refunds will only be a very small subset so most of those events to be stored would be unnecessary.
Just to verify, I will need to get the payouts and then match those with the balance transaction, there is no other way to query a specific payout for a charge?
Correct.
Cool. Thank you for all of your help, have a great weekend!