BillingSubscription billing.subscription@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/subscription.v1.json
billing.subscription@1: one channel subscription as OpenVibe.Billing presents it (server/ops/subscriptions.js present).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes | ||
subscriber | identity.subject-ref | yes | ||
streamer | identity.subject-ref | yes | ||
tier | any | |||
provider | string | yes | credit, or the provider that takes the payments. | |
provider_ref | string | null | |||
route | string | null | site or direct (paid to the streamer's own provider account). | ||
status | string | yes | active, canceled, expired, … | |
auto_renew | boolean | yes | ||
cancel_at_period_end | boolean | yes | ||
price_cents | integer | null | |||
current_period_end | string | null | yes | ||
created_at | string | |||
updated_at | string | null |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: credit
{
"id": "sub_01JAB2C3D4E5F6G7H8J9K0MNPW",
"subscriber": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"streamer": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"tier": 1,
"provider": "credit",
"provider_ref": null,
"route": null,
"status": "active",
"auto_renew": true,
"cancel_at_period_end": false,
"price_cents": 499,
"current_period_end": "2026-10-25T18:00:00.000Z",
"created_at": "2026-09-25T18:00:00.000Z",
"updated_at": "2026-09-25T18:00:00.000Z"
}Rejected: bare-subscriber
{
"id": "sub_1",
"subscriber": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"streamer": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"provider": "credit",
"status": "active",
"auto_renew": true,
"cancel_at_period_end": false,
"current_period_end": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.subscription@1', value); // { valid, errors: [{ path, message }] }