Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Reference — Metadata schemas · Boson Protocol
Skip to content

Metadata schemas

Each Boson offer (and the seller / collection / voucher entities around it) carries an off-chain metadata document pinned to IPFS, with its content hash stored on-chain. The schemas below define those documents.

@bosonprotocol/metadata wraps each schema with yup (via schema-to-yup) and exposes a validator per type. The JSON Schema is the source of truth.

Helpers

import {
  productV1MetadataSchema,
  bundleMetadataSchema,
  validateMetadata,
  createVariantProductMetadata,
} from "@bosonprotocol/metadata"
 
// There are no `*MetadataFactory()` helpersconstruct the metadata object
// directly against the schema's required fields. `validateMetadata` (Yup)
// raises if anything is missing.
const metadata = {
  schemaUrl: "https://schema.org/Product",
  type: "PRODUCT_V1" as const,
  uuid: crypto.randomUUID(),
  // …all other required fields
}
validateMetadata(metadata as any)  // throws on invalid; no return value

For PRODUCT_V1 offers with variants (e.g. multiple sizes), use createVariantProductMetadata(baseMetadata, variants) — that's the only metadata-building helper exported by the package.

BASE

Source: packages/metadata/src/base/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"BASE"yes
namestringyes
descriptionstringyes
imagestringno
imageDatastringno
externalUrlstringyes
licenseUrlstringyes
conditionstringno
animationUrlstringno
youtubeUrlstringno
attributesobject[] — see attributes[]no

attributes[]

FieldTypeRequiredDescription
traitTypestringyes
valuestringyes
displayTypestringno

PRODUCT_V1

Source: packages/metadata/src/product-v1/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"PRODUCT_V1"yes
uuidstringyes
namestringyes
descriptionstringyes
externalUrlstringyes
licenseUrlstringyes
youtubeUrlstringno
conditionstringno
imagestringyes
imageDatastringno
animationUrlstringno
attributesobject[] — see attributes[]yes
productobject — see productyes
variationsobject[] — see variations[]no
sellerobject — see selleryes
shippingobject — see shippingyes
exchangePolicyobject — see exchangePolicyyes
productOverridesobject — see productOverridesno

attributes[]

FieldTypeRequiredDescription
traitTypestringyes
valuestringyes
displayTypestringno

product

FieldTypeRequiredDescription
uuidstringyes
versionnumberyes
titlestringyes
descriptionstringyes
identification_sKUstringno
identification_productIdstringno
identification_productIdTypestringno
productionInformation_brandNamestringyes
productionInformation_manufacturerstringno
productionInformation_manufacturerPartNumberstringno
productionInformation_modelNumberstringno
productionInformation_materialsstring[]no
details_categorystringno
details_subCategorystringno
details_subCategory2stringno
details_offerCategory"PHYSICAL" | "PHYGITAL" | "DIGITAL"yes
details_tagsstring[]no
details_sectionsstring[]no
details_personalisationstring[]no
visuals_imagesobject[] — see product.visuals_images[]yes
visuals_videosobject[] — see product.visuals_videos[]no

variations[]

FieldTypeRequiredDescription
typestringyes
optionstringyes

seller

FieldTypeRequiredDescription
defaultVersionnumberyes
namestringyes
descriptionstringno
externalUrlstringno
tokenIdstringno
imagesobject[] — see seller.images[]no
contactLinksobject[] — see seller.contactLinks[]yes

shipping

FieldTypeRequiredDescription
defaultVersionnumberno
countryOfOriginstringno
supportedJurisdictionsobject[] — see shipping.supportedJurisdictions[]no
redemptionPointstringno
returnPeriodstringyes

exchangePolicy

FieldTypeRequiredDescription
uuidstringyes
versionnumberyes
labelstringno
templatestringyes
sellerContactMethodstringyes
disputeResolverContactMethodstringyes

productOverrides

FieldTypeRequiredDescription
titlestringno
descriptionstringno
identification_sKUstringno
identification_productIdstringno
identification_productIdTypestringno
productionInformation_brandNamestringno
productionInformation_manufacturerstringno
productionInformation_manufacturerPartNumberstringno
productionInformation_modelNumberstringno
productionInformation_materialsstring[]no
visuals_imagesobject[] — see productOverrides.visuals_images[]no
visuals_videosobject[] — see productOverrides.visuals_videos[]no

product.visuals_images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

product.visuals_videos[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

seller.images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

seller.contactLinks[]

FieldTypeRequiredDescription
urlstringyes
tagstringyes

shipping.supportedJurisdictions[]

FieldTypeRequiredDescription
labelstringyes
deliveryTimestringyes

productOverrides.visuals_images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

productOverrides.visuals_videos[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

BUNDLE

Source: packages/metadata/src/bundle/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"BUNDLE"yes
namestringyes
descriptionstringyes
imagestringno
imageDatastringno
externalUrlstringyes
licenseUrlstringyes
youtubeUrlstringno
conditionstringno
animationUrlstringno
attributesobject[] — see attributes[]no
bundleUuidstringyes
sellerobject — see selleryes
itemsobject[] — see items[]yes

attributes[]

FieldTypeRequiredDescription
traitTypestringyes
valuestringyes
displayTypestringno

seller

FieldTypeRequiredDescription
defaultVersionnumberyes
namestringyes
descriptionstringno
externalUrlstringno
tokenIdstringno
imagesobject[] — see seller.images[]no
contactLinksobject[] — see seller.contactLinks[]yes

items[]

FieldTypeRequiredDescription
urlstringyes

seller.images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

seller.contactLinks[]

FieldTypeRequiredDescription
urlstringyes
tagstringyes

ProductV1 bundle item

Source: packages/metadata/src/productV1Item/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"ITEM_PRODUCT_V1"yes
uuidstringyes
productobject — see productyes
variationsobject[] — see variations[]no
shippingobject — see shippingyes
exchangePolicyobject — see exchangePolicyyes
productOverridesobject — see productOverridesno

product

FieldTypeRequiredDescription
uuidstringyes
versionnumberyes
titlestringyes
descriptionstringyes
identification_sKUstringno
identification_productIdstringno
identification_productIdTypestringno
productionInformation_brandNamestringyes
productionInformation_manufacturerstringno
productionInformation_manufacturerPartNumberstringno
productionInformation_modelNumberstringno
productionInformation_materialsstring[]no
details_categorystringno
details_subCategorystringno
details_subCategory2stringno
details_offerCategory"PHYSICAL" | "PHYGITAL" | "DIGITAL"yes
details_tagsstring[]no
details_sectionsstring[]no
details_personalisationstring[]no
visuals_imagesobject[] — see product.visuals_images[]yes
visuals_videosobject[] — see product.visuals_videos[]no

variations[]

FieldTypeRequiredDescription
typestringyes
optionstringyes

shipping

FieldTypeRequiredDescription
defaultVersionnumberno
countryOfOriginstringno
supportedJurisdictionsobject[] — see shipping.supportedJurisdictions[]no
redemptionPointstringno
returnPeriodstringyes

exchangePolicy

FieldTypeRequiredDescription
uuidstringyes
versionnumberyes
labelstringno
templatestringyes
sellerContactMethodstringyes
disputeResolverContactMethodstringyes

productOverrides

FieldTypeRequiredDescription
titlestringno
descriptionstringno
identification_sKUstringno
identification_productIdstringno
identification_productIdTypestringno
productionInformation_brandNamestringno
productionInformation_manufacturerstringno
productionInformation_manufacturerPartNumberstringno
productionInformation_modelNumberstringno
productionInformation_materialsstring[]no
visuals_imagesobject[] — see productOverrides.visuals_images[]no
visuals_videosobject[] — see productOverrides.visuals_videos[]no

product.visuals_images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

product.visuals_videos[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

shipping.supportedJurisdictions[]

FieldTypeRequiredDescription
labelstringyes
deliveryTimestringyes

productOverrides.visuals_images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

productOverrides.visuals_videos[]

FieldTypeRequiredDescription
urlstringyes
tagstringno

NFT bundle item

Source: packages/metadata/src/nftItem/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"ITEM_NFT"yes
namestringyes
descriptionstringno
imagestringno
imageDatastringno
externalUrlstringno
animationUrlstringno
youtubeUrlstringno
image_datastringno
external_urlstringno
animation_urlstringno
youtube_urlstringno
attributesobject[] — see attributes[]no
chainIdnumberno
contractstringno
tokenIdstringno
tokenIdRangeobject — see tokenIdRangeno
termsobject[] — see terms[]no
quantitynumberno

attributes[]

FieldTypeRequiredDescription
traitTypestringno
trait_typestringno
valuestringyes
displayTypestringno
display_typestringno

tokenIdRange

FieldTypeRequiredDescription
minstringno
maxstringno

terms[]

FieldTypeRequiredDescription
keystringyes
valuestringyes
displayKeystringno

rNFT

Source: packages/metadata/src/rNFT/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"rNFT"yes
namestringyes
descriptionstringyes
imagestringno
externalUrlstringyes
licenseUrlstringyes
conditionstringno
animationUrlstringno
attributesobject[] — see attributes[]no

attributes[]

FieldTypeRequiredDescription
traitTypestringyes
valuestringyes
displayTypestringno

SELLER

Source: packages/metadata/src/seller/schema.json

FieldTypeRequiredDescription
type"SELLER"yes
namestringno
descriptionstringno
legalTradingNamestringno
kindstringyes
websitestringno
imagesobject[] — see images[]no
contactLinksobject[] — see contactLinks[]no
contactPreferencestringyes
socialLinksobject[] — see socialLinks[]no
salesChannelsobject[] — see salesChannels[]no

images[]

FieldTypeRequiredDescription
urlstringyes
tagstringno
typestringyes
widthnumberno
heightnumberno
fitstringno
positionstringno

contactLinks[]

FieldTypeRequiredDescription
urlstringyes
tagstringyes

socialLinks[]

FieldTypeRequiredDescription
urlstringyes
tagstringyes

salesChannels[]

FieldTypeRequiredDescription
tagstringyes
namestringno
settingsUrlstringno
settingsEditorstringno
linkstringno
deploymentsobject[] — see salesChannels[].deployments[]no

salesChannels[].deployments[]

FieldTypeRequiredDescription
productobject — see salesChannels[].deployments[].productno
statusstringno
linkstringno
lastUpdatedstringno

salesChannels[].deployments[].product

FieldTypeRequiredDescription
uuidstringno
versionnumberno

COLLECTION

Source: packages/metadata/src/collection/schema.json

FieldTypeRequiredDescription
schemaUrlstringyes
type"COLLECTION"yes
namestringyes
descriptionstringno
imagestringno
externalLinkstringno
external_linkstringno
collaboratorsstring[]no

Source

Related