BillingIntent billing.intent@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/intent.v1.json

billing.intent@1: a checkout intent as OpenVibe.Billing presents it (server/ops/intents.js present): what a person is about to pay a provider for (a Vibes purchase or a channel subscription), priced by Billing.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^pi_
providerstringyes
provider_refstring | nullyes
kindenumyes
  • one of "purchase", "subscription"
subjectidentity.subject-refyes
streamerone ofyes
amount_centsintegeryes
  • minimum 0
fee_centsintegeryes
  • minimum 0
bitsintegeryes
  • minimum 0
routestring | nullyes
auto_renewinteger | boolean
statusstringyescreated, settled, failed, …
settled_txnstring | nullyes
created_atstringyes
checkout_refstringPowerChat only: pcorder:<id> or pcsub:<id>, echoed back by its webhook.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: purchase
{
  "id": "pi_01JAB2C3D4E5F6G7H8J9K0MNPX",
  "provider": "stripe",
  "provider_ref": "cs_test_a1",
  "kind": "purchase",
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "streamer": null,
  "amount_cents": 999,
  "fee_cents": 0,
  "bits": 1000,
  "route": null,
  "auto_renew": 0,
  "status": "created",
  "settled_txn": null,
  "created_at": "2026-09-25T18:00:00.000Z"
}
Rejected: unknown-kind
{
  "id": "pi_01JAB2C3D4E5F6G7H8J9K0MNPX",
  "provider": "stripe",
  "provider_ref": "cs_test_a1",
  "kind": "donation",
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "streamer": null,
  "amount_cents": 999,
  "fee_cents": 0,
  "bits": 1000,
  "route": null,
  "auto_renew": 0,
  "status": "created",
  "settled_txn": null,
  "created_at": "2026-09-25T18:00:00.000Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('billing.intent@1', value);   // { valid, errors: [{ path, message }] }