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

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

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

# CouponsCouponCreatedPayload `coupons.coupon.created@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.created.v1.json`](/docs/contracts/coupons.coupon.created.json)

coupons.coupon.created v1 (OpenVibe.Coupons server/domain/coupons.js submit and importFromSource, payload from lifecyclePayload). A new code was recorded, in the transaction that inserted it: submitted by a member, by staff or by an AI extraction run (POST /api/v1/coupons/submit or the site form), or imported from an OpenVibe.Sources item (origin source). Submitting a code the merchant already has adds evidence and emits no created event. A new code always starts with status unknown and confidence null: a submission can never carry a status or a confidence. AI-extracted codes, imported codes (unless COUPONS\_SOURCES\_AUTO\_PUBLISH is true and the merchant is active) and codes for a pending merchant start with review\_state pending. Left out on purpose: the code text, title, description and restrictions (Search gets them from coupons.index\_document.\*) and who submitted it (submitters stay inside Coupons). Envelope: subject { type: coupon, id: cpn\_… }, visibility public when the new code is publicly listed (published, merchant active, not expired), 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` | const | yes | Every new code starts unknown; only people's reports can move it to reported\_working or reported\_failed. | - `= "unknown"` |
| `confidence` | null | yes | Always null at creation: no counted report yet. |  |
| `review_state` | enum | yes | pending = waits for staff review (AI-extracted, imported without auto-publish, or merchant pending); published = eligible for active results. | - `one of "pending", "published"` |
| `expires_at` | string \| null | yes | Known expiry (UTC; a date-only expiry is 23:59:59.999Z of that day). null = expiry unknown, never defaulted. | - `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` |
| `origin` | enum | yes | How the code arrived: a member's or a staff member's submission, an OpenVibe.Sources import, or an AI extraction run (X-OV-Origin: ai). | - `one of "member", "staff", "source", "ai"` |

## Examples

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

 Valid: ai-pending-dated

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "unknown",
  "confidence": null,
  "review_state": "pending",
  "expires_at": "2026-10-31T23:59:59.999Z",
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R9B2C3D4E5F6G7H8J9K0MN",
  "origin": "ai"
}
~~~~

Valid: member-published

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

Rejected: missing-origin

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

Rejected: names-submitter

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "unknown",
  "confidence": null,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "origin": "member",
  "created_by": "usr_01K5R5E4F3G2H1J0K9M8N7P6QR"
}
~~~~

Rejected: with-confidence

~~~~
{
  "merchant_id": "mer_01K5R7A1B2C3D4E5F6G7H8J9KM",
  "status": "reported_working",
  "confidence": 0.99,
  "review_state": "published",
  "expires_at": null,
  "canonical_url": "https://openvibe.coupons/c/cpn_01K5R8Z3Q4M2N7P9T1V6W8X0YA",
  "origin": "member"
}
~~~~

## Validate

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