#cnguyen
1 messages · Page 1 of 1 (latest)
Hello! Have you investigated listening for the balance.available event? https://stripe.com/docs/api/events/types#event_types-balance.available
Yes but I need to know which payment / transaction is
and the balance object doesn't have this information
To explain more, actually, when a transaction is made, I create another transaction associated by transfer group. Because we offer £5 discount on each transaction for example. But the problem is that my transaction is already available for the payout (because it comes from our balance). And the payment will be available only in 7 days.
So I need to send the £5 discount only when the payment is available for the payout
Sorry, I'm still not following. What do you mean by "when the payment is available for the payout" exactly?
That's why I think about 2 things :
- Know when a payment is unlock to be in the next payout
- Have to know when the payout on Monday is done and check each transaction that are in it. And create the £5 transfer for each one
When the shopper make a payment, the money is available for the merchant payout after 7 days, on the next Mondays
So you want to know when a Payout has been made, then look at every payment included in the Payout and create a £5 for each one?
yes exactly
Okay, for the first part you can listen for payout.paid events: https://stripe.com/docs/api/events/types#event_types-payout.paid
For the second part you can list all Balance Transactions that are associated with that Payout to determine what's contained in the Payout: https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout
From there you can issue the £5 Transfers.
OK payout.paid is hooked each time a transaction is available for the NEXT payout? Or I suppose I have to check if it's for the next payout or the following one
I don't understand what you mean when you say "the NEXT payout". Can you provide more details there?
because for the payout, you can have multiple ones. It's not one by one
Multiple what? Multiple Payouts? Multiple payments within a Payout?
But I will check
no pultiplate payout
one by week
so a payment could be on the next payout or on the next next payout
I will check it
So when you get a payout.paid event it will be for a specific Payout. You can use the Balance Transactions list API to determine what's in that specific Payout.