#Andrew-connect-balances

1 messages · Page 1 of 1 (latest)

jaunty flicker
#

Hey! Why specifically do you need to account for any discrepancies? Generally we'd recommend to rely on the values returned via the API

sinful zinc
#

Well it's the same reason stripe does it here. For example the "Total Balance" column isn't a value that's returned from the API it's actually calculated.

#

Available to payout is the instant which is fine, the Available soon in the pending value i believe.

jaunty flicker
#

I don't understand the question I'm afraid. Total balance there (in your screenshot) is a sum of available soon and available to payout

sinful zinc
#

Give me a second i wanna see the actual response. coming back. it was calculated weirdly when the available soon was a negative balance due to a refund. i'll try to recreate.

#

Ok given this JSON from the balance API for a connect account:

{
   "livemode":false,
   "object":"balance",
   "pending":[
      {
         "amount":2205,
         "currency":"usd",
         "sourceTypes":{
            "card":2205
         }
      }
   ],
   "instantAvailable":[
      {
         "amount":0,
         "currency":"usd",
         "sourceTypes":{
            "card":0
         }
      }
   ],
   "available":[
      {
         "amount":-2824,
         "currency":"usd",
         "sourceTypes":{
            "card":-2824
         }
      }
   ]
}

I now have these values. @jaunty flicker

jaunty flicker
#

$22.05 - $28.24 = -$6.19

sinful zinc
#

So pending minus absolute value of available

#

I'm assuming the "Available to payout" is a combination of available and instantAvailable?

jaunty flicker
#

Total balance is just the sum of all 3 values

#

Those could be negative, as you're seeing here

sinful zinc
#

Ah ok i see. i was doing available - abs(pending) for the total.

jaunty flicker
#

Hope that helps?

sinful zinc
#

Yea trying it out now but seems like it will. thanks!

jaunty flicker
#

Np!