#yaviner
1 messages · Page 1 of 1 (latest)
we're having trouble finding a way to determine the associated Connect user ID (or, even, associated transfer IDs) for a given payout ID
What exactly are you looking at?
Where are you starting?
associated Connect user ID
I imagine you're learning about the payouts via webhooks, yes? If so, theaccountin part of that webhook payload to tell you which connected account it came from
Well, we can't initiate the payouts ourselves since we do separate charges/transfers. We initiate the Transfer ourselves, and ideally would love to get the converted currency amount, however that's not available
We didn't see an account in the payout webhook - which one includes it?
associated transfer IDs
You need to go backwards from the payout by list balance transfers included in a given payout, which is only supported for automatic payouts. If you do manul payouts you need to track this yourself.
https://stripe.com/docs/expand/use-cases#charges-in-payout
How would we track it ourselves, if we're doing separate charges / transfers?
You can still trace back to the transfers
Just to be clear - separate charges / transfers is a form of manual payout, correct?
no
different concept
SCT is getting money transferred to the connected account(s)
payouts is getting money from the account balance to an external bank account
hm, then it seems for our users that they are using automatic payouts, not manual
i.e. all of them have "Automatic" selected under "Edit payout schedule" in the UI
however, when we use the balance_transfer endpoint for a given payout (for a user with automatic payouts..) we see transactions associated with entirely different users
Can you share the request you're making, and what about it is unexpected?
eg, req_123, or a snippet of code`
sure - here's the req id: req_FJMVStZOlerIs8
it returns a handful of transfers, which all belong to different users
This looks like you're retrieving balance transactions for your own account
You need to send the stripe-account header for the connected account to get the BTs for that account
and you're not including the payout parameter either
the request included the payout parameter; we tried with the stripe-account header and it also didn't include the transfers there
Something like this:
curl --request GET \
--url https://api.stripe.com/v1/balance_transactions \
-u sk_test_123: \
--header 'Stripe-Account: acct_1234' \
--data payout=po_1789 \
--data 'expand[]=data.source.source_transfer'
You need to include the expansion to get the transfer info
I see, payout isn't a header field - trying that now
thanks, that worked! I think we can use this 🙂
Ah, wait
This won't work - in order for this API call to work we'd already need to know the Account ID! Which we don't have - that's why we're doing this
in this case: from a webhook
on our side, we initiate a manual transfer from the Platform to the Connect account, but no payout is immediately created (since it's happening automatically on a schedule, say, the next day), so there's no payout ID to store
that leaves us waiting for the payout to occur - waiting on the webhook. I suppose an alternative approach would be to poll the accounts daily for new payouts (?)
If you're getting payout events, then you should preserve the account when you get that
For connect events, that's part of the event payload:
https://stripe.com/docs/api/events/object#event_object-account
Hm, the events we’ve seen for payouts haven’t included the account field - is it only included with certain webhooks? Or not included in the event JSON when we check it in the stripe UI?
The account field should be present for any connect account events. For platform webhooks account is not included but that is because they are always about your platform account
Does that sound like it might be what your seeing? If not, I'm happy to look in to some of the events that you are talking about if you have their IDs (evt_123)
If the account is not present, you might not be using a Connect type webhook endpoint: https://stripe.com/docs/connect/webhooks#connect-webhooks
But as @vague arch says some example payouts/events would help confirm this
I’ll be back shortly to confirm/send over some examples. I’ve been basing that statement (that the account ID isn’t present) on the event page itself within the UI - we haven’t tried this with a live webhook yet
I'm having a bit of trouble re-sending the event to a (cli) endpoint, but this is the one i was looking at: evt_1NJAkQCDV7GXpTGTagHPbm7v
Hi 👋
I see an eevent for a payout being created. What is the question here?
Hi! The question here is whether we can get to the connected account ID from this payout event. The event data does not include account - though perhaps the Connect webhook version of the same would?
Yes the Connect Webhook event object will include an account property with the Account ID
https://stripe.com/docs/api/events/object#event_object-account
ah, okay! by the way, is there a straightforward way to trigger a sample connect webhook event via the cli?
You can listen via the CLI and it will forward Connect events as well as ones on your account.
You can then use the APIs and trigger events on a test Connected Account
is the event just payout.created, for example?
I've tried the following: stripe trigger payout.created --stripe-account acct_1NOR8nCQF129jM1V - where that ID is a test account matching more or less the type we're interested in, and it returns an error that ""You cannot create a charge on a connected account without the card_payments capability enabled."" -- unfortunately, card_payments cannot be enabled for users on the recipient agreement (this is an international / non US account)