#stenml
1 messages · Page 1 of 1 (latest)
there's no specific reason, it's just a historical quirk.
mostly any 'payment' that is no a direct card charge is py_xxx and object:payment while charges on cards are ch_xxx and object:charge; and then those have PaymentRefund pyr_xxx and Refund re_xxx . The same API (v1/refunds) is used.
We are persisting refunds in our database and would like to tie them to refunds found in balance transactions for a payout, but since from creating the refund we always get re_... id for refund and in balance transaction it's pyr_... how can we know then it's the same refund?
just add the original re_... id as metadata?
curious if reading https://discord.com/channels/841573134531821608/1113055582639902792 would help
but in any case the pyr_xxx is the effect of reversing the transfer when refunding the Destination charge on the platform
That is actually my teammate:d
so when coming from the connected account, you need to look at https://stripe.com/docs/api/refunds/object#refund_object-transfer_reversal on the pyr_xxx object to get to the transfer reversal, and from there to https://stripe.com/docs/api/transfer_reversals/object#transfer_reversal_object-source_refund I think
recon of destination charges can be a little involved
alright, i will try to dig into it
so as I understand correctly, when we are initiating a refund with an SDK call, then refund is created from the POV of the platform account, hence the id that starts with re_... but when looking at the same refund from POV of connected account, it's a reversal with id pyr... ?
when you do the refund it creates multiple things
consider this image, which is the objects involved in a Destination Charge
when you refund the PaymentIntent on the platform, that creates a re_xxx for refunding the Charge ch_0001. If you pass reverse_transfer, you are also creating a TransferReversal trr_xxx to reverse tr_001 . That also creates a pyr_xxx refund of the py_001 (the money the connected account received, which is the money that is getting reverse-transferred, which is modelled as a 'refund' of that 'payment' and leads to the BT you interact with)
as I said it's pretty complicated unfortunately, it makes sense if you spend long enough digging into examples
I see, when we are retrieving balance transactions for payouts, the source_refund is null, I assume it's because of the fact, that we are using stripe-account option with connected account id, which gets the data from POV of connect account, so there is no way for connected account to see the original re_... refund, rather we should just make a request as a platform account to see it?
the way it's supposed to work is you can see the ID even if the ID exist on the platform so I don't think it's that