---
title: "coupons.coupon.updated@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/coupons.coupon.updated"
updated: null
---

# coupons.coupon.updated@1 · OpenVibe.Services

HTML: [coupons.coupon.updated@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/coupons.coupon.updated)

# CouponsCouponUpdatedPayload `coupons.coupon.updated@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: coupons
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/events/payloads/coupons.coupon.updated.v1.json`](/docs/contracts/coupons.coupon.updated.json)

coupons.coupon.updated v1 (OpenVibe.Coupons server/domain/coupons.js recompute, approve and setExpiry, payload from lifecyclePayload). Emitted in the transaction of the change when (a) a code's status moved to unknown, reported\_working or reported\_failed: people's reports through the confidence formula (reason report), evidence added or withdrawn (evidence), old reports decaying (decay), or staff or a service re-enabling a disabled or expired code (staff, service:<client>\[:<note>\]); (b) staff published a code that waited for review (reason approved; status unchanged, so previous\_status equals status and may be any status); or (c) the code's expiry was set or cleared (reason expiry\_changed, no previous\_status; setExpiry has no HTTP route yet). A move to expired or disabled is coupons.coupon.expired or coupons.coupon.disabled instead, and a confidence change without a status change emits only coupons.confidence.changed. Staff notes are reduced to reason staff; a service's note is copied into the reason. Never names a submitter, reporter or staff member. Envelope: subject { type: coupon, id: cpn\_… }, visibility public when the code is publicly listed after the change (recompute: before or after), otherwise internal, priority important (not set: the Events default), actor service:coupons. No known consumers.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `merchant_id` | string | yes | The merchant the code belongs to. | - `pattern ^mer_[0-9A-HJKMNP-TV-Z]{26}$` |
| `status` | enum | yes | Status after the change. expired and disabled occur only with reason approved or expiry\_changed (neither moves the status). | - `one of "unknown", "reported_working", "reported_failed", "expired", "disabled"` |
| `confidence` | number \| null | yes | Report confidence after the change, rounded to 2 decimals; null = no counted report in the last 30 days. | - `minimum 0`<br>- `maximum 1` |
| `review_state` | enum | yes |  | - `one of "pending", "published"` |
| `expires_at` | string \| null | yes | Known expiry (UTC); null = expiry unknown. | - `format date-time` |
| `canonical_url` | string | yes | The code's page on Coupons (<origin>/c/<coupon id>). | - `pattern ^https?://`<br>- `format uri`<br>- `maxLength 2048` |
| `previous_status` | enum |  | Status before the change. Absent with reason expiry\_changed. | - `one of "unknown", "reported_working", "reported_failed", "expired", "disabled"` |
| `reason` | one of | yes | Why it changed: report, evidence, decay, staff, approved, expiry\_changed, or service:<client>\[:<note>\] when a service holding coupons.status.update re-enabled it. |  |

## Examples

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

 Valid: expiry-changed

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "unknown",
  "confidence": null,
  "review_state": "published",
  "expires_at": "2026-12-31T23:59:59.999Z",
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "reason": "expiry_changed"
}
~~~~

Valid: report-working

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "reported_working",
  "confidence": 0.67,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "previous_status": "unknown",
  "reason": "report"
}
~~~~

Valid: service-reenabled

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "unknown",
  "confidence": null,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "previous_status": "disabled",
  "reason": "service:moderation:takedown reviewed, code restored"
}
~~~~

Rejected: bad-merchant-id

~~~~
{
  "merchant_id": "acme-outdoor",
  "status": "reported_working",
  "confidence": 0.67,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "previous_status": "unknown",
  "reason": "report"
}
~~~~

Rejected: free-text-reason

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "reported_failed",
  "confidence": 0.33,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "previous_status": "unknown",
  "reason": "staff:customer complained"
}
~~~~

Rejected: missing-reason

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "reported_working",
  "confidence": 0.67,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "previous_status": "unknown"
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('coupons.coupon.updated@1', value);   // { valid, errors: [{ path, message }] }
~~~~
