{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ocapi-shop/json-schema/ocapi-shop-catalog-import-schema.json",
  "title": "CatalogImport",
  "description": "A catalog read from Shopify or WooCommerce, and what writing it did",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ocapi-shop-openapi.yml#/components/schemas/CatalogImport",
  "type": "object",
  "required": [
    "id",
    "source",
    "status",
    "filename",
    "source_url",
    "publish",
    "total",
    "processed",
    "warnings",
    "preview",
    "outlook",
    "report",
    "error",
    "created_at",
    "started_at",
    "finished_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "shopify_csv",
        "woocommerce_csv",
        "shopify_store"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "fetching",
        "ready",
        "queued",
        "running",
        "done",
        "failed"
      ],
      "description": "fetching: reading the store URL; ready: waiting for startCatalogImport; queued and running: writing products; then done or failed"
    },
    "filename": {
      "type": [
        "string",
        "null"
      ],
      "description": "The uploaded export's name"
    },
    "source_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Shopify store that was read"
    },
    "publish": {
      "type": "boolean",
      "description": "Whether new products show as the other platform did (otherwise they are created hidden)"
    },
    "total": {
      "type": "integer",
      "description": "Products read"
    },
    "processed": {
      "type": "integer",
      "description": "Products written so far"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What the whole file leaves behind, such as columns that aren't imported"
    },
    "preview": {
      "type": "array",
      "description": "The first products as they will be imported",
      "items": {
        "type": "object",
        "required": [
          "key",
          "name",
          "sku",
          "price",
          "compare_at",
          "inventory",
          "weight",
          "options",
          "category",
          "tags",
          "hidden",
          "variants",
          "images",
          "skip",
          "warnings"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "The product's id on the other platform, as shopify:<handle> or woocommerce:<id>"
          },
          "name": {
            "type": "string"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "What it sells for (the first variant's)"
          },
          "compare_at": {
            "type": [
              "number",
              "null"
            ],
            "description": "The higher regular price when it is on sale"
          },
          "inventory": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units in stock; null is unlimited"
          },
          "weight": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kilograms"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Option names, such as Color and Size"
          },
          "category": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The category path",
            "broadest first; nested categories are created": null
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kept as the product's search hints"
          },
          "hidden": {
            "type": "boolean",
            "description": "Hidden or a draft on the other platform"
          },
          "variants": {
            "type": "integer",
            "description": "How many variants it has"
          },
          "images": {
            "type": "integer",
            "description": "How many photos it has"
          },
          "skip": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it won't be imported, such as a gift card"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "outlook": {
      "type": [
        "object",
        "null"
      ],
      "description": "While ready, what starting would do",
      "required": [
        "creates",
        "updates",
        "skips",
        "over_limit"
      ],
      "properties": {
        "creates": {
          "type": "integer"
        },
        "updates": {
          "type": "integer",
          "description": "Products already in the store",
          "matched by source handle or SKU": null
        },
        "skips": {
          "type": "integer"
        },
        "over_limit": {
          "type": "integer",
          "description": "New products the plan has no room for; they would be left out"
        }
      }
    },
    "report": {
      "type": [
        "object",
        "null"
      ],
      "description": "What writing did, so far while running and in full once done",
      "required": [
        "created",
        "updated",
        "unchanged",
        "skipped",
        "image_failures",
        "notes",
        "limit"
      ],
      "properties": {
        "created": {
          "type": "integer"
        },
        "updated": {
          "type": "integer"
        },
        "unchanged": {
          "type": "integer"
        },
        "skipped": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "name",
              "reason"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        },
        "image_failures": {
          "type": "array",
          "description": "Photos that couldn't be downloaded; their products were imported without them",
          "items": {
            "type": "object",
            "required": [
              "name",
              "url",
              "reason"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        },
        "notes": {
          "type": "array",
          "description": "What came over differently, such as a third option joined into the second",
          "items": {
            "type": "object",
            "required": [
              "name",
              "note"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "note": {
                "type": "string"
              }
            }
          }
        },
        "limit": {
          "type": [
            "object",
            "null"
          ],
          "description": "New products left out because the plan has no room for them",
          "required": [
            "skipped",
            "message"
          ],
          "properties": {
            "skipped": {
              "type": "integer"
            },
            "message": {
              "type": "string",
              "description": "The plan's limit and the upgrade that allows more"
            },
            "upgrade_url": {
              "type": "string",
              "description": "Where the store's owner upgrades"
            }
          }
        }
      }
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why it failed"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}