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

FieldTypeRequiredDescriptionConstraints
memberidentity.subject-refyes
creatoridentity.subject-refyes
kindstringyesBilling entitlement kind; channel_subscription today.
activebooleanyes
expires_atstring | nullyes
cancel_at_period_endbooleanyes
previousobject | nullyesThe projection before the change; null on first sight.
reasonstring | nullyesBilling's reason (granted, renewed, refund, expired…) or VIP's (checked, cancel_scheduled).
sourceenumyes
  • one of "event", "billing_check", "import"
billing_event_idstring | nullyesThe Billing event (evt_…) behind the change, when it came from one.
membership_idstring | nullyes
  • pattern ^vms_[0-9A-HJKMNP-TV-Z]{26}$
plan_idstring | nullyes
plan_version_idstring | nullyes
plan_versioninteger | nullyes
  • minimum 1
subscription_idstring | nullyesThe 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 }] }