BillingCashoutRequest billing.cashout-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/cashout-request.v1.json

billing.cashout-request@1: bodies of billing.cashout.request on OpenVibe.Billing. POST /api/v1/cashouts: { subject, amount, payout_method: { type, address } } moves amount bits (at least the minimum cashout) from the person's payable into payouts pending, in escrow until staff pay it (a PayPal address must be an email). POST /api/v1/recycle: { subject, amount } turns payable back into the person's own spendable credit. GET /api/v1/cashouts/:id 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: cashout
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "amount": 5000,
  "payout_method": {
    "type": "paypal",
    "address": "[email protected]"
  }
}
Valid: recycle
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "amount": "1500"
}
Rejected: zero
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "amount": 0
}

Validate

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