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

# billing.entitlement.changed@1 · OpenVibe.Services

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

# BillingEntitlementChangedPayload `billing.entitlement.changed@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
- Decision: [ADR-012](/docs/adr/ADR-012)
- Schema: [`https://openvibe.network/contracts/events/payloads/billing.entitlement.changed.v1.json`](/docs/contracts/billing.entitlement.changed.json)

billing.entitlement.changed v1 (OpenVibe.Billing server/ops/subscriptions.js pay, setStatus, revokeForTxn; entitlement()). A subscriber's channel-subscription entitlement to a streamer changed: a period was granted or renewed, the subscription ended or expired, or a reversed payment revoked a period. The payload is the entitlement as of now. Envelope: subject { type: entitlement, id: <subscriber usr\_…>:channel\_subscription:<streamer usr\_…> }, visibility internal, priority important, actor service:billing.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `subject` | [identity.subject-ref](/docs/contracts/identity.subject-ref) | yes |  |  |
| `streamer` | [identity.subject-ref](/docs/contracts/identity.subject-ref) | yes |  |  |
| `kind` | const | yes |  | - `= "channel_subscription"` |
| `active` | boolean | yes |  |  |
| `expires_at` | string \| null | yes |  | - `format date-time` |
| `subscription` | object \| null | yes |  |  |
| `reason` | string | yes | granted, renewed, canceled, expired, stripe\_not\_renewed, stripe\_deleted, renewal\_insufficient\_credit, refund, chargeback, renewal\_failed (a renewal charge failed: status past\_due, grace\_until set), grace\_ended (the grace window passed without a paid renewal), credit\_refund (a credit-paid period was refunded). |  |
| `transaction_id` | string |  | granted/renewed: the transaction that paid the period. | - `pattern ^txn_[0-9A-HJKMNP-TV-Z]{26}$` |
| `grace_until` | string \| null |  | renewal\_failed: when Billing stops retrying the renewal and ends the subscription; null or absent otherwise. | - `format date-time` |
| `renewal_period_end` | string |  | renewal\_failed, grace\_ended: the end of the period the failed renewal charge was for. | - `format date-time` |
| `revoked_period` | object |  | refund/chargeback/credit\_refund: the period the reversed payment had granted. | - `no other fields` |
| `revoked_period.starts_at` | string | yes |  | - `format date-time` |
| `revoked_period.ends_at` | string | yes |  | - `format date-time` |

## Examples

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

 Valid: grace-ended

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "active": false,
  "expires_at": "2026-10-23T10:00:00.000Z",
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "expired",
    "auto_renew": false,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "grace_ended",
  "grace_until": null,
  "renewal_period_end": "2026-11-23T10:00:00.000Z"
}
~~~~

Valid: granted

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "active": true,
  "expires_at": "2026-10-23T10:00:00.000Z",
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "active",
    "auto_renew": true,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "granted",
  "transaction_id": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ4"
}
~~~~

Valid: refund-revoked

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "active": false,
  "expires_at": null,
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "expired",
    "auto_renew": false,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "refund",
  "revoked_period": {
    "starts_at": "2026-09-23T10:00:00.000Z",
    "ends_at": "2026-10-23T10:00:00.000Z"
  }
}
~~~~

Valid: renewal-failed-past-due

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "active": false,
  "expires_at": "2026-10-23T10:00:00.000Z",
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "past_due",
    "auto_renew": true,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "renewal_failed",
  "grace_until": "2026-10-26T10:00:00.000Z",
  "renewal_period_end": "2026-11-23T10:00:00.000Z"
}
~~~~

Rejected: other-kind

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "network_membership",
  "active": true,
  "expires_at": "2026-10-23T10:00:00.000Z",
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "active",
    "auto_renew": true,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "granted",
  "transaction_id": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ4"
}
~~~~

Rejected: unknown-status

~~~~
{
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "streamer": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "kind": "channel_subscription",
  "active": false,
  "expires_at": null,
  "subscription": {
    "id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0",
    "status": "grace",
    "auto_renew": true,
    "cancel_at_period_end": false,
    "provider": "credit"
  },
  "reason": "renewal_failed"
}
~~~~

## Validate

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