BillingBalanceTransferRequest billing.balance-transfer-request@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/balance-transfer-request.v1.json
billing.balance-transfer-request@1: body of POST /api/me/balance/transfers (D12). Moves amount_nano_usd from the signed-in person's Balance to a project they administer, into that project's Balance. Money is positive integer nano-USD as a decimal string (D1), never a float; the transfer is refused when the Balance or the person's project role is short. idempotency_key makes the transfer exactly once: a replay with the same key and body returns the first answer and moves nothing.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
to_project_id | string | yes | The project whose Balance receives the money; the person must administer it. |
|
amount_nano_usd | string | yes | A positive integer nano-USD (1e-9 USD) as a decimal string (D1), never a float. |
|
idempotency_key | string | yes | Unique per mutation. A replay with the same key and body returns the first answer and changes nothing. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: to-project
{
"to_project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"amount_nano_usd": "5000000000",
"idempotency_key": "transfer-key-001"
}Rejected: extra-field
{
"to_project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"amount_nano_usd": "5000000000",
"idempotency_key": "transfer-key-001",
"to_user_id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}Rejected: missing-project
{
"amount_nano_usd": "5000000000",
"idempotency_key": "transfer-key-001"
}Rejected: money-number
{
"to_project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"amount_nano_usd": 5000000000,
"idempotency_key": "transfer-key-001"
}Rejected: zero-amount
{
"to_project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"amount_nano_usd": "0",
"idempotency_key": "transfer-key-001"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.balance-transfer-request@1', value); // { valid, errors: [{ path, message }] }