#milan_90064
1 messages · Page 1 of 1 (latest)
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.
- milan_90064, 5 days ago, 38 messages
- milan_90064, 6 days ago, 10 messages
Good question. Looking in to this and will get back to you
Can you show me the code of the request that you are using to retrive the balance transactions on the payout? Is it just a list call while using the payout filter? https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
I think so, can you try again without specifying type and see if that shows the refunds as well?
Will do
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.
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
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
Thank you, checking in to those
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"
}
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
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
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 ...?
"payment refund"
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?
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
That worked! Thank you