TipsExternalRequest tips.external-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- tips
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/tips/external-request.v1.json
tips.external-request@1: the body of tips.interaction.record on OpenVibe.Tips (services only). POST /api/v1/interactions/external: { creator, provider, provider_ref, amount_cents, supporter?, supporter_name?, message?, goal_id?, privacy?, announce?, test? } records a tip that never touched OpenVibe money (ADR-012 EXTERNAL: a tip on the creator's own PowerChat), once per (provider, provider_ref); no Billing liability, excluded from Billing reconciliation. It settles at once (overlay alert, goal); announce true also has Tips post the chat line. Needs an Idempotency-Key header (8-200 of A-Z a-z 0-9 . _ : -; 400 idempotency.key_required): a replay with the same key and body returns the first answer, the same key with another body is 422 idempotency.key_reused. Refusals are problem+json: 422 tips.invalid_input (no provider or provider_ref), tips.invalid_amount, tips.text_too_long or tips.invalid_subject; 404 tips.creator_not_found; 403 capability.denied. Unknown fields are ignored.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
creator | one of | yes | The creator tipped. | |
provider | string | yes | Lowercased: powerchat, … |
|
provider_ref | string | yes | The provider's event id. |
|
amount_cents | integer | string | yes | The money that arrived, in cents (at most 100000000); recorded as the amount too. |
|
supporter | one of | The supporter, when known. | ||
supporter_name | string | null | |||
message | string | null |
| ||
goal_id | string | |||
privacy | object | The supporter's choices; any other field is refused (422 tips.invalid_input). true, 1, "1", "true" and "on" count as yes. |
| |
privacy.anonymous | boolean | integer | string | The name reads "Anonymous" to everyone but the supporter. | ||
privacy.hide_amount | boolean | integer | string | The amount is left out of overlays, chat lines and public pages. | ||
privacy.private_message | boolean | integer | string | A tip's message is for the creator only (tips only; 422 for the other kinds). | ||
announce | boolean | true: Tips delivers the chat line itself (the provider did not announce it). | ||
test | boolean | integer | string | Test money: never counted. |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: powerchat
{
"creator": {
"type": "user",
"id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
},
"provider": "powerchat",
"provider_ref": "pcevt_7730021",
"amount_cents": 500,
"supporter_name": "moosefan",
"message": "Love the stream",
"announce": false
}Rejected: no-ref
{
"creator": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"provider": "powerchat",
"amount_cents": 500
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('tips.external-request@1', value); // { valid, errors: [{ path, message }] }