#Ishan-connect

1 messages ยท Page 1 of 1 (latest)

ruby prairie
charred drift
#

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.

ruby prairie
#

thanks, reading/thinking..

charred drift
#

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.

ruby prairie
#

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 of payout.created and payout.paid events 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.

charred drift
#

Sorry, I didn't get the meaning of your response to the first question. Can you please explain it more ?

ruby prairie
#

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.

charred drift
#

So, basically, if I check that checkbox, my webhook endpoint will get called for connected account related events only, right ?

ruby prairie
#

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

charred drift
#

Ok

#

If my backend server is down, how many times failed webhooks are retried ?

restive hamlet
charred drift
#

Ok. I will go through the 2 links thoroughly and will get back to Stripe if I have any more doubts. Thanks.

charred drift
#

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.

restive hamlet
#

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?

charred drift
#

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 ?

restive hamlet
#

Good question. Looking in to how to check this.

restive hamlet
#

Apologies for the delay, still looking in to this. I think the method you linked to should still work but I am confirming

charred drift
#

Sorry, I am not getting the meaning of your sentence. Can you please explain more ?

restive hamlet
#

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

#

So you can:

  1. Retrieve the transfers you are interested in, look at their balance_transaction properties
  2. List the BalanceTransactions for the Payout you are interested in
  3. Check if the IDs from step 1 are present in the list from step 2
charred drift
#

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"
}

Learn more about common error codes and how to resolve them.

restive hamlet
charred drift
#

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.

#

This is my curl request. I have removed secret key part.

#

But it's there while requesting.

frail shuttle
#

Hey there ๐Ÿ‘‹ please bear with me a moment while I get caught up on this thread.

charred drift
#

Sure.

frail shuttle
#

Are you using automatic payouts, or manual?

charred drift
#

Automatic

frail shuttle
#

Gotcha, I'm going to take a closer look at the objects, please bear with me

charred drift
#

Ok

frail shuttle
#

Can you provide the raw response of the cURL request? (redacting anything that shouldn't be shared)

charred drift
#

I have sent it. Check above in the chat.

#

{
"object": "list",
"data": [

],
"has_more": false,
"url": "/v1/balance_transactions"
}

#

Sharing again.

frail shuttle
#

Apologies, didn't scroll up far enough

charred drift
#

That's fine.

frail shuttle
#

Ah, sincere apologies for the delay. Instead of transfer in the request, can you try payment?

charred drift
#

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.

sacred hull
#

That seems to show what you're looking for then, correct?

charred drift
#

In this 2 payloads, only the value 'py_1JsVJpQdKAMzg6YlzlIagHE5' is same.

sacred hull
#

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

#

expand[]=data.source.source_transfer for example

charred drift
sacred hull
#

yep!

#

and, apologies: for a list request that would need to be prepended with data. (fixed above)

#

Give it a try ๐Ÿ™‚

charred drift
#

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 ?

sacred hull
#

Yes, the list will include each payment (up to the limit you specify or 100 max) and the expansion for each

charred drift
#

So, in the 'data' array, there will be multiple json elements indicating each transfer involved, right ?

sacred hull
#

each payment balance transaction, to be precise, which will each have the expansion you requested to include the transfer

#

so, yes, with those clarifications

charred drift
#

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.

charred drift
charred drift
sacred hull
#

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

charred drift
#

But how will one payout have multiple balance transactions ?

sacred hull
#

Well if you have multiple payments / transfers to an account in one day or close together, they'd be in a single payout

charred drift
#

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 ?

sacred hull
#

Quite welcome ๐Ÿ™‚ -- you can search for messages from yourself in the search bar up top

charred drift
#

Got it. Thanks.