#marcial_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/1240324510217932840
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you send me the ID of the object that you are looking at? If the object exists on a connected account, you will need the connected account's ID to retrieve it. I can help find the ID of the connected account if you don't have it, but in future you will want to make sure you record both for connected account objects that you want to retrieve
Here is one example id of a connected account: acct_1ON0w7QSJTPNGn5h under Regpack.
What info are you trying to retrieve? Is there another object you are trying to look at?
-
We are getting the payout id
For example: po_1PDyv3RTLXEYNyXOfhOwseq4 -
We are doing the following call in order to create a reconciliation report:
$stripe_class->reporting->reportRuns->create($report_data);
$report_data=array(
"report_type"=>"connected_account_payout_reconciliation.by_id.itemized.1",
"parameters"=>array(
"connected_account"=>$this->connected_test_acct,
"payout"=>$report_id
)
);
The $report_id is: po_1PDyv3RTLXEYNyXOfhOwseq4
The $this->connected_test_acct is: acct_1MJayLRTLXEYNyXO
- This will return that the report is pending to be created.
We have an automated system that checks for the status every hour.
We use this:
$stripe_class->reporting->reportRuns->retrieve($csv_report_id);
$csv_report_id is the id given in the initial create object.
-
Eventually the report is created and this is the object we get:
"id": "frr_1PFu2RIEdAIpL3cenQQfAECh",
"object": "reporting.report_run",
"created": NumberLong(1715588115),
"error": null,
"livemode": false,
"parameters": {
"connected_account": "acct_1MJayLRTLXEYNyXO",
"payout": "po_1PDyv3RTLXEYNyXOfhOwseq4"
},
"report_type": "connected_account_payout_reconciliation.by_id.itemized.4",
"result": {
"id": "file_1PFvQ5IEdAIpL3ceh7FdiHLj",
"object": "file",
"created": NumberLong(1715593425),
"expires_at": NumberLong(1747129425),
"filename": "frr_1PFu2RIEdAIpL3cenQQfAECh.csv",
"links": {
"object": "list",
"data": [], "has_more": false, "url": "\/v1\/file_links?file=file_1PFvQ5IEdAIpL3ceh7FdiHLj"},
"purpose": "finance_report_run",
"size": NumberLong(565),
"title": "FinanceReportRun frr_1PFu2RIEdAIpL3cenQQfAECh",
"type": "csv",
"url": "https://files.stripe.com/v1/files/file_1PFvQ5IEdAIpL3ceh7FdiHLj/contents"
},
"status": "succeeded",
"succeeded_at": NumberLong(1715593425)
}, -
We take the url and do a CURL call with the credentials to get the file
This is the url: "https://files.stripe.com/v1/files/file_1PFvQ5IEdAIpL3ceh7FdiHLj/contents -
Now we have the file.
All this is already implemented and working. -
This is the part we want to do that we do not understand how to do:
understand which payment intent of the connected account the items on the reconciliation report are connected to.
Basically we want to go from the unique ids such as:
txn_1PC0j3RTLXEYNyXO6HKXA7Jj
py_1PC0j2RTLXEYNyXO5AhwTPDu
I have a video explanation if it helps as well: https://www.loom.com/share/c84dab1213c347668f54d19f33b1fd19?utm_medium=gif
To be clear, go from IDs such as txn_1PC0j3RTLXEYNyXO6HKXA7Jj and py_1PC0j2RTLXEYNyXO5AhwTPDu to what?
Like given those IDs, what exactly are you trying to find?
If you are looking to get the payments in the a payout via the API, you can make this call but as the connected account https://docs.stripe.com/expand/use-cases#charges-in-payout
We are trying to find the payment intent related to those connected accounts
Hello! I'm taking over and catching up...
Hi and thank you
Okay, so you want to go from txn_1PC0j3RTLXEYNyXO6HKXA7Jj to the associated Payment Intent?
Yup, the payment intent object
First look at the source for that Balance Transaction: https://docs.stripe.com/api/balance_transactions/object#balance_transaction_object-source
In this case that's going to be a payment coming from your platform and going to the connected account.
That payment is a Charge object which will have a source_transfer property that points to the Transfer object on your platform account: https://docs.stripe.com/api/charges/object#charge_object-source_transfer
You can then look at the Transfer's source_transaction to see what created it: https://docs.stripe.com/api/transfers/object#transfer_object-source_transaction
In this case it's a Charge on your platform account. You can look at that Charge's payment_intent property to get the Payment Intent: https://docs.stripe.com/api/charges/object#charge_object-payment_intent
Got it, reviewing that now
Awesome, thank you for your help