#knuppi-payouts

1 messages ยท Page 1 of 1 (latest)

severe spokeBOT
#

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.

royal copper
#

Not familiar with reporting in here. For those questions, we recommend you talk to support, who's more familiar: https://support.stripe.com/contact

#

I can help you query this data via the api if you're a dev

#

But w/ reporting I'm not sure

viral idol
#

I'm the dev lead of our team

royal copper
#

Ok do you want to do this via api calls?

viral idol
#

Yes, we want to automate this via the API

#

We are a platform with connected Standard Accounts. They, in their turn, have end-users who make purchases using stripe_account=acct_XXX when creating PaymentIntents etc.

#

This works perfectly well.
Problem is that we have a (big) client who also have an accounting software. They need to match invoices, which we are created through the accounting software-API, with Payouts coming from you.

royal copper
#

Got it. Are you doing direct charges?

viral idol
#

The issue is that each Payout can contain multiple Payments, and we need to be able to know which Payments are tied to which PaymentIntent (or similar)

#

Direct Charges? I don't know exactly what you mean. We're using PaymentIntent where the end-user are paying with Google Pay/Apple iPay/Credit card

royal copper
#

There's 2 types of connect charges: direct and destination

viral idol
#

aha, afaik we're using direct charge with application_fee_amount attached

royal copper
#

Got it. That makes things slightly easier. Destination charges are more complicated when it comes to doing this

#

Ok so in the following requests, you'll need to pass the stripe account header, since you'll be making requests on the connect accounts: https://stripe.com/docs/connect/authentication. The first step is to list all balance transactions by payout id: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout. That will return a list of balance transactions tied to the payout. Each has a source param: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source. This will identify the charge associated with the balance transaction. You can use expand: https://stripe.com/docs/expand to expand details about the source (which will be the charge).

severe spokeBOT
viral idol
#
  • stripe_account has been added in all requests
  • It's not clear, should we listen to webhooks wrt the Payouts? if so, what is the webhook named we should listen to?
royal copper
#

You can. Up to you

#

The above is just how to get a list of charges given a payout id

viral idol
#

How else should I know when you create a Payout, and its related ID? ๐Ÿ˜…

#

is it payout.paid which is the "last" webhook event which is triggered?

royal copper
#

yep

#

you can also just list payouts via the api

#

Up to you on how you want to get them

viral idol
#

I think we're going to listen to the webhook and then get the details about the Payout, thanks.

However, is there a way we can fake payout.paid events in test mode?

minor kraken
#

๐Ÿ‘‹ hopping in here since codename_duchess has to head out soon

#

If you have automatic payouts enabled in test mode and balance (again, in testmode) then you should still get testmode payouts that would emit payout.paid events

viral idol
#

yes, i understand. my question is; how can i fake those events? because AFAIK they're typically only triggered once per day?

minor kraken
#

There isn't really a way to fake those events

viral idol
#

not even through the Stripe CLI?

minor kraken
#

Unfortunately no - it's not one that we support through the CLI

viral idol
#

Is there an example of what the payload looks like?

minor kraken
#

Backing up for a minute - what do you need the example payload for? If you just generally want to know what the shape would look like you can look at the API ref for our Payout (https://stripe.com/docs/api/payouts/object) but it sounds like you may be looking for something specific?

viral idol
#

What I want to do is to find the txn_XXX in the payout.paid webhook so that I can retrieve the balance details

#

I see now that the balance_transaction has the relevant information ๐Ÿ‘Œ๐Ÿพ

minor kraken
#

Yeah the balance transaction is what you'll want to look at

severe spokeBOT
#

knuppi-payouts

viral idol
#

Thanks, will have a look at this.
Please create a feature request in my place; allow stripe CLI to trigger payout.paid events

#

oh, last question

#

In the Payout object, I don't see any information which connected Account the payout is associated with

minor kraken
viral idol
#

I don't really understand. Are you able to expand on this?

minor kraken
#

Payouts are when a Stripe balance is paid out to an external bank account. So the full flow of funds from your platform account -> the external bank account of a connected account would be like this:

  • Available funds in the platform Stripe account
  • Funds are transfered (through a Transfer, or during Destination Charges) from the platform -> to the connected account
  • a Payout on the Connected account is made that pays out the funds to the external bank account
viral idol
#

Yes, we need to be able to find out all information about step #3

minor kraken
#

Yeah so those payouts from Step #3 are on the connected accounts themselves - to access them you'd use the Stripe-Account header to access the objects on the connected account.

#

So if you were to listen for payout.paid events on your connected accounts, you'd have a Connect webhook that listens for those events, and because it's a connect webhook, each event will include the account in it

viral idol
#

It seems that I might've missed something (important?) wrt "Connect webhook". We only have one webhook which takes care of everything - but you're talking about a different (more specified?) type of webhook?

minor kraken
viral idol
#

Yes, your assumptions are correct

#

Currently we have a webhook with type "Account"

minor kraken
#

Yeah then you'll need another connect webhook

viral idol
#

OK, thank you.
Will all webhooks regarding connected Accounts always be redirected to this new Webhook?

minor kraken
#

yes

viral idol
#

OK, great. Thank you
You and your colleague have helped us a lot

minor kraken
#

happy to help!