Docs

The Balance object

This is an object representing your Zoneless balance. You can retrieve it to see the balance currently on your Zoneless account or a connected account.

Attributes

object string

String representing the object's type. Objects of the same type share the same value.

available array of objects

Available funds that you can transfer or pay out. You can find the available balance for each currency in this array.

livemode boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

pending array of objects

Funds that aren't available in the balance yet. You can find the pending balance for each currency in this array.

More attributes

THE BALANCE OBJECT
{
  "object": "balance",
  "available": [
    {
      "amount": 666670,
      "currency": "usdc",
      "source_types": {
        "wallet": 666670
      }
    }
  ],
  "livemode": false,
  "pending": [
    {
      "amount": 61414,
      "currency": "usdc",
      "source_types": {
        "wallet": 61414
      }
    }
  ],
  "platform_account": "acct_z_Platform123abc"
}

Retrieve balance

Retrieves the current account balance, based on the authentication that was used to make the request.

ENDPOINTS
GET /v1/balance

For platforms, you can optionally pass the Zoneless-Account header to retrieve the balance of a connected account on their behalf.

Parameters

No parameters.

Returns

Returns a Balance object for the account that was authenticated in the request, or for the connected account specified via the Zoneless-Account header.

GET/v1/balance
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const balance = await zoneless.balance.retrieve();
RESPONSE
{
  "object": "balance",
  "available": [
    {
      "amount": 666670,
      "currency": "usdc",
      "source_types": {
        "wallet": 666670
      }
    }
  ],
  "livemode": false,
  "pending": [
    {
      "amount": 61414,
      "currency": "usdc",
      "source_types": {
        "wallet": 61414
      }
    }
  ],
  "platform_account": "acct_z_Platform123abc"
}

Retrieving a connected account's balance

As a platform, you can retrieve the balance of any connected account by passing the Zoneless-Account header with the connected account ID.

On behalf of a connected account
import { Zoneless } from '@zoneless/node';
const zoneless = new Zoneless('sk_live_z_YOUR_API_KEY', 'https://api.zoneless.com');

const balance = await zoneless.balance.retrieve({
  zonelessAccount: 'acct_z_1Nv0FGQ9RKHgCVdK',
});