#john gadbois - balances

1 messages ยท Page 1 of 1 (latest)

formal copper
dark plinth
#

Also, this behavior is on test mode AND Standard connected accounts. I checked some Express connected accounts and the webhooks appear much more frequent on express

formal copper
#

Hey John, you can check the balance transaction within charge (eg with expansion) to see when it's expected to be available:
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-available_on
and you should get such an event any time a charge is added into the account available balance.

#

It may be the case that charges are bundled together by availability date

dark plinth
#

thanks, yeah we are checking status via expansion, but are using the webhook to trigger certain checks

#

is there a way to unbundle the charges, or maybe that is just a feature of connected standard accounts?

formal copper
#

No you can't influence this, it's how the charge availability happens.

#

I would note that if you're using destination charges with standard accounts, this is not a recommend flow

dark plinth
#

do you think it's related to standard (it's an old test account pre-express)?

would a transfer most likely fire the balance.available immediately for express?

#

i would expect the webhook to fire shortly after available_on

formal copper
#

Transfers from your platform available balance would be available right away in the connected account

dark plinth
#

we've actually hit snags assuming that bc it can take a couple seconds

formal copper
#

And just testing that now yes the event fires for the connected account right away

dark plinth
#

thanks for all the help - what about direct charges to Standard? would those bundled or fire webhooks as they become available

clear cave
#

Hello! Taking over... on a Standard account a balance.available event should fire when funds become available, yep!

dark plinth
#

for direct charges only right? Seems like the issue is Standard + destination (not really supported)?

#

that's where we are seeing the once a day balance.available hook so far (still need to test Standard + direct)

clear cave
#

Not sure what you mean? balance.available should fire anytime an account's available balance increases.

#

Can you give me a specific example of a recent destination charge that didn't fire the event on the connected account as expected?

dark plinth
#

Sure - py_0KEyMSqEsetG7IUo9OiyNHPN

#

It's a transfer payment as part of a destination charge

#

The last balance.available for that account is evt_0KEjUJqEsetG7IUo9IAm4ehv

clear cave
#

Taking a look, hang on...

#

Are you sure that payment is updating the available balance on the connected account? If you fetch the balance via the API both before and after a payment like this are you seeing the available balance increase?

dark plinth
#

i'm looking at the balance transaction for the payment and it says "available". Looking at the logs for balance.available the event fires once a day no matter when the balance_transactions become available if that makes sense

clear cave
dark plinth
#

I can check - we're using the test card that skips pending

clear cave
#

I think that may only skip pending on your platform account, not on the connected account, but the Balance API will reveal what's really happening. ๐Ÿ™‚

dark plinth
#

So you are saying balance_transaction.status (which is pending or available) does not correspond to the actual balance?

#

i thought that flag was to tell you which bucket it was in

clear cave
#

It should indicate that, yes, but I can't see that detail from my end unfortunately.

dark plinth
#

Let me get you the balance transaction details for that payment

#

 "object": "balance_transaction",
  "amount": 120000,
  "available_on": 1641484724,
  "created": 1641484724,
  "currency": "usd",
  "description": null,
  "exchange_rate": null,
  "fee": 25155,
  "reporting_category": "charge",
  "source": "py_0KEyMSqEsetG7IUo9OiyNHPN",
  "status": "available",
  "type": "payment"
#

so status is avaiable and available_on is in the past

#

txn_0KEyMSqEsetG7IUoJbBM6RID

#

I can run a test checkout to check the actual balance from the balance api as well

clear cave
#

I'm also testing this myself to see if I can reproduce on my end.

#

Using the 0077 test card to create a destination payment on a Standard connected account does update the available balance on the connected account and I do get a balance.available event immediately for it.

dark plinth
#

That's why i was asking if maybe it's related to the fact that we're connected to a Standard account?

#

could that cause some weirdness

#

i did confirm available balance increases, but no event is sent

clear cave
#

The type of the account should not matter. Is this happening across several accounts or just one specific one?

dark plinth
#

Several test accounts

#

they are firing one balance.available every 24 hours

#

could it be a payout schedule setting related thing or something?

#

wouldn't think that would affect balance webhook

clear cave
#

That shouldn't impact the balance.available events.

dark plinth
#

Any more info I could give you that might give some insight related to the test account?

clear cave
#

I'm investigating further now... no other info needed yet, but I'll let you know!

#

Give me a few minutes and I should have something more.

#

Okay, so it turns out what you said above is correct and this is related to the connected account's payout settings! When automatic payouts are enabled we only send the balance.available event once per day (as you found) as part of the payout process. Normally balances on accounts with automatic payouts go from pending to paid out without hitting the available balance in between, but the 0077 test card allows you to do something in test mode that wouldn't normally be possible.

#

So, all that said, what are you trying to do at a higher level? Maybe I can recommend something that will work better than the balance.available event.

dark plinth
#

We are trying to pay commissions by transferring money from the connected account, through the platform, to another connected account

#

We were using the webhook to know when balance's had updated for various connected accounts, so we didn't waste cycles/api calls balance transactions on platforms that hadn't had an update

#

I think we can maybe be more efficient by just scheduling the job to run at available_on

#

Basically we need to pay a commission but ensure the charge has cleared first so the balance is available

clear cave
#

So the connected accounts in question won't have automatic payouts turned on?

dark plinth
#

95% won't, we may have a couple legacy standard accounts that do

clear cave
#

For those accounts the funds will be paid out instead of becoming available.

dark plinth
#

ah ok that makes sense - we can work with those clients

clear cave
#

Other than that yeah, I think your approach is sound. The Balance Transactions can tell you when the funds have become available.

dark plinth
#

ok thanks for looking into that for us