JSON Schema for Product Records

The current JSON Schema for Product records. You can use this schema to validate your data.


{
  "title": "product",
  "description": "Merchstack Product Schema",
  "$id": "https://docs.merchstack.io/schemas/productSchema.json",
  "type": "object",
  "properties": {
    "importMetaData": {
      "type": "object",
      "properties": {
        "importId": {
          "type": "string"
        },
        "recordNum": {
          "type": "integer"
        },
        "recordOf": {
          "type": "integer"
        },
        "recordType": {
          "type": "string",
          "const": "product"
        },
        "operationType": {
          "type": "string",
          "enum": [
            "create",
            "update"
          ]
        },
        "formatVersion": {
          "type": "string",
          "enum": [
            "1.0"
          ]
        }
      },
      "required": [
        "importId",
        "recordNum",
        "recordOf",
        "recordType",
        "operationType",
        "formatVersion"
      ]
    },
    "brand": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "categoryIds": {
      "type": "array",
      "minItems": 1,
      "description": "A list of categories that this product is in. Must include at least one value",
      "items": {
        "type": "string"
      }
    },
    "assets": {
      "type": "array",
      "description": "An array of assets (usually images) associated with this product",
      "minItems": 1,
      "items": {
        "properties": {
          "name": {
            "type": "string"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "externalSystemAssetId": {
            "type": "string",
            "description": "The ID of this asset in your system"
          },
          "mimeType": {
            "type": "string",
            "enum": [
              "image/jpeg",
              "image/gif",
              "image/png",
              "image/svg+xml"
            ]
          },
          "source": {
            "type": "string",
            "description": "Normally the CDN URL where this asset can be found"
          },
          "type": {
            "type": "string",
            "enum": [
              "BINARY",
              "IMAGE",
              "VIDEO"
            ]
          },
          "focalPoint": {
            "type": "object",
            "properties": {
              "x": {
                "type": "integer"
              },
              "y": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "name",
          "width",
          "height",
          "externalSystemAssetId",
          "mimeType",
          "source",
          "type"
        ]
      }
    },
    "translations": {
      "type": "array",
      "description": "List of translatable items by language code",
      "items": {
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "languageCode": {
            "type": "string",
            "enum": [
              "af",
              "ak",
              "am",
              "ar",
              "as",
              "az",
              "be",
              "bg",
              "bm",
              "bn",
              "bo",
              "br",
              "bs",
              "ca",
              "ce",
              "co",
              "cs",
              "cu",
              "cy",
              "da",
              "de",
              "de_AT",
              "de_CH",
              "dz",
              "ee",
              "el",
              "en",
              "en_AU",
              "en_CA",
              "en_GB",
              "en_IE",
              "en_NZ",
              "en_US",
              "eo",
              "es",
              "es_ES",
              "es_MX",
              "et",
              "eu",
              "fa",
              "fa_AF",
              "ff",
              "fi",
              "fo",
              "fr",
              "fr_CA",
              "fr_CH",
              "fy",
              "ga",
              "gd",
              "gl",
              "gu",
              "gv",
              "ha",
              "he",
              "hi",
              "hr",
              "ht",
              "hu",
              "hy",
              "ia",
              "id",
              "ig",
              "ii",
              "is",
              "it",
              "ja",
              "jv",
              "ka",
              "ki",
              "kk",
              "kl",
              "km",
              "kn",
              "ko",
              "ks",
              "ku",
              "kw",
              "ky",
              "la",
              "lb",
              "lg",
              "ln",
              "lo",
              "lt",
              "lu",
              "lv",
              "mg",
              "mi",
              "mk",
              "ml",
              "mn",
              "mr",
              "ms",
              "mt",
              "my",
              "nb",
              "nd",
              "ne",
              "nl",
              "nl_BE",
              "nn",
              "ny",
              "om",
              "or",
              "os",
              "pa",
              "pl",
              "ps",
              "pt",
              "pt_BR",
              "pt_PT",
              "qu",
              "rm",
              "rn",
              "ro",
              "ro_MD",
              "ru",
              "rw",
              "sa",
              "sd",
              "se",
              "sg",
              "si",
              "sk",
              "sl",
              "sm",
              "sn",
              "so",
              "sq",
              "sr",
              "st",
              "su",
              "sv",
              "sw",
              "sw_CD",
              "ta",
              "te",
              "tg",
              "th",
              "ti",
              "tk",
              "to",
              "tr",
              "tt",
              "ug",
              "uk",
              "ur",
              "uz",
              "vi",
              "vo",
              "wo",
              "xh",
              "yi",
              "yo",
              "zh",
              "zh_Hans",
              "zh_Hant",
              "zu"
            ]
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "required": [
          "languageCode",
          "name",
          "description",
          "slug"
        ]
      }
    },
    "tenantId": {
      "type": "string"
    },
    "externalSystemId": {
      "type": "string"
    },
    "featuredAssetId": {
      "type": "string"
    },
    "attributes": {
      "type": "array",
      "items": {
        "properties": {
          "key": {
            "type": "array"
          }
        }
      }
    },
    "variants": {
      "type": "array",
      "minItems": 1,
      "items": {
        "properties": {
          "outOfStockThreshold": {
            "type": "number"
          },
          "salePrice": {
            "type": "number"
          },
          "price": {
            "type": "number"
          },
          "externalSystemID": {
            "type": "string"
          },
          "stockOnHand": {
            "type": "number"
          },
          "featuredAssetId": {
            "type": "string"
          },
          "attributes": {
            "type": "array",
            "items": {
              "properties": {
                "key": {
                  "type": "string"
                }
              }
            }
          },
          "sku": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "swatches": {
            "type": "array",
            "items": {
              "properties": {
                "assetId": {
                  "type": "string"
                },
                "attributeValueCode": {
                  "type": "string"
                }
              }
            }
          },
          "compareAtPrice": {
            "type": "number"
          }
        }
      }
    },
    "storeId": {
      "type": "string"
    }
  },
  "required": [
    "importMetaData",
    "tenantId",
    "storeId",
    "externalSystemId",
    "brand",
    "categoryIds",
    "translations",
    "enabled",
    "assets",
    "featuredAssetId",
    "attributes",
    "variants"
  ]
}