BillingCreditHoldReleaseResult billing.credit-hold-release-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-release-result.v1.json

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

Fields

FieldTypeRequiredDescriptionConstraints
hold_idstringyes
  • pattern ^hld_[0-9A-HJKMNP-TV-Z]{26}$
released_nano_usdhttps://openvibe.network/contracts/billing/credit-hold-release-result.v1.json#/$defs/money-nano-usdyes

Examples

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

Valid: full
{
  "hold_id": "hld_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "released_nano_usd": "100000000"
}
Valid: partial
{
  "hold_id": "hld_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "released_nano_usd": "82000000"
}
Rejected: bad-id
{
  "hold_id": "hold_123",
  "released_nano_usd": "100000000"
}
Rejected: missing-id
{
  "released_nano_usd": "100000000"
}
Rejected: money-float
{
  "hold_id": "hld_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "released_nano_usd": "100000000.5"
}

Validate

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