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

FieldTypeRequiredDescriptionConstraints
idstringyes
subscriberidentity.subject-refyes
streameridentity.subject-refyes
tierany
providerstringyescredit, or the provider that takes the payments.
provider_refstring | null
routestring | nullsite or direct (paid to the streamer's own provider account).
statusstringyesactive, canceled, expired, …
auto_renewbooleanyes
cancel_at_period_endbooleanyes
price_centsinteger | null
current_period_endstring | nullyes
created_atstring
updated_atstring | 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 }] }