DealsOfferSubmitRequest deals.offer-submit-request@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-submit-request.v1.json
deals.offer-submit-request@1: the body of POST /api/v1/offers on OpenVibe.Deals (deals.offer.submit; a signed-in person, or a service acting for one; X-OV-Origin: ai holds the text for review). url (an http(s) link to the offer; a link already posted is 409 offer.duplicate) and title (3-200 characters) are required; a price or shipping cost needs its currency; expires_at may not be in the past. The first price observation is recorded with it.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
url | string | yes |
| |
title | string | yes |
| |
description | string | null |
| ||
category | string | null |
| ||
expires_at | string | null | |||
store_name | string | null |
| ||
product_slug | string | null | |||
product | object | Product aliases to resolve (or create) the product. | ||
product.name | string | |||
product.brand | string | null | |||
product.gtin | string |
| ||
product.mpn | string | |||
product.sku | string | |||
product.url | string | |||
product.category | string | null | |||
product.description | string | null | |||
price | string | number | null | A decimal amount; always with its currency. | ||
currency | string | null | ISO 4217; Deals never assumes one. |
| |
shipping | string | number | null | A decimal amount; always with its currency. | ||
shipping_note | string | null |
| ||
condition | enum |
| ||
availability | enum |
| ||
note | string | null |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: with-price
{
"url": "https://shop.example.com/capture-card",
"title": "USB-C 4K capture card for $79.99",
"category": "streaming",
"price": "79.99",
"currency": "USD",
"shipping": "0",
"availability": "in_stock",
"condition": "new"
}Rejected: not-http
{
"url": "ftp://shop.example.com/x",
"title": "ok title"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('deals.offer-submit-request@1', value); // { valid, errors: [{ path, message }] }