DealsWatchMatchedPayload deals.watch.matched@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
deals
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/deals.watch.matched.v1.json

deals.watch.matched v1 (OpenVibe.Deals server/domain/watches.js onObservation). A person's keyword, product or price-below watch matched a fresh observation of an active offer, inside the transaction that recorded the observation. At most one event per (watch, observation); a keyword/product watch notifies once per offer, a price-below watch again only for a lower price. Saved searches (kind search) never notify. Envelope: subject { type: watch, id: <watch_id> }, visibility internal, priority important, actor service:deals. OpenVibe.Network turns it into a DEAL_WATCH_MATCH notification for payload.recipient (server/notifications/events-consumer.js). A price is the decimal exactly as stated, never inferred; null when the observation stated none.

Fields

FieldTypeRequiredDescriptionConstraints
watch_idstringyes
  • pattern ^dwt_[0-9A-HJKMNP-TV-Z]{26}$
recipientstringyesThe watch owner's user subject id: who is notified.
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
kindenumyes
  • one of "keyword", "product", "price_below"
querystring | nullyesKeywords of a keyword watch, or of a price-below watch without a product.
  • maxLength 200
product_idstring | nullyesDeals product id of a product or price-below watch.
  • maxLength 64
max_pricestring | nullyesPrice-below threshold as entered (decimal text, e.g. 19.99).
  • maxLength 40
currencystring | nullyesISO 4217 currency of max_price.
  • pattern ^[A-Z]{3}$
offer_idstringyesThe canonical (root) offer id (dof_…).
  • minLength 1
  • maxLength 64
offer_urlstringyesCanonical offer page URL on Deals.
  • pattern ^https?://
  • format uri
  • maxLength 2048
titlestringyes
  • minLength 1
  • maxLength 500
observationobjectyes
  • no other fields
observation.idstringyes
  • pattern ^dpo_[0-9A-HJKMNP-TV-Z]{26}$
observation.observed_atstringyes
  • format date-time
observation.pricestring | nullyesDecimal text as stated; null when the observation stated no price.
  • maxLength 40
observation.currencystring | nullyes
  • pattern ^[A-Z]{3}$
observation.availabilityenumyes
  • one of "in_stock", "out_of_stock", "preorder", "discontinued", "limited", "sold_out", "online_only", "in_store_only", null

Examples

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

Valid: keyword-no-price
{
  "watch_id": "dwt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "recipient": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "kind": "keyword",
  "query": "mechanical keyboard",
  "product_id": null,
  "max_price": null,
  "currency": null,
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPT",
  "offer_url": "https://openvibe.deals/d/keychron-q1-mechanical-keyboard",
  "title": "Keychron Q1 mechanical keyboard",
  "observation": {
    "id": "dpo_01JAB2C3D4E5F6G7H8J9K0MNPV",
    "observed_at": "2026-09-23T08:00:00.000Z",
    "price": null,
    "currency": null,
    "availability": null
  }
}
Valid: price-below
{
  "watch_id": "dwt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "recipient": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "kind": "price_below",
  "query": null,
  "product_id": "dpr_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "max_price": "199.99",
  "currency": "USD",
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPT",
  "offer_url": "https://openvibe.deals/d/steam-deck-oled-512gb",
  "title": "Steam Deck OLED 512 GB",
  "observation": {
    "id": "dpo_01JAB2C3D4E5F6G7H8J9K0MNPV",
    "observed_at": "2026-09-23T08:00:00.000Z",
    "price": "179.00",
    "currency": "USD",
    "availability": "in_stock"
  }
}
Rejected: numeric-recipient
{
  "watch_id": "dwt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "recipient": "42",
  "kind": "keyword",
  "query": "keyboard",
  "product_id": null,
  "max_price": null,
  "currency": null,
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPT",
  "offer_url": "https://openvibe.deals/d/keychron-q1",
  "title": "Keychron Q1",
  "observation": {
    "id": "dpo_01JAB2C3D4E5F6G7H8J9K0MNPV",
    "observed_at": "2026-09-23T08:00:00.000Z",
    "price": "89",
    "currency": "USD",
    "availability": "in_stock"
  }
}
Rejected: saved-search
{
  "watch_id": "dwt_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "recipient": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
  "kind": "search",
  "query": "keyboard",
  "product_id": null,
  "max_price": null,
  "currency": null,
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPT",
  "offer_url": "https://openvibe.deals/d/keychron-q1",
  "title": "Keychron Q1",
  "observation": {
    "id": "dpo_01JAB2C3D4E5F6G7H8J9K0MNPV",
    "observed_at": "2026-09-23T08:00:00.000Z",
    "price": null,
    "currency": null,
    "availability": null
  }
}

Validate

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