BillingSubscriptionRequest billing.subscription-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/billing/subscription-request.v1.json
billing.subscription-request@1: the body of POST /api/v1/subscriptions on OpenVibe.Billing (billing.subscription.manage): pay one period of subscriber → streamer, from the subscriber's credit (source credit, the default) or from a provider receipt (source receipt, which also needs billing.ledger.admin: claiming money was received is operator grade). POST /api/v1/subscriptions/:id/cancel (cancels at the period end, with the provider too) and the GETs take no body. Every mutating call needs an Idempotency-Key header (a replay with the same key and body returns the first answer) and is refused with 503 billing.frozen while the economy is frozen. Refusals are problem+json (billing.invalid_input, billing.invalid_amount, billing.insufficient_funds, …).
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: credit
{
"subscriber": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"streamer": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"source": "credit",
"auto_renew": true
}Rejected: unknown-source
{
"subscriber": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"streamer": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"source": "gift"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.subscription-request@1', value); // { valid, errors: [{ path, message }] }