{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "@context": [
    "https://schemas.meta-aiml.org/v3.0.0/context.jsonld"
  ],
  "@id": "https://schemas.meta-aiml.org/v3.0.0/entity/ecommerce_store.json",
  "$id": "https://schemas.meta-aiml.org/v3.0.0/entity/ecommerce_store.json",
  "@type": "EcommerceStore",
  "schemaVersion": "3.0.0",
  "aimlVersion": "3.0.0",
  "title": "Ecommerce Store Entity Schema",
  "description": "v3 schema for first-party ecommerce stores as static website intelligence profile: stable commerce metadata plus external source links for dynamic catalog/pricing/review data.",
  "examples": [
    {
      "description": "Direct-to-consumer store with dynamic catalog and checkout automation",
      "reference": "ecommerce_store_example_d2c"
    },
    {
      "description": "Online retail store with subscriptions and loyalty program workflows",
      "reference": "ecommerce_store_example_loyalty"
    }
  ],
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "../ontology/digital_entity.json"
    },
    {
      "$ref": "../archetypes/direct_service.json"
    }
  ],
  "properties": {
    "@type": {
      "const": "EcommerceStore"
    },
    "ontologicalMode": {
      "const": "DigitalEntity"
    },
    "interactionArchetype": {
      "type": "array",
      "contains": {
        "const": "DirectService"
      },
      "items": {
        "type": "string",
        "enum": [
          "DirectService"
        ]
      }
    },
    "domain": {
      "const": "Commerce"
    },
    "businessModel": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Transactional",
          "Subscription",
          "Freemium"
        ]
      }
    },
    "deliveryFormat": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "WebApp",
          "MobileApp",
          "API"
        ]
      }
    },
    "name": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "description": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedText"
    },
    "shortDescription": {
      "$ref": "../components/multilingual_format.json#/$defs/LocalizedTextOrString"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "foundingDate": {
      "type": "string",
      "format": "date"
    },
    "properties": {
      "type": "object",
      "properties": {
        "catalogStrategy": {
          "type": "string",
          "enum": [
            "single_brand",
            "multi_brand",
            "niche",
            "broad"
          ]
        },
        "supportsPreorders": {
          "type": "boolean"
        },
        "supportsBackorders": {
          "type": "boolean"
        },
        "supportsInternationalShipping": {
          "type": "boolean"
        },
        "pricingEngineType": {
          "type": "string",
          "enum": [
            "fixed",
            "rule_based_dynamic",
            "hybrid"
          ]
        }
      }
    },
    "capabilities": {
      "type": "object",
      "required": [
        "interaction"
      ],
      "properties": {
        "interaction": {
          "$ref": "../components/capability_groups.json#/$defs/InteractionCapabilities"
        },
        "commerce": {
          "$ref": "../components/capability_groups.json#/$defs/CommerceCapabilities"
        },
        "financial": {
          "$ref": "../components/capability_groups.json#/$defs/FinancialCapabilities"
        },
        "content": {
          "$ref": "../components/capability_groups.json#/$defs/ContentCapabilities"
        },
        "community": {
          "$ref": "../components/capability_groups.json#/$defs/CommunityCapabilities"
        }
      }
    },
    "modules": {
      "type": "object",
      "properties": {
        "catalog": {
          "type": "object",
          "properties": {
            "facetedSearchEnabled": {
              "type": "boolean"
            },
            "taxonomyVersioned": {
              "type": "boolean"
            },
            "recommendationBlocksEnabled": {
              "type": "boolean"
            },
            "catalogDiscovery": {
              "type": "object",
              "required": [
                "dataSources"
              ],
              "properties": {
                "canonicalCatalogUrl": {
                  "type": "string",
                  "format": "uri"
                },
                "dataSources": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": [
                      "sourceType",
                      "sourceUrl",
                      "format"
                    ],
                    "properties": {
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "file_export",
                          "public_feed_page",
                          "public_api_endpoint",
                          "other"
                        ]
                      },
                      "sourceUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "json",
                          "xml",
                          "csv",
                          "rss",
                          "html",
                          "other"
                        ]
                      },
                      "updateCadence": {
                        "type": "string",
                        "enum": [
                          "real_time",
                          "hourly",
                          "daily",
                          "weekly",
                          "manual"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "checkout": {
          "type": "object",
          "properties": {
            "guestCheckoutEnabled": {
              "type": "boolean"
            },
            "oneClickCheckoutEnabled": {
              "type": "boolean"
            },
            "addressValidationEnabled": {
              "type": "boolean"
            }
          }
        },
        "fulfillment": {
          "type": "object",
          "properties": {
            "warehouseRoutingEnabled": {
              "type": "boolean"
            },
            "returnWorkflowEnabled": {
              "type": "boolean"
            },
            "deliveryEtaPredictionEnabled": {
              "type": "boolean"
            }
          }
        },
        "pricing": {
          "type": "object",
          "properties": {
            "dynamicPricingEnabled": {
              "type": "boolean"
            },
            "pricingDiscovery": {
              "type": "object",
              "required": [
                "dataSources"
              ],
              "properties": {
                "dataSources": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": [
                      "sourceType",
                      "sourceUrl",
                      "format"
                    ],
                    "properties": {
                      "sourceType": {
                        "type": "string",
                        "enum": [
                          "file_export",
                          "public_feed_page",
                          "public_api_endpoint",
                          "other"
                        ]
                      },
                      "sourceUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "format": {
                        "type": "string",
                        "enum": [
                          "json",
                          "xml",
                          "csv",
                          "rss",
                          "html",
                          "other"
                        ]
                      },
                      "updateCadence": {
                        "type": "string",
                        "enum": [
                          "real_time",
                          "hourly",
                          "daily",
                          "weekly",
                          "manual"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "reviews": {
          "type": "object",
          "properties": {
            "ratingSources": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "object",
                "required": [
                  "provider",
                  "sourceUrl"
                ],
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "google_business_profile",
                      "yelp",
                      "tripadvisor",
                      "opentable",
                      "facebook",
                      "custom"
                    ]
                  },
                  "sourceType": {
                    "type": "string",
                    "enum": [
                      "public_page",
                      "official_export",
                      "public_api_endpoint",
                      "other"
                    ]
                  },
                  "sourceUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "xml",
                      "csv",
                      "rss",
                      "html",
                      "other"
                    ]
                  },
                  "updateCadence": {
                    "type": "string",
                    "enum": [
                      "real_time",
                      "hourly",
                      "daily",
                      "weekly",
                      "manual"
                    ]
                  }
                }
              }
            },
            "retrievalPolicy": {
              "type": "object",
              "properties": {
                "requiresLiveFetch": {
                  "type": "boolean"
                },
                "recommendedRefreshHours": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "structuralMetadata": {
      "type": "object",
      "properties": {
        "topology": {
          "const": "binary"
        },
        "roles": {
          "const": [
            "user",
            "platform"
          ]
        },
        "valueSource": {
          "const": "platform_provided"
        },
        "transactionFlow": {
          "const": "direct"
        },
        "networkEffects": {
          "const": "none"
        },
        "commerceMode": {
          "type": "string",
          "enum": [
            "inventory_led",
            "drop_ship_enabled",
            "hybrid"
          ]
        }
      }
    },
    "targetAudience": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "siteCapabilities": {
      "type": "object",
      "properties": {
        "supportedDevices": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "desktop",
              "mobile",
              "tablet"
            ]
          }
        },
        "languages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "accessibilityFeatures": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "required": [
    "@type",
    "ontologicalMode",
    "interactionArchetype",
    "domain",
    "name",
    "description",
    "deliveryFormat",
    "capabilities",
    "structuralMetadata",
    "modules"
  ],
  "validationMetadata": {
    "schemaVersion": "3.0.0",
    "phase": "entity",
    "status": "draft",
    "lastValidated": "2026-02-20T12:00:00Z",
    "validator": "META-AIML QA"
  },
  "semanticAnnotations": {
    "classificationRationale": "EcommerceStore is modeled as DigitalEntity + DirectService because the platform sells directly to end customers with first-party checkout and fulfillment orchestration.",
    "disambiguationNotes": "Different from marketplaces where platform mediates third-party seller transactions. For static website deployment, avoid embedding full product/review snapshots; use source links in modules.catalog.catalogDiscovery, modules.pricing.pricingDiscovery, and modules.reviews.ratingSources."
  },
  "governanceMetadata": {
    "entityVersion": "3.0.0",
    "introducedIn": "META-AIML v3.0.0",
    "stabilityLevel": "draft",
    "sdkValidationRules": [
      "RULE-ECOM-001: @type MUST equal \"EcommerceStore\"",
      "RULE-ECOM-002: ontologicalMode MUST equal \"DigitalEntity\"",
      "RULE-ECOM-003: interactionArchetype MUST contain \"DirectService\"",
      "RULE-ECOM-004: capabilities.interaction MUST be present",
      "RULE-ECOM-005: structuralMetadata.topology MUST equal \"binary\"",
      "RULE-ECOM-006: structuralMetadata.transactionFlow MUST equal \"direct\"",
      "RULE-ECOM-007: modules.catalog.catalogDiscovery.dataSources MUST include sourceType/sourceUrl/format",
      "RULE-ECOM-008: modules.pricing.pricingDiscovery.dataSources MUST include sourceType/sourceUrl/format when pricing source links are declared"
    ]
  }
}
