#milan_90064

1 messages · Page 1 of 1 (latest)

primal nymphBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

celest robin
#

Good question. Looking in to this and will get back to you

charred lily
#

var options = new BalanceTransactionListOptions
{
Payout = payout.Id,
Type = "payment",
Limit = 100,
StartingAfter = lastBalanceTransactionId
};
options.AddExpand("data.source.source_transfer.source_transaction");

balanceTransactions = await balanceTransactionService.ListAsync(
options,
requestOptions: new RequestOptions
{
StripeAccount = connectedAccountId
});

#

On the first call, the lastBalanceTransactionId is null

#

Ah...type??

#

So in a payout, I want charges that failed (ACH returns), payments, refunds, and chargebacks. Should I just set that to null then?

celest robin
#

I think so, can you try again without specifying type and see if that shows the refunds as well?

charred lily
#

Will do

charred lily
#

That works. Now I have a pyr Id. But now I have to walk from the Id I receive from that call to the pyr Id I saved when initiating the refund (or should I save a different Id). I basically need to mark the record in our database has having been paid out. Walking across the records in Stripe is always confusing for me.

celest robin
#

Gotcha, not immediately sure how to do that but am looking in to it. Do you have an example pair of pyr IDs? It could be helpful to have them as reference

charred lily
#

Sure. The Id we received at the time of refund is pyr_1OGyevDFt6iTMCHHJoMu6TYr

#

The source Id on the balance transaction we pull from the payout is pyr_1OGyewRkwbEjpKMggiChJFT1

celest robin
#

Thank you, checking in to those

charred lily
#

I think this is the full payload from the initial refund.

{

"id": "pyr_1OGyevDFt6iTMCHHJoMu6TYr",

"object": "refund",

"amount": 5120,

"balance_transaction": "txn_1OGyewDFt6iTMCHHlHlTJUjw",

"charge": "py_3OF7WSDFt6iTMCHH1vYGKqUs",

"created": 1701067869,

"currency": "usd",

"metadata": {

},

"payment_intent": "pi_3OF7WSDFt6iTMCHH1K2zc5tR",

"reason": null,

"receipt_number": null,

"source_transfer_reversal": null,

"status": "pending",

"transfer_reversal": "trr_1OGyewDFt6iTMCHHWRwmpji6"

}

celest robin
#

Thank you, the server has been a bit busy so I haven't gotten much of a chance to look in to this. I am consulting a colleague and will get back to you with what we can find

celest robin
#

Apologies for the delay. You can link these two via the transfer_reversal property on the platform account's refund object. It is trr_1OGyewDFt6iTMCHHWRwmpji6 here

#

If you expand or retrieve that object there will be source_refund and destination_payment_refund properties that map to objects on the connected account. destination_payment_refund specifically should show you the refund object on the connected account

charred lily
#

Interesting. So that's walking from the refund object to the payout. But that means that I'll be storing the transfer reversal Id at the time of refund instead of the Id (pyr_), is that right? What does a pyr an abbreviation for, by the way? When I see that, is that a transfer or a charge or a ...?

celest robin
#

"payment refund"

charred lily
#

Is that a transfer or a charge?

#

Or I guess it's a payment?

#

In other words, if I want to pull the details of a pyr, which API endpoint do I use for that?

primal nymphBOT
celest robin
#

Can you try retrieving it with the refunds endpoint? My understanding is that it is a refund object. I can look further if that doesn't work

charred lily
#

That worked! Thank you