BillingCashoutDecision billing.cashout-decision@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/cashout-decision.v1.json

billing.cashout-decision@1: bodies of billing.cashout.manage on OpenVibe.Billing (staff). POST /api/v1/cashouts/:id/approve: { payout_reference, payout_provider? } after the payout was sent (payout_provider defaults to paypal; refused while the cashout is in escrow). POST /api/v1/cashouts/:id/deny: { reason? } returns the bits to the person's payable. GET /api/v1/cashouts takes 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: approve
{
  "payout_reference": "PAYID-M5A7",
  "payout_provider": "paypal"
}
Valid: deny
{
  "reason": "address bounced"
}
Rejected: empty-reference
{
  "payout_reference": ""
}

Validate

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