#anthonyl5602
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.
- anthonyl5602, 2 hours ago, 4 messages
- anthonyl5602, 21 hours ago, 21 messages
- anthonyl5602, 22 hours ago, 37 messages
Hi
Can you share a sample request please ?
"Hello, to put it simply, I want to use the API to iterate through each of my clients' accounts (/accounts), retrieve each transfer received in their bank account, and trace back to the initial payment from the customer (/customers). However, to achieve this, it seems I need to go through /payouts, /balance_transactions, then /transfers, and finally /customers. Can you guide me on this? Thank you.
{
"id": "po_1OWC9GR6SjxCk37rN78e0ccB",
"object": "payout",
"amount": 4000,
"arrival_date": 1705276800,
"automatic": true,
"balance_transaction": "txn_1OWC9GR6SjxCk37rNAZarV25",
"created": 1704694642,
"currency": "eur",
"description": "STRIPE PAYOUT",
"destination": "ba_1LQ9FzR6SjxCk37rysCAFit3",
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"livemode": true,
"metadata": {},
"method": "standard",
"original_payout": null,
"reconciliation_status": "completed",
"reversed_by": null,
"source_type": "card",
"statement_descriptor": "Mon Hangar SAS",
"status": "in_transit",
"type": "bank_account"
},
With this (/payout), it is not possible to trace back to the balance_transactions.
Did you have the chance to check this?
https://stripe.com/docs/expand/use-cases#charges-in-payout
Of course. This does not allow and does not help me to start from a bank transfer from a client and go back to the customer who made the purchase of a service...
This does not allow and does not help me to start from a bank transfer from a client and
What you mean by bank transfer here ? payout ?
yes payout
The guide I shared with you, it does start from payouts ?
const balanceTransactions = await stripe.balanceTransactions.list({
payout: 'po_1Gl3ZLLHughnNhxyDrOia0vI',
type: 'charge',
expand: ['data.source'],
});
Actually, I want to send emails to my connected accounts (/account) about the transfers they have received in their bank accounts (/payout) with the dates of the transfer and who sent this money (/customers).
No, it does not start from /payout, and unfortunately, I need /payout to know the approximate date of the money transfer.
No sorry I'm not following you. Once you have the payout id you retrieve the related balance transactions
That's the project I want to undertake.
Hi there ๐ jumping in as my teammate needs to step away soon. That will be an involved flow to build, because you do need to step through the chain of objects you described (based on what you described it sounds like you're using Destination Charges, is that correct?).
Additionally, a Payout is not associated with a single payment typically, so there won't be a 1:1 mapping there. Where are you currently running into problems with building this flow?
Hello ๐ So basically, I can trace back from /charges or /balance_transactions to the /customer who made the payment. The issue is obtaining the /payout from the connected account (/account) to know the date of the payout for this /charge.
Gotcha, you want to do this for all Payouts right? (If you want to do this for a specific one, you would need to already know that ID then unless you're trying to figure out how to hunt down a specific Payout object). If so, you can list all Payouts for a Connected Account using this endpoint and the stripeAccount header:
https://stripe.com/docs/api/payouts/list
https://stripe.com/docs/api/connected-accounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How could I achieve, like the Stripe user interface, to have the payout associated with a payment? Thank you.
Unfortunately, the API does not return the payout...
{
"id": "py_1OD9R3R7ZLF3q7QPItSmhUCg",
"object": "charge",
"amount": 600000,
"amount_captured": 600000,
"amount_refunded": 0,
"application": "ca_JYPRWv2bzsMhAIKVwQs7dHwbGlGoXeMQ",
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_1OD9R3R7ZLF3q7QPIoEwJ2tm",
"billing_details": {
"address": {
"city": null,
"country": null,
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"email": null,
"name": null,
"phone": null
},
"calculated_statement_descriptor": null,
"captured": true,
"created": 1700155981,
"currency": "eur",
"customer": null,
"description": null,
"destination": null,
"dispute": null,
"disputed": false,
"failure_balance_transaction": null,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": true,
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": null,
"paid": true,
"payment_intent": null,
"payment_method": null,
"payment_method_details": {
"stripe_account": {},
"type": "stripe_account"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "hKk",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/py_1OD9R3R7ZLF3q7QPItSmhUCg/refunds"
},
"review": null,
"shipping": null,
"source": {
"id": "acct_1InNeSJnHcficTc3",
"object": "account",
"application_icon": "http",
"application_name": "Mon Hangar"
},
"source_transfer": "tr_1OD9R3JnHcficTc3kRVGtGXX",
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
Where did you get that from? That is not what the endpoint I provided would return.
Okay, why are you getting a charge? Didn't you want Payout IDs, did you try using the List Payouts endpoint I linked above?
I'm trying by any means to go from a /payout or a /charge to reach /transfers....
But I need at least the /payout and the /transfers.
Alright, I'm very lost, it sounds like you want to get all the Payout IDs for your Connected Account, which the List Payouts endpoint is perfect for. Am I misunderstanding something, is that not what you're looking for?
Maybe I speak English poorly, I am French. Perhaps, with luck, if I express myself in French, you will understand better?
Nope, I can only provide support in English.
In fact, I will take an example: This payout: https://dashboard.stripe.com/acct_1M7iYKR6tyshyTo5/transfers/po_1OUOBhR6tyshyTo5Y4JzOq0W, and when you click on the payment: https://dashboard.stripe.com/acct_1M7iYKR6tyshyTo5/payments/py_1OUGxcR6tyshyTo5s707a7Mb, and when you click on the transfer: https://dashboard.stripe.com/connect/transfers/tr_3OUGxaJnHcficTc31l2yC5vu. At a minimum, this is what I want to do with the API for all the /payouts of my clients (/accounts).
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Okay, and what is blocking you currently from doing that via the API?
Well, if I take all the /payouts, I can't go to the transfers, and vice versa. If I take the /transfers, I can't go to the associated payouts...
Sorry for the delay, was juggling multiple threads, focusing on this now, let me double check how to make the association between those two.
no problem ๐
I think I have recalled the first parts of it, let's start there, and then you share what you see and I should be able to give more guidance. I don't think I have a payout resulting from a Transfer handy in my test account, so it'll likely be faster if we can look at the objects from your flow.
So to start breaking down the process:
- Get Payout ID(s) - if you already know this, you can skip this step, if not, this is where I would recommend listing Payouts for your Connected Account
- Get the Balance Transactions that were included in that Payout (important note, only works with automatic payouts, if you're using manual payouts then you'll need to build this flow on your end.)
For this step, you can pass the ID of a Payout into thepayoutparameter when listing Balance Transactions, doing so will only return Balance Transactions that were associated with the specified Payout:
https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
If you can share the ID that you see in the source field for some of those Balance Transactions, that should help point me in the right direction.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.