#yaviner

1 messages · Page 1 of 1 (latest)

plucky heraldBOT
wise cliff
#

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, the account in part of that webhook payload to tell you which connected account it came from

fossil ledge
#

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?

wise cliff
fossil ledge
#

How would we track it ourselves, if we're doing separate charges / transfers?

wise cliff
#

You can still trace back to the transfers

fossil ledge
#

Just to be clear - separate charges / transfers is a form of manual payout, correct?

wise cliff
#

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

fossil ledge
#

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

wise cliff
#

Can you share the request you're making, and what about it is unexpected?

#

eg, req_123, or a snippet of code`

fossil ledge
#

sure - here's the req id: req_FJMVStZOlerIs8

#

it returns a handful of transfers, which all belong to different users

wise cliff
#

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

fossil ledge
#

the request included the payout parameter; we tried with the stripe-account header and it also didn't include the transfers there

wise cliff
#

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

fossil ledge
#

I see, payout isn't a header field - trying that now

#

thanks, that worked! I think we can use this 🙂

wise cliff
#

Great! NP, happy to help

#

🎉

fossil ledge
#

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

wise cliff
#

How do you not have the account ID?

#

Where do you get the payout id from?

fossil ledge
#

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 (?)

wise cliff
fossil ledge
#

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?

plucky heraldBOT
vague arch
#

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)

wise cliff
fossil ledge
#

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

plucky heraldBOT
plucky heraldBOT
fossil ledge
#

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

tardy flax
#

Hi 👋

I see an eevent for a payout being created. What is the question here?

fossil ledge
#

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?

tardy flax
fossil ledge
#

ah, okay! by the way, is there a straightforward way to trigger a sample connect webhook event via the cli?

tardy flax
#

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

fossil ledge
#

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)