---
title: "billing.balance@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/billing.balance"
updated: null
---

# billing.balance@1 · OpenVibe.Services

HTML: [billing.balance@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/billing.balance)

# BillingBalance `billing.balance@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: billing
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/billing/balance.v1.json`](/docs/contracts/billing.balance.json)

billing.balance@1: a Balance account (D12), held by a person (owner user:<usr\_id>) or a project (owner project:<prj\_id>). GET /api/me/balance answers { personal, projects } of these. balance\_nano\_usd is the whole account; held\_nano\_usd is reserved by active holds; available\_nano\_usd is spendable (balance = held + available). Money is integer nano-USD as decimal strings (D1), never a float. sandbox marks a sandbox account. An id is permanent, so this contract still also describes the Vibes wallet body that billing.balance.read has answered: a person's Vibes (currency vibes-bits), not a Balance. Each branch is closed with additionalProperties: false; new code sends the Balance branch.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `subject` | [identity.subject-ref](/docs/contracts/identity.subject-ref) |  |  |  |
| `currency` | const |  |  | - `= "vibes-bits"` |
| `credit` | integer |  |  |  |
| `payable` | integer |  |  |  |
| `pending_payouts` | integer |  |  |  |
| `payable_value_cents` | integer |  | What payable is worth in US cents at today's rate. |  |
| `bits_per_usd` | number |  |  |  |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: creator

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "currency": "vibes-bits",
  "credit": 1200,
  "payable": 5500,
  "pending_payouts": 0,
  "payable_value_cents": 5500,
  "bits_per_usd": 100
}
~~~~

Valid: personal

~~~~
{
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "12400000000",
  "held_nano_usd": "0",
  "available_nano_usd": "12400000000",
  "sandbox": false
}
~~~~

Valid: project

~~~~
{
  "owner": {
    "type": "project",
    "id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "5000000000",
  "held_nano_usd": "1200000000",
  "available_nano_usd": "3800000000"
}
~~~~

Valid: sandbox

~~~~
{
  "owner": {
    "type": "project",
    "id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "100000000",
  "held_nano_usd": "0",
  "available_nano_usd": "100000000",
  "sandbox": true
}
~~~~

Rejected: extra-promo-bits

~~~~
{
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "1",
  "held_nano_usd": "0",
  "available_nano_usd": "1",
  "promo_bits": 5
}
~~~~

Rejected: missing-available

~~~~
{
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "12400000000",
  "held_nano_usd": "0"
}
~~~~

Rejected: mixed-shapes

~~~~
{
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "1",
  "held_nano_usd": "0",
  "available_nano_usd": "1",
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "currency": "vibes-bits",
  "credit": 1,
  "payable": 0,
  "pending_payouts": 0,
  "payable_value_cents": 0,
  "bits_per_usd": 100
}
~~~~

Rejected: money-number

~~~~
{
  "owner": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": 12400000000,
  "held_nano_usd": "0",
  "available_nano_usd": "12400000000"
}
~~~~

Rejected: unknown-owner-type

~~~~
{
  "owner": {
    "type": "guest",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "balance_nano_usd": "1",
  "held_nano_usd": "0",
  "available_nano_usd": "1"
}
~~~~

Rejected: wrong-currency

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "currency": "usd-cents",
  "credit": 1,
  "payable": 0,
  "pending_payouts": 0,
  "payable_value_cents": 0,
  "bits_per_usd": 100
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('billing.balance@1', value);   // { valid, errors: [{ path, message }] }
~~~~
