#themechanic_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1283431365278306304
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- themechanic_api, 3 hours ago, 17 messages
- themechanic_api, 6 hours ago, 13 messages
- themechanic_api, 22 hours ago, 12 messages
Hello
Can you share the example response? We can't see what's being returned in a GET request ๐
Thank you for that, it looks like you are doing our destination charge flow, where the PaymentIntents live on your platform account, but you are listing these refunds on the connected account which means that these refund objects are only directly related to the Charge objects that represent the payment on that account.
That being said, I think if you can get to the PI through expansion though I am not 100% sure. The source_transfer_reversal field on those objects refers to an object that is on your platform account. I think if you expand that object and some of its fields you can get to an object that knows about the payment intent
oh i see
just to understand, the refunds ar initiated from account connect, but the payment_intent itself on our main account, and that is the issue ?
{
"id": "pyr_1PoR1W2ElmJlZA7ZrfcwoOrK",
"object": "refund",
"amount": 1499,
"balance_transaction": "txn_1PoR1W2ElmJlZA7Zzwt2ujoK",
"charge": "py_1PoR1I2ElmJlZA7ZFlC3PyzT",
"created": 1723818062,
"currency": "eur",
"metadata": {},
"payment_intent": null,
"reason": null,
"receipt_number": null,
"source_transfer_reversal": {
"id": "trr_1PoR1WFq1BiPgN2K3FXiAkSN",
"object": "transfer_reversal",
"amount": 1499,
"balance_transaction": "txn_1PoR1WFq1BiPgN2Kb9xQbkm7",
"created": 1723818062,
"currency": "eur",
"destination_payment_refund": "pyr_1PoR1W2ElmJlZA7ZrfcwoOrK",
"metadata": {},
"source_refund": "re_3PoR0fFq1BiPgN2K00GEXOwZ",
"transfer": "tr_3PoR0fFq1BiPgN2K0qwTHhB1"
},
"status": "succeeded",
"transfer_reversal": "trr_1PoR1WFq1BiPgN2K3FXiAkSN"
},
expanding i get this, do you know what i can expand/request after ?
Still clicking around in docs to figure out what field to expand. It is going to be relatively straightforward and obvious, I think I just need more coffee today. I think source_transfer_reversal.transfer.source_transaction may do it, the transfer on that reversal should be the one from your platform to your connected account and source_transaction would be the charge that that transfer was made off of, so that should have a payment intent field
I think you should even be able to do source_transfer_reversal.transfer.source_transaction.payment_intent and get the whole payment intent object
I just did what you and I get a payment_intent ! hope it's the right one, if it's the case it' perfect
said*
Nice!
just to understand, the refunds ar initiated from account connect, but the payment_intent itself on our main account, and that is the issue ?
Exactly. With destination charges you create a payment intent object (pi_123), when that intent succeeds it creates a Charge object on your account (ch_456) and then we automatically make a transfer off of that charge (tr_789) which finally creates a Charge object on your connected account (py_abc). You are listing refunds on the connected account, so you are seeing refunds on thosepy_abcobjects at the end there.