BillingTierRequest billing.tier-request@1
Generated at from
openvibe-contracts v0.221.0 and
openvibe-sdk v0.65.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/tier-request.v1.json
billing.tier-request@1: the body of PUT /api/v1/tiers/:streamer/:tier on OpenVibe.Billing (billing.tier.manage): the monthly price of one of a creator's subscription tiers (1 to max_tiers), which the creator chooses on the product that sells it (OpenVibe.VIP) and Billing keeps and charges (ADR-012: Billing prices, products never do). price_cents must be within Billing's bounds (min_price_cents to max_price_cents, from GET /api/v1/tiers/:streamer or /api/v1/rates). status archived stops new subscriptions to the tier; running ones renew at the price they were bought at. A tier without a row: tier 1 is sold at the site's default subscription price, any other tier is refused (billing.tier_unknown). GET /api/v1/tiers/:streamer takes no body. The PUT needs an Idempotency-Key header and is refused with 503 billing.frozen while the economy is frozen.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
price_cents | integer | string | yes | USD cents per period (a month). |
|
status | enum | active (the default) sells the tier; archived sells it no more. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: archived
{
"price_cents": "1500",
"status": "archived"
}Valid: price
{
"price_cents": 999
}Rejected: no-price
{
"status": "active"
}Rejected: unknown-status
{
"price_cents": 999,
"status": "paused"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.tier-request@1', value); // { valid, errors: [{ path, message }] }