{
  "openapi": "3.0.1",
  "info": {
    "title": "Inventory CSV Diff & Stock Change Checker",
    "description": "Compare two inventory CSV files by SKU or SKU + warehouse. Find stock drops, items going to zero, added or removed SKUs, and duplicate entries before a stock update. Try the built-in example without files; get an HTML report, CSV findings, and JSON.",
    "version": "0.0",
    "x-build-id": "gEt2zR5iG7GvRls1g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/overbifrost~inventory-csv-diff-stock-change-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-overbifrost-inventory-csv-diff-stock-change-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/overbifrost~inventory-csv-diff-stock-change-checker/runs": {
      "post": {
        "operationId": "runs-sync-overbifrost-inventory-csv-diff-stock-change-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/overbifrost~inventory-csv-diff-stock-change-checker/run-sync": {
      "post": {
        "operationId": "run-sync-overbifrost-inventory-csv-diff-stock-change-checker",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "demoMode": {
            "title": "Try the built-in example",
            "type": "boolean",
            "description": "No files needed. The three-row example shows stock dropping from 12 to zero, one unchanged item, and one added SKU. Turn this off before supplying your own data. The example uses normal event pricing."
          },
          "schemaVersion": {
            "title": "Comparison profile",
            "enum": [
              "inventory_snapshot_single_location_v1",
              "inventory_snapshot_mapping_v2"
            ],
            "type": "string",
            "description": "Choose SKU + Stock columns when both files use those exact headers. Choose Custom columns / multiple warehouses to map other headers or compare each SKU separately by warehouse.",
            "default": "inventory_snapshot_single_location_v1"
          },
          "currentCsvFile": {
            "title": "Current inventory CSV",
            "type": "string",
            "description": "Upload the snapshot you currently use, up to 10 MB. For the standard profile, headers must include SKU and Stock. Use exactly one current source; turn the example off first."
          },
          "proposedCsvFile": {
            "title": "Next inventory CSV",
            "type": "string",
            "description": "Upload the next complete snapshot you want to check, up to 10 MB. Use the same inventory scope as the current file and exactly one proposed source."
          },
          "confirmCompleteSnapshots": {
            "title": "Both snapshots cover the same complete scope",
            "type": "boolean",
            "description": "Required for your own data. Both snapshots must cover the same complete supplier, warehouse, or other scope. Do not check this for a partial update feed: absence would be mistaken for an addition or removal."
          },
          "rules": {
            "title": "Stock review rules",
            "type": "object",
            "description": "Control which stock changes, additions, and removals are highlighted for review.",
            "properties": {
              "maxStockDropPercent": {
                "title": "Max stock drop (%)",
                "type": "number",
                "editor": "number",
                "description": "Flag stock decreases strictly larger than this percentage.",
                "minimum": 0,
                "maximum": 10000,
                "default": 50
              },
              "maxStockIncreasePercent": {
                "title": "Max stock increase (%)",
                "type": "number",
                "editor": "number",
                "description": "Flag stock increases strictly larger than this percentage.",
                "minimum": 0,
                "maximum": 10000,
                "default": 200
              },
              "flagStockToZero": {
                "title": "Flag stock → 0",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Flag stock changing from a positive value to zero.",
                "default": true
              },
              "flagAddedSku": {
                "title": "Flag added SKUs / identities",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Flag an identity present only in the proposed complete snapshot.",
                "default": true
              },
              "flagRemovedSku": {
                "title": "Flag removed SKUs / identities",
                "type": "boolean",
                "editor": "checkbox",
                "description": "Flag an identity present only in the current complete snapshot.",
                "default": true
              }
            },
            "additionalProperties": false
          },
          "maxFindings": {
            "title": "Maximum findings returned",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Limit the retained finding list to 1–1000 entries. SKUFuse still counts all findings when the list is capped.",
            "default": 1000
          },
          "currentMapping": {
            "title": "Current source mapping",
            "type": "object",
            "description": "Mapping profile only. Map logical inventory fields to the current source's exact CSV headers or dataset field paths.",
            "properties": {
              "sku": {
                "title": "SKU",
                "type": "string",
                "editor": "textfield",
                "description": "Current CSV header or dataset field path containing SKU. Omit to use SKU."
              },
              "quantity": {
                "title": "Quantity",
                "type": "string",
                "editor": "textfield",
                "description": "Current CSV header or dataset field path containing quantity. Omit to use Stock."
              },
              "location": {
                "title": "Warehouse / location",
                "type": "string",
                "editor": "textfield",
                "description": "Optional warehouse/location field. Map location on both sides or neither."
              }
            },
            "additionalProperties": false
          },
          "proposedMapping": {
            "title": "Next source mapping",
            "type": "object",
            "description": "Mapping profile only. Map logical inventory fields to the proposed source's exact CSV headers or dataset field paths.",
            "properties": {
              "sku": {
                "title": "SKU",
                "type": "string",
                "editor": "textfield",
                "description": "Proposed CSV header or dataset field path containing SKU. Omit to use SKU."
              },
              "quantity": {
                "title": "Quantity",
                "type": "string",
                "editor": "textfield",
                "description": "Proposed CSV header or dataset field path containing quantity. Omit to use Stock."
              },
              "location": {
                "title": "Warehouse / location",
                "type": "string",
                "editor": "textfield",
                "description": "Optional warehouse/location field. Must be mapped on both sides or neither."
              }
            },
            "additionalProperties": false
          },
          "currentCsv": {
            "title": "Current CSV — paste text",
            "type": "string",
            "description": "Alternative to file upload: paste the current inventory CSV as text (max 512 KB). Use exactly one current source."
          },
          "proposedCsv": {
            "title": "Proposed CSV — paste text",
            "type": "string",
            "description": "Alternative to file upload: paste the proposed inventory CSV as text (max 512 KB). Use exactly one proposed source."
          },
          "currentCsvUrl": {
            "title": "Current CSV URL",
            "type": "string",
            "description": "Public HTTPS URL returning the current CSV (max 10 MB). HTTPS port 443 only; redirects and URL credentials are rejected."
          },
          "proposedCsvUrl": {
            "title": "Proposed CSV URL",
            "type": "string",
            "description": "Public HTTPS URL returning the proposed CSV (max 10 MB). HTTPS port 443 only; redirects and URL credentials are rejected."
          },
          "csvDelimiter": {
            "title": "CSV delimiter",
            "enum": [
              ",",
              ";",
              "\t"
            ],
            "type": "string",
            "description": "Delimiter used by uploaded, pasted, or URL CSV files. Dataset and saved-baseline sources use canonical comma CSV."
          },
          "currentDataset": {
            "title": "Current inventory dataset",
            "type": "string",
            "description": "Alternative current source: select an Apify dataset containing inventory records. SKUFuse requests READ-only access."
          },
          "proposedDataset": {
            "title": "Proposed inventory dataset",
            "type": "string",
            "description": "Alternative proposed source: select an Apify dataset containing the planned inventory snapshot. SKUFuse requests READ-only access."
          },
          "currentDatasetMapping": {
            "title": "Current dataset column mapping — v1",
            "type": "object",
            "description": "Default profile only. Optional visual mapping for a dataset whose fields are not named SKU and Stock.",
            "properties": {
              "SKU": {
                "title": "SKU field path",
                "type": "string",
                "editor": "textfield",
                "description": "Dataset field path containing SKU, for example sku."
              },
              "Stock": {
                "title": "Stock field path",
                "type": "string",
                "editor": "textfield",
                "description": "Dataset field path containing quantity, for example qty."
              }
            },
            "additionalProperties": false
          },
          "proposedDatasetMapping": {
            "title": "Proposed dataset column mapping — v1",
            "type": "object",
            "description": "Default profile only. Optional visual mapping for a proposed dataset whose fields are not named SKU and Stock.",
            "properties": {
              "SKU": {
                "title": "SKU field path",
                "type": "string",
                "editor": "textfield",
                "description": "Dataset field path containing SKU."
              },
              "Stock": {
                "title": "Stock field path",
                "type": "string",
                "editor": "textfield",
                "description": "Dataset field path containing quantity."
              }
            },
            "additionalProperties": false
          },
          "baseline": {
            "title": "Saved baseline",
            "required": [
              "operation",
              "name"
            ],
            "type": "object",
            "description": "Reuse a named, validated current snapshot for recurring comparisons. A comparison never automatically replaces it with the next snapshot. No baseline settings are needed for an ordinary two-file comparison.",
            "properties": {
              "operation": {
                "title": "Operation",
                "type": "string",
                "editor": "select",
                "description": "Choose what to do with the named baseline.",
                "enum": [
                  "set",
                  "compare",
                  "replace",
                  "inspect",
                  "delete"
                ],
                "enumTitles": [
                  "Save current snapshot",
                  "Compare proposed snapshot to baseline",
                  "Replace saved baseline",
                  "Inspect saved baseline",
                  "Delete saved baseline"
                ]
              },
              "name": {
                "title": "Baseline name",
                "type": "string",
                "editor": "textfield",
                "description": "1–64 characters. Letters, numbers, hyphen, or underscore; start with a letter or number.",
                "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$",
                "example": "main-inventory"
              },
              "expectedVersion": {
                "title": "Expected version",
                "type": "integer",
                "editor": "number",
                "description": "Required only when replacing a baseline. Enter its current generation.",
                "minimum": 1
              }
            },
            "additionalProperties": false
          },
          "reviewWebhook": {
            "title": "Review notification webhook (advanced API)",
            "type": "object",
            "description": "Optional encrypted webhook configuration for API or Task input. Hidden from the Form view so customers are never asked to enter JSON."
          },
          "payload": {
            "title": "Integration payload",
            "type": "object",
            "description": "Platform-provided integration envelope for chained Apify runs."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}