Gettin USD Balance in Accounts

So, I’ve gone through all the endpoints (as far as I can tell). I can successfully retrieve all the accounts under my profile. But I don’t see where to find the correct USD balance. It does not appear in the accounts.

There is a way to do this in the Pro API, but I don’t see it (or I’m blind, also possible) in the AT API.

Any suggestions?

Should be the /accounts endpoint. I get back for USD:

{
    uuid: 'redacted',
    name: 'Cash (USD)',
    currency: 'USD',
    available_balance: { value: '30.2985382427378000', currency: 'USD' }, // <--HERE
    default: false,
    active: true,
    created_at: '2019-12-21T16:53:01.500Z',
    updated_at: '2022-11-18T23:04:26.565Z',
    deleted_at: null,
    type: 'ACCOUNT_TYPE_FIAT',
    ready: false,
    hold: { value: '20.0499247122500000', currency: 'USD' } // <--HERE
  }

So you can see that I have about $50 in USD total. 20 on hold (account.hold.value) and 30 available to spend (account.available_balance.value). If you add them you get your total balance.

I searched through the entire response, and USD does not appear once in mine. That’s what’s puzzling me. All the other accounts are there. but not USD. And yet, I have a USD balance.

Now I’m really confused.

Added notes:

  • All of the accounts returned are name ‘[currency] Wallet’ with the currency being the product.

Neither ‘USD’ nor ‘FIAT’ appear anywhere in the response.

All have type ’ ACCOUNT_TYPE_CRYPTO’

In other words, my output is significantly different.

Example:

{'active': True,
               'available_balance': {'currency': '00',
                                     'value': '4.3558292608755048'},
               'created_at': '2022-10-14T05:24:22.118Z',
               'currency': '00',
               'default': True,
               'deleted_at': None,
               'hold': {'currency': '00', 'value': '0.0000000000000000'},
               'name': '00 Wallet',
               'ready': False,
               'type': 'ACCOUNT_TYPE_CRYPTO',
               'updated_at': '2022-10-14T05:27:47.491Z',
               'uuid': 'redacted'}

Oh, I forgot I did have that problem at first. I think the default for the limit param is 50, which cuts it off before it returns the USD account. I set the limit to 250 and it worked. See if that works for you.

Edit: Going forward, the 250 limit thing isn’t a good idea. Right now they only return 97 accounts, but if they add more later some could drop off. Better to use the cursor function, and hopefully in the future they will let us get an account by currency instead of just uuid.

1 Like

That sounds like it would be the problem. I’ll try changing the limit! Thanks for the heads up!

2 Likes

That was it! Great catch, and thanks!

2 Likes