#Ishan-connect
1 messages ยท Page 1 of 1 (latest)
My custom connected account's payout interval is set to 'daily'. Suppose, I create two 'Transfer' objects and transfer some amount from platform's stripe balance to the connected account's stripe balance. So, two 'transfer.created' events will get generated. Now, when stripe will payout this amount to the connected account's bank account, will two 'payout.created' and 'payout.paid' webhooks trigger ? And is there any key in the 'transfer.created' event's payload and 'payout.created' and 'payout.paid' webhooks's payloads which is common. I need to know when a particular transferred amount was actually paid out to the bank.
thanks, reading/thinking..
For the first question, my configured webhook endpoint was called for 'balance.available' event.
But for 'transfer.created' event, my configured webhook endpoint was not called.
I can see the 'transfer.created' webhook event in platform's events section, but my configured webhook endpoint was not called. Can someone please tell why the endpoint was not called ?
because Transfer objects live on your platform account. So only non-Connect endpoints get called
Now, when stripe will payout this amount to the connected account's bank account, will two 'payout.created' and 'payout.paid' webhooks trigger ?
no. We bundle all payments together and pay them out daily, there's one payout object(and one set ofpayout.createdandpayout.paidevents on the connected account). https://stripe.com/docs/expand/use-cases#charges-in-payout talks about how you can reconcile the payout with the bundled transactions.
Sorry, I didn't get the meaning of your response to the first question. Can you please explain it more ?
sure
if you tick that box you get events about API objects that are on the connected account, like objects that are created there on those accounts
the Transfer object is not one of those , that is created on your platform account, so it doesn't go to that type of endpoint, it would go a regular 'non-Connect' endpoint on your account.
the way it works is that the Transfer object tr_xxx lives on the platform account, and then a Payment py_xxx object is created on the connected account that represents the funds from the transfer arriving there.
So, basically, if I check that checkbox, my webhook endpoint will get called for connected account related events only, right ?
it will get called for events relating to API objects that are created on those accounts
this diagram isn't perfect but .e.g
you can see the Transfer object 'lives' on the platform account. So events go to your non-Connect endpoint instead
We will retry for up to three days with exponential backoff https://stripe.com/docs/webhooks/best-practices#events-and-retries
Ok. I will go through the 2 links thoroughly and will get back to Stripe if I have any more doubts. Thanks.
Hi
Using this link, how can I know which transferred amount was successfully paid out ?
Not just successful payout, I want to know all payout life-cycle.
Catching up on this thread. Can you clarify what you mean by "which transfered amount"? So you are transferring from platform to connected account and then want to know if that the funds from that transfer are part of a given payout?
Your understanding is correct. If I create 2 'Transfer' objects and transfer some amount from platform's stripe balance to the connected account's stripe balance, I want to know whether those 2 amounts are a part of the payout.
Can I get transfer id from 'payout.*' webhooks ?
Good question. Looking in to how to check this.
Apologies for the delay, still looking in to this. I think the method you linked to should still work but I am confirming
So yes, you should still be able to and connect it via the balance_transactions on the transfers that you created https://stripe.com/docs/api/transfers/object#transfer_object-balance_transaction
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry, I am not getting the meaning of your sentence. Can you please explain more ?
Oh you can actually do this even more easily than in that doc
So you can list the balance transactions for the payout:
payout: 'po_1Gl3ZLLHughnNhxyDrOia0vI',
type: 'transfer'
});```
And they will tell you what transfers were a part of that payout
When you create the transfer, the transfer object will have a balance_transaction property https://stripe.com/docs/api/transfers/object#transfer_object-balance_transaction
So you can:
- Retrieve the transfers you are interested in, look at their
balance_transactionproperties - List the BalanceTransactions for the Payout you are interested in
- Check if the IDs from step 1 are present in the list from step 2
I used the highlighted payout id for a curl request. I am getting the following response :
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such payout: 'po_1Jtu1GQacp6n1mnZZ8MdpAG0'",
"param": "payout",
"type": "invalid_request_error"
}
Did you make the request as their account? 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.
No, I didn't. I was not aware of this.
{
"object": "list",
"data": [
],
"has_more": false,
"url": "/v1/balance_transactions"
}
I am getting this response. Nothing is there in this response.
curl https://api.stripe.com/v1/balance_transactions \
-H "Stripe-Account: acct_1Jr4HRQdKAMzg6Yl"
-d payout=po_1Jt0KRQdKAMzg6YltC3CLUyC
-d type=transfer
-G
This is my curl request. I have removed secret key part.
But it's there while requesting.
Hey there ๐ please bear with me a moment while I get caught up on this thread.
Sure.
Are you using automatic payouts, or manual?
Automatic
Gotcha, I'm going to take a closer look at the objects, please bear with me
Ok
Can you provide the raw response of the cURL request? (redacting anything that shouldn't be shared)
I have sent it. Check above in the chat.
{
"object": "list",
"data": [
],
"has_more": false,
"url": "/v1/balance_transactions"
}
Sharing again.
Apologies, didn't scroll up far enough
That's fine.
Ah, sincere apologies for the delay. Instead of transfer in the request, can you try payment?
Ok
Let me check.
{
"object": "list",
"data": [
{
"id": "txn_1JsVJqQdKAMzg6YlW1QiGNhz",
"object": "balance_transaction",
"amount": 500,
"available_on": 1636129870,
"created": 1636129870,
"currency": "usd",
"description": null,
"exchange_rate": null,
"fee": 0,
"fee_details": [
],
"net": 500,
"reporting_category": "charge",
"source": "py_1JsVJpQdKAMzg6YlzlIagHE5",
"status": "available",
"type": "payment"
}
],
"has_more": false,
"url": "/v1/balance_transactions"
}
This is the response which I got from curl request.
{
"object": {
"id": "tr_1JsVJpHHgiuTDwmOjN5u7VBd",
"object": "transfer",
"amount": 500,
"amount_reversed": 0,
"balance_transaction": "txn_1JsVJqHHgiuTDwmOUMNhEZvu",
"created": 1636129870,
"currency": "usd",
"description": null,
"destination": "acct_1Jr4HRQdKAMzg6Yl",
"destination_payment": "py_1JsVJpQdKAMzg6YlzlIagHE5",
"livemode": false,
"metadata": {
},
"reversals": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/transfers/tr_1JsVJpHHgiuTDwmOjN5u7VBd/reversals"
},
"reversed": false,
"source_transaction": null,
"source_type": "card",
"transfer_group": null
}
}
And this is 'transfer.created' event's data.
That seems to show what you're looking for then, correct?
In this 2 payloads, only the value 'py_1JsVJpQdKAMzg6YlzlIagHE5' is same.
The source and destination_payment id there match, along with the amount
Sure, that's how those objects are mapped together -- they're different objects (balance transaction vs transfer)
If you use expansion on the balance transactiion you can get the transfer
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
expand[]=data.source.source_transfer for example
Do you mean that I should use expansion while hitting 'https://api.stripe.com/v1/balance_transactions' api ?
yep!
and, apologies: for a list request that would need to be prepended with data. (fixed above)
Give it a try ๐
Let me try it quickly.
Now, I have got this response. It does have the 'Transfer' object's id.
If multiple transfers are involved in a payout, then will I get all those 'Transfer' ids in the response of this request ?
Yes, the list will include each payment (up to the limit you specify or 100 max) and the expansion for each
So, in the 'data' array, there will be multiple json elements indicating each transfer involved, right ?
each payment balance transaction, to be precise, which will each have the expansion you requested to include the transfer
so, yes, with those clarifications
Ok. I had transferred few dollars using 2 transfers which are expected to arrive tomorrow. Will hit the api using that payout id and will check the response.
So, we can specify offset and limit ?
What does 'payment balance transaction' mean ?
Those are the objects your request returns: balance transactions of type payment
Yes, you can specify a limit up to 100 results
If you need to page the results explicitly, you can use starting_after and neding_before using the first/last object ids as needed
But how will one payout have multiple balance transactions ?
Well if you have multiple payments / transfers to an account in one day or close together, they'd be in a single payout
Ok
I think I am done with the queries for today. Will check for that multiple transfers tomorrow and connect with you guys if I have some doubts.
Thank you.
And also I am new to discord. Where will I be able to see all my archived threads ?
Quite welcome ๐ -- you can search for messages from yourself in the search bar up top
Got it. Thanks.