Skip to content

Paid Subscription Operations

Paid subscriptions allow accounts to offer tiered recurring services payable in VIZ tokens with optional auto-renewal.


set_paid_subscription_operation (ID 50)

Auth: active of account

Creates or updates a subscription offering. A create_paid_subscription_fee is charged on first creation.

FieldTypeDescription
accountaccount_name_typeAccount offering the subscription
urlstringURL with subscription details
levelsuint16_tNumber of subscription tiers (≥ 1)
amountasset (VIZ)Base price per period per unit level
perioduint16_tSubscription period in days (≥ 1)
json
[50, {
  "account": "alice",
  "url": "https://alice.example.com/subscribe",
  "levels": 3,
  "amount": "10.000 VIZ",
  "period": 30
}]
  • Actual cost for a subscriber = amount × level.
  • levels = 3 with amount = "10.000 VIZ" → tier 1 costs 10 VIZ, tier 2 costs 20 VIZ, tier 3 costs 30 VIZ per period.
  • Updating this operation changes the parameters for future subscriptions; existing active subscriptions continue at the previous terms until renewal.

Auth: active of subscriber

Subscribes to or renews a paid subscription. Tokens transfer immediately from subscriber to account.

FieldTypeDescription
subscriberaccount_name_typeSubscribing account
accountaccount_name_typeAccount offering the subscription
leveluint16_tSubscription tier (1 – levels)
amountasset (VIZ)Payment amount
perioduint16_tNumber of periods to pay for
auto_renewalboolEnable automatic renewal each period
json
[51, {
  "subscriber": "bob",
  "account": "alice",
  "level": 2,
  "amount": "20.000 VIZ",
  "period": 1,
  "auto_renewal": true
}]
  • amount must match subscription.amount × level × period exactly.
  • level must be in range [1, subscription.levels].
  • auto_renewal: true — tokens are deducted automatically each period while sufficient balance exists.
  • auto_renewal: false — one-time subscription; expires after the paid period.

Virtual operations:

Virtual OpTrigger
paid_subscription_action_operationPayment processed
cancel_paid_subscription_operationSubscription expires or is cancelled

See also: Data Types, Operations Overview, Virtual Operations.