DealsOfferResult deals.offer-result@1

Generated at from openvibe-contracts v0.53.0 and openvibe-sdk v0.11.0.

Version
1.0.0
Owner
deals
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/deals/offer-result.v1.json

deals.offer-result@1: the answer of the deal writes on OpenVibe.Deals: { offer } (the canonical offer after the change). POST /api/v1/offers (201), PATCH /api/v1/offers/:id, POST …/expire, …/disable, …/enable and …/review answer exactly that; POST …/observations (201) adds the observation recorded; POST …/merge adds merged { id, slug } and the before/after of the change; POST …/unmerge adds from { id, slug } and before/after.

Fields

FieldTypeRequiredDescriptionConstraints
offerdeals.offeryes
observationobject
observation.idstringyes
observation.observed_atstring | nullyes
  • format date-time
observation.recorded_atstring | null
  • format date-time
observation.pricestring | null
observation.currencystring | null
observation.shippingstring | null
observation.shipping_notestring | null
observation.conditionenum
  • one of "new", "used", "refurbished", "damaged", null
observation.availabilityenum
  • one of "in_stock", "out_of_stock", "preorder", "discontinued", "limited", "sold_out", "online_only", "in_store_only", null
observation.originstringyes
observation.observed_bystring | null
observation.listingstring | null
observation.sourceobjectyes
observation.source.idstring | null
observation.source.kindstring | null
observation.source.refobject | null
observation.source.keystring | null
observation.source.urlstring | null
mergedobject
merged.idstring
merged.slugstring
fromobject
from.idstring
from.slugstring
beforeany
afterany

Examples

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

Valid: observed
{
  "offer": {
    "id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "slug": "usb-c-capture-card-79",
    "url": "https://openvibe.deals/d/usb-c-capture-card-79",
    "title": "USB-C 4K capture card for $79.99",
    "description": null,
    "link": "https://shop.example.com/capture-card",
    "status": "active",
    "category": "streaming",
    "origin": "community",
    "submitted_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "text_origin": "human",
    "review_state": null,
    "ai_summary": null,
    "expires_at": null,
    "expired_at": null,
    "expired_reason": null,
    "disabled_reason": null,
    "created_at": "2026-09-25T18:00:00.000Z",
    "updated_at": "2026-09-25T18:00:00.000Z",
    "store": {
      "id": "dst_1",
      "domain": "shop.example.com",
      "name": "Example Shop",
      "url": "https://openvibe.deals/s/shop.example.com"
    },
    "product": null,
    "latest_observation": {
      "id": "dob_01JAB2C3D4E5F6G7H8J9K0MNPQ",
      "observed_at": "2026-09-25T18:00:00.000Z",
      "recorded_at": "2026-09-25T18:00:02.000Z",
      "price": "79.99",
      "currency": "USD",
      "shipping": "0",
      "shipping_note": null,
      "condition": "new",
      "availability": "in_stock",
      "origin": "community",
      "observed_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
      "listing": "dof_01JAB2C3D4E5F6G7H8J9K0MNPR",
      "source": {
        "id": "dsr_01JAB2C3D4E5F6G7H8J9K0MNPS",
        "kind": "community",
        "ref": null,
        "key": null,
        "url": null
      }
    },
    "freshness": {
      "state": "fresh"
    },
    "observations": [
      {
        "id": "dob_01JAB2C3D4E5F6G7H8J9K0MNPQ",
        "observed_at": "2026-09-25T18:00:00.000Z",
        "recorded_at": "2026-09-25T18:00:02.000Z",
        "price": "79.99",
        "currency": "USD",
        "shipping": "0",
        "shipping_note": null,
        "condition": "new",
        "availability": "in_stock",
        "origin": "community",
        "observed_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
        "listing": "dof_01JAB2C3D4E5F6G7H8J9K0MNPR",
        "source": {
          "id": "dsr_01JAB2C3D4E5F6G7H8J9K0MNPS",
          "kind": "community",
          "ref": null,
          "key": null,
          "url": null
        }
      }
    ],
    "sources": [],
    "merged_from": [],
    "votes": {
      "up": 12,
      "down": 1,
      "up_weight": 11.5,
      "down_weight": 1
    },
    "hotness": null,
    "indexability": {
      "indexable": true,
      "robots": "index,follow",
      "reasons": []
    }
  },
  "observation": {
    "id": "dob_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "observed_at": "2026-09-25T18:00:00.000Z",
    "recorded_at": "2026-09-25T18:00:02.000Z",
    "price": "79.99",
    "currency": "USD",
    "shipping": "0",
    "shipping_note": null,
    "condition": "new",
    "availability": "in_stock",
    "origin": "community",
    "observed_by": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
    "listing": "dof_01JAB2C3D4E5F6G7H8J9K0MNPR",
    "source": {
      "id": "dsr_01JAB2C3D4E5F6G7H8J9K0MNPS",
      "kind": "community",
      "ref": null,
      "key": null,
      "url": null
    }
  }
}
Rejected: no-offer
{
  "observation": {}
}

Validate

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