{
  "openapi": "3.0.1",
  "info": {
    "title": "Bundle Component Demand & Shortage Report",
    "description": "Aggregate component demand across simultaneous one-level bundles and standalone orders. Compare one stock pool and trace shortages, missing stock and duplicate or nested BOM conflicts. Mapped CSV or JSON; downloadable reports; no store writes.",
    "version": "0.1",
    "x-build-id": "yVqwstjljaGigPOhX"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/h_murdock~bundle-component-demand-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-h_murdock-bundle-component-demand-audit",
        "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/h_murdock~bundle-component-demand-audit/runs": {
      "post": {
        "operationId": "runs-sync-h_murdock-bundle-component-demand-audit",
        "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/h_murdock~bundle-component-demand-audit/run-sync": {
      "post": {
        "operationId": "run-sync-h_murdock-bundle-component-demand-audit",
        "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",
        "required": [
          "snapshotId",
          "stockPoolId",
          "asOf",
          "inventoryCoverage",
          "demandCoverage",
          "missingInventoryPolicy"
        ],
        "properties": {
          "snapshotId": {
            "title": "snapshotId",
            "type": "string",
            "description": "Caller snapshot identifier; opaque literal string, leading zeros preserved."
          },
          "stockPoolId": {
            "title": "stockPoolId",
            "type": "string",
            "description": "One explicit stock pool only. Combine stock only when quantities refer to this same declared available-to-use pool. This Actor does not sum warehouses."
          },
          "asOf": {
            "title": "asOf",
            "type": "string",
            "description": "Snapshot reference time, strict real UTC YYYY-MM-DDTHH:mm:ss[.sss]Z; no clock or stale-stock inference."
          },
          "inventoryCoverage": {
            "title": "inventoryCoverage",
            "enum": [
              "complete",
              "incomplete",
              "unknown"
            ],
            "type": "string",
            "description": "Declare whether the supplied snapshot covers the entire scope. Incomplete or unknown coverage prevents exact inventory or demand/shortfall results."
          },
          "demandCoverage": {
            "title": "demandCoverage",
            "enum": [
              "complete",
              "incomplete",
              "unknown"
            ],
            "type": "string",
            "description": "Declare whether the supplied snapshot covers the entire scope. Incomplete or unknown coverage prevents exact inventory or demand/shortfall results."
          },
          "missingInventoryPolicy": {
            "title": "Missing inventory policy",
            "enum": [
              "unresolved"
            ],
            "type": "string",
            "description": "Missing inventory is unresolved, never zero. Keep zero as an explicit availableUnits:0 row. This commercial policy must be declared; it has no runtime fallback."
          },
          "inventory": {
            "title": "inventory",
            "minItems": 0,
            "type": "array",
            "description": "Rows: recordId, componentSku, availableUnits (integer 0–1,000,000). One row per component per stock pool. Repeated SKU stock is flagged unresolved, never summed. Supply this array (including [] when empty) OR CSV, never both. Unknown row fields rejected; unique record IDs within each table. Combined maximum 5,000 rows and 4 MB JSON."
          },
          "inventoryCsv": {
            "title": "inventory CSV",
            "type": "string",
            "description": "Optional alternative to inventory array: REMOVE that array when supplying nonempty CSV. Exact canonical headers unless mapping supplied. UTF-8 BOM and quoted fields accepted; duplicate/unknown headers, irregular rows, signed/fractional/exponent/grouped numbers rejected. No URL fetch."
          },
          "inventoryColumns": {
            "title": "inventory column mapping",
            "type": "object",
            "description": "Optional mapping from EVERY canonical key (recordId, componentSku, availableUnits) to a distinct CSV header. Canonical mapping is harmless with arrays; custom mapping requires inventoryCsv. Omit for canonical CSV headers."
          },
          "bom": {
            "title": "bom",
            "minItems": 0,
            "type": "array",
            "description": "Rows: recordId, bundleSku, componentSku, unitsPerBundle (integer 1–1,000,000). Only one level. Duplicate edges and nested/cyclic kits are unresolved. Supply [] for standalone-only demand. Supply this array (including [] when empty) OR CSV, never both. Unknown row fields rejected; unique record IDs within each table. Combined maximum 5,000 rows and 4 MB JSON."
          },
          "bomCsv": {
            "title": "bom CSV",
            "type": "string",
            "description": "Optional alternative to bom array: REMOVE that array when supplying nonempty CSV. Exact canonical headers unless mapping supplied. UTF-8 BOM and quoted fields accepted; duplicate/unknown headers, irregular rows, signed/fractional/exponent/grouped numbers rejected. No URL fetch."
          },
          "bomColumns": {
            "title": "bom column mapping",
            "type": "object",
            "description": "Optional mapping from EVERY canonical key (recordId, bundleSku, componentSku, unitsPerBundle) to a distinct CSV header. Canonical mapping is harmless with arrays; custom mapping requires bomCsv. Omit for canonical CSV headers."
          },
          "demand": {
            "title": "demand",
            "minItems": 0,
            "type": "array",
            "description": "Rows: recordId, itemType (bundle or component), sku, quantity (integer 0–1,000,000). Repeated SKU demand with distinct record IDs is intentionally aggregated. At least one row, including explicit quantity 0 for an empty plan. Supply this array (including [] when empty) OR CSV, never both. Unknown row fields rejected; unique record IDs within each table. Combined maximum 5,000 rows and 4 MB JSON."
          },
          "demandCsv": {
            "title": "demand CSV",
            "type": "string",
            "description": "Optional alternative to demand array: REMOVE that array when supplying nonempty CSV. Exact canonical headers unless mapping supplied. UTF-8 BOM and quoted fields accepted; duplicate/unknown headers, irregular rows, signed/fractional/exponent/grouped numbers rejected. No URL fetch."
          },
          "demandColumns": {
            "title": "demand column mapping",
            "type": "object",
            "description": "Optional mapping from EVERY canonical key (recordId, itemType, sku, quantity) to a distinct CSV header. Canonical mapping is harmless with arrays; custom mapping requires demandCsv. Omit for canonical CSV headers."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}