VipMembershipChangedPayload vip.membership.changed@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- vip
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-012
- Schema
https://openvibe.network/contracts/events/payloads/vip.membership.changed.v1.json
vip.membership.changed v1 (OpenVibe.VIP server/domain/entitlements.js emitChanged). A member's standing with a creator changed as projected from Billing (granted, renewed, cancel scheduled, expired, refunded…): active, expires_at or cancel_at_period_end differ from before, or a first look found an active membership. Names the plan version the membership was bought under. Envelope: subject { type: membership, id: <member usr_…>:<creator usr_…> }, visibility internal, priority important, actor service:vip.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
member | identity.subject-ref | yes | ||
creator | identity.subject-ref | yes | ||
kind | string | yes | Billing entitlement kind; channel_subscription today. | |
active | boolean | yes | ||
expires_at | string | null | yes | ||
cancel_at_period_end | boolean | yes | ||
previous | object | null | yes | The projection before the change; null on first sight. | |
reason | string | null | yes | Billing's reason (granted, renewed, refund, expired…) or VIP's (checked, cancel_scheduled). | |
source | enum | yes |
| |
billing_event_id | string | null | yes | The Billing event (evt_…) behind the change, when it came from one. | |
membership_id | string | null | yes |
| |
plan_id | string | null | yes | ||
plan_version_id | string | null | yes | ||
plan_version | integer | null | yes |
| |
subscription_id | string | null | yes | The Billing subscription (sub_…). |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: cancel-scheduled
{
"member": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"kind": "channel_subscription",
"active": true,
"expires_at": "2026-10-23T10:00:00.000Z",
"cancel_at_period_end": true,
"previous": {
"active": true,
"expires_at": "2026-10-23T10:00:00.000Z",
"cancel_at_period_end": false
},
"reason": "cancel_scheduled",
"source": "event",
"billing_event_id": null,
"membership_id": "vms_01JAB3C4D5E6F7G8H9J0K1MNPZ",
"plan_id": "vpl_01JAB3C4D5E6F7G8H9J0K1MNPV",
"plan_version_id": "vpv_01JAB3C4D5E6F7G8H9J0K1MNPW",
"plan_version": 2,
"subscription_id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0"
}Valid: granted
{
"member": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"kind": "channel_subscription",
"active": true,
"expires_at": "2026-10-23T10:00:00.000Z",
"cancel_at_period_end": false,
"previous": null,
"reason": "granted",
"source": "event",
"billing_event_id": "evt_01JAB3C4D5E6F7G8H9J0K1MNPY",
"membership_id": "vms_01JAB3C4D5E6F7G8H9J0K1MNPZ",
"plan_id": "vpl_01JAB3C4D5E6F7G8H9J0K1MNPV",
"plan_version_id": "vpv_01JAB3C4D5E6F7G8H9J0K1MNPW",
"plan_version": 2,
"subscription_id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0"
}Rejected: unknown-source
{
"member": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
},
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"kind": "channel_subscription",
"active": true,
"expires_at": "2026-10-23T10:00:00.000Z",
"cancel_at_period_end": false,
"previous": null,
"reason": "granted",
"source": "webhook",
"billing_event_id": "evt_01JAB3C4D5E6F7G8H9J0K1MNPY",
"membership_id": "vms_01JAB3C4D5E6F7G8H9J0K1MNPZ",
"plan_id": "vpl_01JAB3C4D5E6F7G8H9J0K1MNPV",
"plan_version_id": "vpv_01JAB3C4D5E6F7G8H9J0K1MNPW",
"plan_version": 2,
"subscription_id": "sub_01JAB3C4D5E6F7G8H9J0K1MNQ0"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('vip.membership.changed@1', value); // { valid, errors: [{ path, message }] }