#vitali han - payouts to PI
1 messages · Page 1 of 1 (latest)
🙏
You can retrieve a PaymentIntent and get the associated charge: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-charges-object. Then, you can get the balance transaction of the charge: https://stripe.com/docs/api/charges/object#charge_object-balance_transaction. And retrieve it: https://stripe.com/docs/api/balance_transactions/retrieve. From there, you can get it's available on date: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-available_on and list payouts by that date: https://stripe.com/docs/api/payouts/list
So there's not a straightforward way to do this unfortunately but you can use the above
holy hell
hi im still not able to connect the payout and the balance transaction
you said i can do it by date? i have the available_on
@hollow charm you are doing it backwards
you can not go from the Charge to the Payout, this is too complex. You have to go from the Payout back to the Charge instead.
So list all Payouts, for each Payout list whats in it, and then store that in your database
https://stripe.com/docs/api/balance_transactions/list + payout: 'po_123' gives you all the BalanceTransactions bundled in each Payout
yeah i initially thought itll be easier seeing as that data is present on the payment page
is there any other field that can just tell me if it was paid out or not? based on the paymentIntent
there is not
Sure!
1 more question, do the payouts hold a list of all the transactions? or do i need to bundle them together myself?
Assuming you use automatic payouts, which is the default, then they bundle all transactions for a given day into them so they bundle those and that's why you have to use https://stripe.com/docs/api/balance_transactions/list + payout: 'po_123' to list everything in it
and if im using manual?
then all of that is impossible in that case but you'd never get the screenshot you shared earlier
so what do i do in that case? i have my customers default to manual and after 2 weeks if all is ok we put them on automatic
that's not the same thing though.
If you don't create any payout for 2 weeks then the first payout is still automatic and will contain all the transactions for the past 2 weeks so it still works exactly like I said!
but i do make manual payouts
and then switch to automatic
we are pretty new to stripe but thats our use case
ah if you make manual payouts in the middle then it's just impossible. We can't know what is bundled in your manual payouts since you decide/control this
the only option is for you to track this in your own database really
manual payouts will be in the payouts list right?
yes, but they will just be for an amount you choose, they won't "bundle" any specific transaction
oh
and automatic ones will?
https://stripe.com/docs/api/balance_transactions/list +po_ manual <- wont work
but if its automatic it will
thats my take away?
correct!