CouponsReportRequest coupons.report-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- coupons
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/coupons/report-request.v1.json
coupons.report-request@1: the body of POST /api/v1/coupons/:id/report on OpenVibe.Coupons (coupons.report.create; people, installs and services acting for a person): whether the code worked, and for a failure why. The code must be in active results; you cannot report your own submission. Reporting again changes your earlier report.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
outcome | enum | yes |
| |
reason | enum | Failed reports only. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: failed
{
"outcome": "failed",
"reason": "min_spend_not_met"
}Rejected: worked-with-reason
{
"outcome": "worked",
"reason": "expired"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('coupons.report-request@1', value); // { valid, errors: [{ path, message }] }