#themechanic_api

1 messages ยท Page 1 of 1 (latest)

leaden eagleBOT
#

๐Ÿ‘‹ 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.

warm mirage
#

Hello
Can you share the example response? We can't see what's being returned in a GET request ๐Ÿ™‚

exotic jewel
#

yes !

#

here is test env, but i got the same on real account in prod

past knot
#

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

exotic jewel
#

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 ?

past knot
#

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

exotic jewel
#

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*

past knot
#

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 those py_abc objects at the end there.

exotic jewel
#

ok i understand

#

thanks for your help, very helpful