BillingCreditHoldSettleResult billing.credit-hold-settle-result@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
billing
Visibility
internal
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/billing/credit-hold-settle-result.v1.json

billing.credit-hold-settle-result@1: response from POST /internal/credits/holds/:id/settle.

Fields

FieldTypeRequiredDescriptionConstraints
charge_nano_usdhttps://openvibe.network/contracts/billing/credit-hold-settle-result.v1.json#/$defs/money-nano-usdyes
released_nano_usdhttps://openvibe.network/contracts/billing/credit-hold-settle-result.v1.json#/$defs/money-nano-usdyes
journal_idstringyes
  • pattern ^txn_
shortfall_nano_usdstringUsage beyond the hold and the free balance: owed, not collected (nano-USD, D1).
  • pattern ^[0-9]{1,19}$

Examples

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

Valid: full
{
  "charge_nano_usd": "18000",
  "released_nano_usd": "82000000",
  "journal_id": "txn_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
Valid: zero
{
  "charge_nano_usd": "0",
  "released_nano_usd": "50000000",
  "journal_id": "txn_01JAB2C3D4E5F6G7H8J9K0MNPR"
}
Rejected: missing-journal
{
  "charge_nano_usd": "18000",
  "released_nano_usd": "82000000"
}
Rejected: money-float
{
  "charge_nano_usd": "18.5",
  "released_nano_usd": "82000000",
  "journal_id": "txn_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
Rejected: money-number
{
  "charge_nano_usd": 18000,
  "released_nano_usd": "82000000",
  "journal_id": "txn_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}

Validate

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