# KitClear: BOM Stock Allocation and Shortage Report (`usta/kitclear-bom-stock-allocation`) Actor

Turn on-hand parts, reserved stock and priority orders into a checked kitting allocation, pick quantities and shortage report. Fixed single-level BOMs; explicit partial-fill policy.

- **URL**: https://apify.com/usta/kitclear-bom-stock-allocation.md
- **Developed by:** [US Tech Automations](https://apify.com/usta) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / completed product packet

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## KitClear

Create a checked allocation from your on-hand components and order priorities, then download the pick quantities and shortages.

### Named buyer

A materials planner or kitting lead who must say, from on-hand stock and fixed bills of materials, how many units of each open order can be filled this cycle.

This is not a warehouse management system. It does not count physical inventory, talk to a shop-floor system, buy missing parts, or claim a globally optimal plan.

### What it does

It allocates on-hand stock to orders using a fixed, single-level bill of materials. Priority is descending; ties keep input order. Reservations are locked stock and are not given to these orders. `partial_fulfillment` must be set true or false by you.

`PASS` means the packet was checked against the engine's own rules. It does not mean every order is filled. Unfulfilled rows stay in the files for a person to review.

### Exact limits (from the engine)

- 1–100 orders
- 1–2,000 stock components
- 1–200 products (BOMs)
- 1–100 components per BOM
- IDs: printable strings, 1–64 characters
- Stock and reservations: integers 0–1,000,000
- BOM units: 1–10,000
- Order quantity: 1–100,000
- Priority: 1–10,000
- Product IDs and component IDs must not overlap (no nested BOMs)
- JSON input cap at the adapter: 1 MiB
- Unknown fields and non-finite numbers are refused

### Input JSON example

This is the native sample (`example.json`). Paste this object into the **payload** JSON field.

```json
{
  "synthetic": true,
  "partial_fulfillment": true,
  "stock": {
    "board": 12,
    "case": 7,
    "cable": 20
  },
  "reservations": {
    "board": 2
  },
  "boms": {
    "sensor-kit": {
      "board": 1,
      "case": 1,
      "cable": 2
    },
    "board-pair": {
      "board": 2,
      "cable": 1
    }
  },
  "orders": [
    {"id": "ORDER-A", "sku": "sensor-kit", "quantity": 6, "priority": 10},
    {"id": "ORDER-B", "sku": "board-pair", "quantity": 3, "priority": 5},
    {"id": "ORDER-C", "sku": "sensor-kit", "quantity": 2, "priority": 2}
  ]
}
```

Public Apify input schema (`input_schema.json`) wraps that object as `payload` with a JSON editor. `example` and `default` are this sample. Extra fields are not documented and the engine rejects them.

### Exact artifacts

The adapter returns `status='PASS'`, the engine `summary` object, `files` (JSON/CSV/README bytes unchanged; HTML is the branded report), and `archive` (a zip of those files only).

Zip members:

| File | Contents |
| --- | --- |
| `allocation.json` | Full allocation evidence (orders, picks, remaining stock, shortages, input SHA-256, algorithm version) |
| `orders.csv` | order\_id, sku, priority, requested, filled, unfulfilled |
| `materials.csv` | component, picked, locked, remaining\_available, additional\_for\_unfulfilled |
| `README.txt` | Limits, algorithm id, input hash, limitations |
| `report.html` | Branded allocation report (tables, limitations, USTA shell) |
| `styles.css` | Shared USTA stylesheet used by the report |

On the sample, filled units are 6, 2, 0 (ORDER-C unfilled). Weighted fulfilled units are 70. Unfulfilled rows stay in the CSV and JSON.

### What unresolved / unfilled means

An unfilled or partly filled order is left in the packet for **manual review**. The tool does not rewrite history, substitute parts, or purchase stock. "Additional components" is a shortage count, not a purchase order.

### Claims this product does not make

- No physical inventory count or warehouse integration
- No optimality claim (priority-then-input-order only)
- No substitutions, forecasts, purchasing, or assembly instructions

### Hosting

When you run this Actor, the payload is **sent to Apify**. It is not local-only. You control how long Apify keeps the run. US Tech Automations does not offer a lasting availability promise (no SLA) for Apify uptime.

### Run and download

1. Review the supported input and try the included synthetic example. Replace **payload** with your authorized records. For API runs, send an object with a single payload field containing that input.
2. Run the Actor. Open **Status and coverage** to inspect the result.
3. For a completed result, open **Download completed ZIP** or the artifact link in the dataset. Save and extract the ZIP before Apify retention expires. Open the HTML report where provided; retain the JSON and CSV evidence.

### Price and unsuccessful runs

**$0.50 per completed packet**, with one packet per run and no start fee. A retry of the same run reuses the packet and the same billing identity. Starting a separate run is a separate request. Invalid input or an incomplete UNKNOWN result produces a diagnostic without a completed-packet charge. A completed conflict or shortage report can still require manual review; PASS does not mean every business problem was resolved.

The minimum run budget is $0.50. The example is a normal run and follows the same price; it is not a free preview promise. Apify handles account billing. These files are not permanent storage: download them promptly.

### Access and support

Your input and output are processed on Apify under the run owner's account. Use authorized data and opaque IDs; do not upload passwords or sensitive personal records. Treat artifact URLs as access-bearing links and share them only intentionally. The USTA report may fetch the Satoshi font; it does not upload your report. For a product issue, use this Actor's Issues tab with the run ID and a redacted example. Never post private input or access-bearing links in a public issue.

# Actor input Schema

## `payload` (type: `object`):

Exact KitClear object. Unknown fields are rejected by the native engine. Limits: 1–2000 stock components, 1–200 products, 1–100 components per BOM, 1–100 orders. IDs 1–64 printable characters. Stock/reservations 0–1000000. BOM units 1–10000. Order units 1–100000. Priority 1–10000. partial\_fulfillment must be true or false.

## Actor input object example

```json
{
  "payload": {
    "synthetic": true,
    "partial_fulfillment": true,
    "stock": {
      "board": 12,
      "case": 7,
      "cable": 20
    },
    "reservations": {
      "board": 2
    },
    "boms": {
      "sensor-kit": {
        "board": 1,
        "case": 1,
        "cable": 2
      },
      "board-pair": {
        "board": 2,
        "cable": 1
      }
    },
    "orders": [
      {
        "id": "ORDER-A",
        "sku": "sensor-kit",
        "quantity": 6,
        "priority": 10
      },
      {
        "id": "ORDER-B",
        "sku": "board-pair",
        "quantity": 3,
        "priority": 5
      },
      {
        "id": "ORDER-C",
        "sku": "sensor-kit",
        "quantity": 2,
        "priority": 2
      }
    ]
  }
}
```

# Actor output Schema

## `packet` (type: `string`):

No description

## `report` (type: `string`):

No description

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("usta/kitclear-bom-stock-allocation").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("usta/kitclear-bom-stock-allocation").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call usta/kitclear-bom-stock-allocation --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,usta/kitclear-bom-stock-allocation"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ceWsEqOhKF79BLVyu/builds/Nn6WW1yKZvOLvwCXh/openapi.json
