BillingAdminRequest billing.admin-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/admin-request.v1.json

billing.admin-request@1: bodies of billing.ledger.admin on OpenVibe.Billing (operators). POST /api/v1/admin/freeze: { on, reason? } (unfreezing processes the provider deliveries stored meanwhile; allowed while frozen). POST /api/v1/admin/adjustments: { from, to, amount, reason, relates_to? } moves value between two accounts of one currency. POST /api/v1/purchases/settle: { provider, provider_ref, subject?, amount_cents, bits, intent_id?, test? } books a provider receipt. POST /api/v1/admin/provider-events/:id/reprocess, POST /api/v1/admin/sweep and the GETs (freeze, reconcile, provider-events, import-holds) take no body. Adjustments and settlements need an Idempotency-Key and are refused while frozen.

Fields

This schema has no named fields.

Examples

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

Valid: adjustment
{
  "from": {
    "kind": "platform_revenue",
    "owner": null,
    "currency": "vibes-bits"
  },
  "to": {
    "kind": "user_credit",
    "owner": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "currency": "vibes-bits"
  },
  "amount": 250,
  "reason": "goodwill after the outage"
}
Valid: freeze
{
  "on": true,
  "reason": "provider incident"
}
Rejected: freeze-not-boolean
{
  "on": "yes"
}
Rejected: unknown-account
{
  "from": {
    "kind": "wallet",
    "currency": "vibes-bits"
  },
  "to": {
    "kind": "user_credit",
    "currency": "vibes-bits"
  },
  "amount": 1,
  "reason": "x"
}

Validate

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