BillingEntitlement billing.entitlement@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/entitlement.v1.json
billing.entitlement@1: whether a person is entitled to a streamer's subscriber perks now (OpenVibe.Billing server/ops/subscriptions.js entitlement): GET /api/v1/entitlements/:subject?streamer=, and inside subscription answers. Chained, already-paid future periods extend expires_at.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
subject | identity.subject-ref | yes | ||
streamer | identity.subject-ref | yes | ||
kind | string | yes | ||
active | boolean | yes | ||
expires_at | string | null | yes | ||
subscription | object | null | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: active
{
"subject": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"streamer": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"kind": "channel_subscription",
"active": true,
"expires_at": "2026-10-25T18:00:00.000Z",
"subscription": {
"id": "sub_01JAB2C3D4E5F6G7H8J9K0MNPW",
"status": "active",
"auto_renew": 1,
"cancel_at_period_end": 0,
"provider": "credit"
}
}Rejected: active-not-boolean
{
"subject": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"streamer": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"kind": "channel_subscription",
"active": "yes",
"expires_at": null,
"subscription": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.entitlement@1', value); // { valid, errors: [{ path, message }] }