Examples / commerce-offer

commerce-offer.json

targets v0.18.0 3 entities 8 schemas

Penguin Classics paperback: rig.commerce.offer (item + seller), rig.commerce.price (GBP amount, not a formatted string), rig.commerce.discount (percent 20), validity as rig.calendar.span. Not a cart or tax engine.

Speaks

rig.book.identifier · rig.book.publication · rig.calendar.span · rig.commerce.discount · rig.commerce.offer · rig.commerce.price · rig.meta.named · rig.organisation.identity

Document

Validates under npm run checkraw file.

{
  "rig": "0.18.0",
  "document": {
    "title": "Commerce offer (price / discount)",
    "createdAt": "2026-08-18"
  },
  "entities": [
    {
      "id": "penguin",
      "components": {
        "rig.meta.named": {
          "name": "Penguin Classics",
          "stableId": "penguin"
        },
        "rig.organisation.identity": {
          "registrationNumber": "GB-PENGUIN"
        }
      }
    },
    {
      "id": "moby-dick",
      "components": {
        "rig.meta.named": {
          "name": "Moby-Dick",
          "stableId": "moby-dick"
        },
        "rig.book.identifier": {
          "isbn13": "9780142437247"
        },
        "rig.book.publication": {
          "publisher": "penguin",
          "publishedDate": "2003",
          "productForm": "paperback"
        }
      }
    },
    {
      "id": "autumn-sale",
      "components": {
        "rig.meta.named": {
          "name": "Autumn paperback",
          "stableId": "autumn-sale"
        },
        "rig.commerce.offer": {
          "item": "moby-dick",
          "seller": "penguin",
          "availability": "in-stock",
          "sku": "PC-MOBY-PB"
        },
        "rig.commerce.price": {
          "amount": 10.99,
          "currency": "GBP",
          "unit": "each",
          "vatIncluded": true
        },
        "rig.commerce.discount": {
          "kind": "percent",
          "percent": 20,
          "code": "AUTUMN20"
        },
        "rig.calendar.span": {
          "startDate": "2026-08-01",
          "endDate": "2026-08-31"
        }
      }
    }
  ]
}