{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/synchronity-app/json-schema/synchronity-app-ampsproduct-schema.json",
  "title": "AMPSProduct",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/synchronity-app-openapi.yml#/components/schemas/AMPSProduct",
  "type": "object",
  "required": [
    "product_id",
    "site_id",
    "title",
    "price",
    "availability",
    "sku",
    "categories",
    "tags",
    "attributes",
    "variants",
    "images"
  ],
  "properties": {
    "product_id": {
      "type": "string"
    },
    "site_id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "price": {
      "$ref": "#/$defs/MonetaryAmount"
    },
    "compare_at_price": {
      "oneOf": [
        {
          "$ref": "#/$defs/MonetaryAmount"
        },
        {
          "type": "null"
        }
      ]
    },
    "availability": {
      "$ref": "#/$defs/AvailabilityEnum"
    },
    "stock_quantity": {
      "oneOf": [
        {
          "type": "integer",
          "minimum": 0
        },
        {
          "type": "null"
        }
      ]
    },
    "sku": {
      "type": "string"
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "attributes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProductAttribute"
      }
    },
    "variants": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AMPSProductVariant"
      }
    },
    "image_url": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "images": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProductImage"
      }
    },
    "url": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "$defs": {
    "AMPSProductVariant": {
      "type": "object",
      "required": [
        "variant_id",
        "title",
        "price",
        "availability"
      ],
      "properties": {
        "variant_id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "sku": {
          "type": "string"
        },
        "price": {
          "$ref": "#/$defs/MonetaryAmount"
        },
        "compare_at_price": {
          "oneOf": [
            {
              "$ref": "#/$defs/MonetaryAmount"
            },
            {
              "type": "null"
            }
          ]
        },
        "availability": {
          "$ref": "#/$defs/AvailabilityEnum"
        },
        "stock_quantity": {
          "oneOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ]
        },
        "attributes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductAttribute"
          }
        },
        "image_url": {
          "oneOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "AvailabilityEnum": {
      "type": "string",
      "enum": [
        "in_stock",
        "out_of_stock",
        "backorder"
      ]
    },
    "MonetaryAmount": {
      "type": "object",
      "required": [
        "amount",
        "currency"
      ],
      "properties": {
        "amount": {
          "type": "string",
          "pattern": "^\\d+\\.\\d{2}$",
          "description": "Decimal string with exactly 2 decimal places."
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "ISO 4217 currency code."
        }
      }
    },
    "ProductAttribute": {
      "type": "object",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      }
    },
    "ProductImage": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "alt": {
          "type": "string"
        }
      }
    }
  }
}