Schemas / Commerce

rig.commerce.price

v0.32.0 · draft 4 fields 2 required

Fields

FieldTypeMeaning
amount float required Major-currency value (12.99, not pence)
currency string required ISO 4217 alpha-3, uppercase
unit enumeach · hour · day · week · month · year · metre · kilogram · other optional Optional. each / hour / day / week / month / year / metre / kilogram / other; absent = each
vatIncluded bool optional Optional. Whether amount includes VAT / sales tax; absent = unknown

Money amount of a thing or an offer. Format when present.

Field meanings follow ISO 20022 ActiveOrHistoricCurrencyAndAmount and schema.org PriceSpecification. This schema is those amount elements - not a formatted price string, a cart, or a tax engine.

amount and currency are required.

Do not store "£12.99". Do not put a list price and a sale price on one component - a sale is another rig.commerce.offer or a rig.commerce.discount on the offer.

Compose onto the offer entity (or onto the item when the price is the item's list price with no seller). Validity of a sale window is rig.calendar.span, not dates here.

JSON Schema

Resolves at https://rig.works/schemas/rig.commerce.price.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.commerce.price.schema.json",
  "title": "rig.commerce.price",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "amount": {
      "$ref": "./_defs.schema.json#/$defs/float"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "description": "ISO 4217 (ISO 20022 Ccy)."
    },
    "unit": {
      "type": "string",
      "enum": [
        "each",
        "hour",
        "day",
        "week",
        "month",
        "year",
        "metre",
        "kilogram",
        "other"
      ]
    },
    "vatIncluded": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    }
  },
  "required": [
    "amount",
    "currency"
  ],
  "description": "Money amount. Field meanings follow ISO 20022 ActiveOrHistoricCurrencyAndAmount and schema.org PriceSpecification. Not a formatted price string."
}

Seen in

commerce-offer.json