# Physical Count & Recount Consistency Evidence (`h_murdock/count-pass-consistency-evidence`) Actor

Compare actual first and recount quantities against an exact session/SKU/location/lot/unit baseline. Retain duplicate ambiguity, missing counts and cutoff limits with source evidence. JSON or mapped CSV; no valuation or stock adjustments.

- **URL**: https://apify.com/h_murdock/count-pass-consistency-evidence.md
- **Developed by:** [Gilad Ronen](https://apify.com/h_murdock) (community)
- **Categories:** E-commerce, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.25 / completed report

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?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Physical Count & Recount Consistency Evidence do?

Turn authorized baseline, first-count and actual recount exports into **exact-key evidence** of agreement, disagreement and missing or ambiguous quantities. This batch tool compares the session, SKU, location, lot and unit you supply. It produces a report you can review before deciding what your warehouse process requires next.

A recount marked “done” does not supply its measured quantity. This report needs the actual second quantity and the explicit IDs of both passes. It neither collects counts nor posts inventory adjustments. It does not determine stock truth, valuation, shrinkage, theft or compliance.

### Why use a count and recount report?

Use it when consolidating cycle-count exports from several counters, handing a discrepancy batch to an independent reviewer, or checking whether a recount changed the first observation. Run a new batch through the Apify API or an integration after each authorized export. A native warehouse system may already handle collection and approval; this tool provides a bounded supplied-data report for the handoff.

Different lot and unit keys remain separate. A kilogram baseline is never converted to a gram count, and an empty lot identifier is never joined to a tracked lot. Related keys appear as review references without becoming matches. Duplicate full-key rows within a pass remain ambiguous, including identical duplicates: no summing, averaging or last-row choice can hide double entry.

### How to compare physical count passes

1. Export your baseline and actual count rows for the intended session. Use opaque authorized identifiers and remove contact details.
2. Assign a distinct `rowId` to every source row within each table. Include an explicit `lotId`; use an empty string only for your declared untracked lot scope.
3. Set distinct `firstPassId` and `recountPassId`. Choose `cutOffEvidence` and `baselineCoverage` explicitly.
4. Supply the two arrays, or remove the relevant array and supply its mapped CSV alternative. The input tab includes a synthetic example with both useful and problematic cases.
5. Run the Actor and download the per-key CSV, findings CSV, complete JSON or standalone HTML. Review unresolved keys and retained source references before drawing conclusions.

### Input and cutoff requirements

Baseline rows contain `rowId`, `sessionId`, `sku`, `locationId`, `lotId`, `unit`, and `quantity`. Count rows add `passId` and use `countedQuantity`. Identifiers are exact case- and whitespace-sensitive strings; leading zeros are preserved. Quantities are nonnegative decimal strings with up to 24 integer and 12 fractional digits. Exponents, commas, numeric JSON values and negative quantities are rejected.

Each count row must represent one full key in one pass. Pre-consolidate legitimate separate counting areas under your own documented process; do not submit them as multiple full-key rows expecting this tool to sum them. A missing row is never zero. An explicit zero is a valid observation. Duplicate row IDs are invalid input, while distinct row IDs carrying a duplicate count key are retained as ambiguity.

`comparable` means you declare the baseline and selected passes comparable at the relevant cutoff. The Actor does not verify stock movements or this declaration. With `unverified`, raw recount-minus-first arithmetic remains available, but baseline differences are null and variance status stays unresolved. Equal pass quantities never prove inventory truth. `partial` baseline coverage prevents a whole-session consistency conclusion even when a particular supplied key agrees. Neither coverage option turns a missing baseline into zero.

CSV accepts BOM and quoted cells. Every required mapped header must be present exactly once; unknown headers, irregular rows and ambiguous mappings fail validation. Header-only CSV is explicitly empty evidence. Source references identify normalized rows such as `countRows[0]`, not original physical line numbers when quoted multiline cells are present.

Limits are 2,000 combined baseline and count rows and 4 MB total JSON input. Output caps may require a smaller batch. The tool performs no external website, ERP or model API requests.

### What does the report contain?

| Field | Meaning |
|---|---|
| `firstQuantity`, `recountQuantity` | Exact normalized quantities, or null for a missing/ambiguous pass |
| `rawRecountMinusFirst` | Exact arithmetic on two unique quantities; not a cutoff certification |
| `passConsistency` | Observed equality/difference, or unresolved |
| `varianceStatus` | Comparable numeric difference, zero difference, or a specific unresolved reason |
| `firstMinusBaseline`, `recountMinusBaseline` | Exact deltas only when the cutoff is declared comparable and the relevant baseline/pass is unique |
| `baselineRefs`, `firstRefs`, `recountRefs` | All source row IDs and normalized source positions |

The dataset contains one complete report with `rows`, `findings`, `unused`, scope and the full submitted rows. Summaries count keys rather than adding quantities across products or units. Other-session and undeclared-pass rows are retained as unused evidence. Related different-lot/unit hints show at most 20 references per key with a total count and an abbreviation flag; complete inputs remain in JSON.

CSV text is neutralized for spreadsheet formulas. Negative numeric delta strings consequently receive a leading apostrophe in CSV; JSON preserves the numeric text unchanged. HTML escapes supplied text and uses no external scripts. Download the HTML attachment and open it locally.

### Pricing and recovery

The price is **$0.25 per completed report**, with platform usage included and no startup or per-dataset-item fee. A new run of the same input is a new paid report. An unknown or incomplete supplied-data result is still a useful completed report and is billable; invalid input or insufficient report budget produces no completed report event.

The Actor prepares bounded downloads before publishing one dataset item and one report event. Same-run resurrection verifies saved report integrity and input identity, repairs missing exports and avoids another completed-report charge. An interruption before dataset publication may leave partial downloads; resuming rewrites them before publication. Cloud publication and billing remain subject to Apify's platform behavior and the configured run budget.

### Troubleshooting and support

If a key is ambiguous, keep its references and resolve the source export rather than selecting a convenient quantity. If your cutoff is unknown, supply better evidence or treat the result as unresolved. Use only authorized exports: raw inputs and reports are stored in your Apify run, so this is not a local-only privacy tool. See the API tab for programmatic access and the Issues tab for reproducible feedback using synthetic rows.

# Actor input Schema

## `sessionId` (type: `string`):

Exact opaque session identifier. Other-session source rows are retained as unused. IDs remain case- and whitespace-sensitive strings, max160characters, including leading zeros.

## `firstPassId` (type: `string`):

Explicit first pass identifier. Must differ from recountPassId; no timestamp/latest-pass inference.

## `recountPassId` (type: `string`):

Explicit second pass identifier, distinct from firstPassId. Actual countedQuantity is needed; a done checkbox is not a recount.

## `cutOffEvidence` (type: `string`):

Comparable means caller declares baseline and both passes can be compared at the same inventory cutoff. Unverified suppresses authoritative baseline deltas and leaves variance unresolved; raw first/recount difference remains arithmetic only. Actor does not verify movements or cutoff.

## `baselineCoverage` (type: `string`):

Coverage declaration refers only to the submitted session scope. Complete does not imply a missing key has zero stock; partial prevents a whole-session consistency conclusion.

## `baselineRows` (type: `array`):

Each row: distinct rowId,sessionId,sku,locationId,lotId,unit,quantity. All strings. lotId must be explicit, may be empty for an untracked lot scope. quantity nonnegative exact decimal string, max24integer/12fractionaldigits, no exponent/separators. Duplicate exactsession/sku/location/lot/unit baseline keys remain ambiguous evenequal. Supply array OR baselineCsv. <=2000combinedrows and4MBJSON.

## `countRows` (type: `array`):

Each row: distinct rowId,sessionId,passId,sku,locationId,lotId,unit,countedQuantity. One row is one FULL key count in a pass. Duplicate keys withinpass are ambiguous, never added/averaged/overwritten. Explicit zero is valid; missing is notzero. Exact lot/unit matching, no conversion. Supply array OR countsCsv. Unknown passes retained unused.

## `baselineCsv` (type: `string`):

Remove baselineRows when using a nonemptyCSV. BOM/quotedcells accepted. Exactly mapped unique headers includingexplicitlotId required; irregularrows or unknownheaders rejected. Header-only means an explicit empty baseline.

## `countsCsv` (type: `string`):

Remove countRows when using a nonemptyCSV. Exactly mapped unique headers, includingexplicitlotId andpassId, required. BlanklotId means untrackedlot scope; blankquantity invalid. Header-only means no counts.

## `baselineColumns` (type: `object`):

Optional complete mapping rowId,sessionId,sku,locationId,lotId,unit,quantity to distinct CSVheaders. Canonical mapping is harmless with arrays; custom mapping requires CSV. No automatic header guesses.

## `countColumns` (type: `object`):

Optional complete mapping rowId,sessionId,passId,sku,locationId,lotId,unit,countedQuantity to distinct CSVheaders. Canonicalmapping harmless with arrays; custommapping requires CSV.

## Actor input object example

```json
{
  "sessionId": "session-001",
  "firstPassId": "first",
  "recountPassId": "recount",
  "cutOffEvidence": "comparable",
  "baselineCoverage": "complete",
  "baselineRows": [
    {
      "rowId": "b0",
      "sessionId": "session-001",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "0"
    },
    {
      "rowId": "b1",
      "sessionId": "session-001",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "12.5"
    },
    {
      "rowId": "b2",
      "sessionId": "session-001",
      "sku": "missing-second",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "5"
    },
    {
      "rowId": "b3",
      "sessionId": "session-001",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "7"
    },
    {
      "rowId": "b4",
      "sessionId": "session-001",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "lot-01",
      "unit": "each",
      "quantity": "9"
    },
    {
      "rowId": "b5",
      "sessionId": "session-001",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "kg",
      "quantity": "1.125"
    }
  ],
  "countRows": [
    {
      "rowId": "c0",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0"
    },
    {
      "rowId": "c1",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.000"
    },
    {
      "rowId": "c2",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "12"
    },
    {
      "rowId": "c3",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "12.5"
    },
    {
      "rowId": "c4",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "missing-second",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "5"
    },
    {
      "rowId": "c5",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c6",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c7",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c8",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "9"
    },
    {
      "rowId": "c9",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "9"
    },
    {
      "rowId": "c10",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "g",
      "countedQuantity": "1125"
    },
    {
      "rowId": "c11",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "g",
      "countedQuantity": "1125"
    },
    {
      "rowId": "c12",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "count-only",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.1"
    },
    {
      "rowId": "c13",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "count-only",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.2"
    },
    {
      "rowId": "other-session",
      "sessionId": "another-session",
      "passId": "first",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "99"
    },
    {
      "rowId": "other-pass",
      "sessionId": "session-001",
      "passId": "ignored",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "88"
    }
  ],
  "baselineColumns": {
    "rowId": "rowId",
    "sessionId": "sessionId",
    "sku": "sku",
    "locationId": "locationId",
    "lotId": "lotId",
    "unit": "unit",
    "quantity": "quantity"
  },
  "countColumns": {
    "rowId": "rowId",
    "sessionId": "sessionId",
    "passId": "passId",
    "sku": "sku",
    "locationId": "locationId",
    "lotId": "lotId",
    "unit": "unit",
    "countedQuantity": "countedQuantity"
  }
}
```

# Actor output Schema

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

One full report with exact keys, both actual pass quantities, submittedrows and retainedsource references.

## `json` (type: `string`):

No description

## `evidence` (type: `string`):

No description

## `findings` (type: `string`):

No description

## `html` (type: `string`):

Download and open the escaped standalone report locally.

# 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 = {
    "sessionId": "session-001",
    "firstPassId": "first",
    "recountPassId": "recount",
    "cutOffEvidence": "comparable",
    "baselineCoverage": "complete",
    "baselineRows": [
        {
            "rowId": "b0",
            "sessionId": "session-001",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "0"
        },
        {
            "rowId": "b1",
            "sessionId": "session-001",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "12.5"
        },
        {
            "rowId": "b2",
            "sessionId": "session-001",
            "sku": "missing-second",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "5"
        },
        {
            "rowId": "b3",
            "sessionId": "session-001",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "7"
        },
        {
            "rowId": "b4",
            "sessionId": "session-001",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "lot-01",
            "unit": "each",
            "quantity": "9"
        },
        {
            "rowId": "b5",
            "sessionId": "session-001",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "kg",
            "quantity": "1.125"
        }
    ],
    "countRows": [
        {
            "rowId": "c0",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0"
        },
        {
            "rowId": "c1",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.000"
        },
        {
            "rowId": "c2",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "12"
        },
        {
            "rowId": "c3",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "12.5"
        },
        {
            "rowId": "c4",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "missing-second",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "5"
        },
        {
            "rowId": "c5",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7"
        },
        {
            "rowId": "c6",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7"
        },
        {
            "rowId": "c7",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7"
        },
        {
            "rowId": "c8",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "9"
        },
        {
            "rowId": "c9",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "9"
        },
        {
            "rowId": "c10",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "g",
            "countedQuantity": "1125"
        },
        {
            "rowId": "c11",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "g",
            "countedQuantity": "1125"
        },
        {
            "rowId": "c12",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "count-only",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.1"
        },
        {
            "rowId": "c13",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "count-only",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.2"
        },
        {
            "rowId": "other-session",
            "sessionId": "another-session",
            "passId": "first",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "99"
        },
        {
            "rowId": "other-pass",
            "sessionId": "session-001",
            "passId": "ignored",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "88"
        }
    ],
    "baselineCsv": "",
    "countsCsv": "",
    "baselineColumns": {
        "rowId": "rowId",
        "sessionId": "sessionId",
        "sku": "sku",
        "locationId": "locationId",
        "lotId": "lotId",
        "unit": "unit",
        "quantity": "quantity"
    },
    "countColumns": {
        "rowId": "rowId",
        "sessionId": "sessionId",
        "passId": "passId",
        "sku": "sku",
        "locationId": "locationId",
        "lotId": "lotId",
        "unit": "unit",
        "countedQuantity": "countedQuantity"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("h_murdock/count-pass-consistency-evidence").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 = {
    "sessionId": "session-001",
    "firstPassId": "first",
    "recountPassId": "recount",
    "cutOffEvidence": "comparable",
    "baselineCoverage": "complete",
    "baselineRows": [
        {
            "rowId": "b0",
            "sessionId": "session-001",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "0",
        },
        {
            "rowId": "b1",
            "sessionId": "session-001",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "12.5",
        },
        {
            "rowId": "b2",
            "sessionId": "session-001",
            "sku": "missing-second",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "5",
        },
        {
            "rowId": "b3",
            "sessionId": "session-001",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "quantity": "7",
        },
        {
            "rowId": "b4",
            "sessionId": "session-001",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "lot-01",
            "unit": "each",
            "quantity": "9",
        },
        {
            "rowId": "b5",
            "sessionId": "session-001",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "kg",
            "quantity": "1.125",
        },
    ],
    "countRows": [
        {
            "rowId": "c0",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0",
        },
        {
            "rowId": "c1",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.000",
        },
        {
            "rowId": "c2",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "12",
        },
        {
            "rowId": "c3",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "revised",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "12.5",
        },
        {
            "rowId": "c4",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "missing-second",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "5",
        },
        {
            "rowId": "c5",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7",
        },
        {
            "rowId": "c6",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7",
        },
        {
            "rowId": "c7",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "duplicate-counter",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "7",
        },
        {
            "rowId": "c8",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "9",
        },
        {
            "rowId": "c9",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "tracked",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "9",
        },
        {
            "rowId": "c10",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "g",
            "countedQuantity": "1125",
        },
        {
            "rowId": "c11",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "units",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "g",
            "countedQuantity": "1125",
        },
        {
            "rowId": "c12",
            "sessionId": "session-001",
            "passId": "first",
            "sku": "count-only",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.1",
        },
        {
            "rowId": "c13",
            "sessionId": "session-001",
            "passId": "recount",
            "sku": "count-only",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "0.2",
        },
        {
            "rowId": "other-session",
            "sessionId": "another-session",
            "passId": "first",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "99",
        },
        {
            "rowId": "other-pass",
            "sessionId": "session-001",
            "passId": "ignored",
            "sku": "0001",
            "locationId": "warehouse-A",
            "lotId": "",
            "unit": "each",
            "countedQuantity": "88",
        },
    ],
    "baselineCsv": "",
    "countsCsv": "",
    "baselineColumns": {
        "rowId": "rowId",
        "sessionId": "sessionId",
        "sku": "sku",
        "locationId": "locationId",
        "lotId": "lotId",
        "unit": "unit",
        "quantity": "quantity",
    },
    "countColumns": {
        "rowId": "rowId",
        "sessionId": "sessionId",
        "passId": "passId",
        "sku": "sku",
        "locationId": "locationId",
        "lotId": "lotId",
        "unit": "unit",
        "countedQuantity": "countedQuantity",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("h_murdock/count-pass-consistency-evidence").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 '{
  "sessionId": "session-001",
  "firstPassId": "first",
  "recountPassId": "recount",
  "cutOffEvidence": "comparable",
  "baselineCoverage": "complete",
  "baselineRows": [
    {
      "rowId": "b0",
      "sessionId": "session-001",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "0"
    },
    {
      "rowId": "b1",
      "sessionId": "session-001",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "12.5"
    },
    {
      "rowId": "b2",
      "sessionId": "session-001",
      "sku": "missing-second",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "5"
    },
    {
      "rowId": "b3",
      "sessionId": "session-001",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "quantity": "7"
    },
    {
      "rowId": "b4",
      "sessionId": "session-001",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "lot-01",
      "unit": "each",
      "quantity": "9"
    },
    {
      "rowId": "b5",
      "sessionId": "session-001",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "kg",
      "quantity": "1.125"
    }
  ],
  "countRows": [
    {
      "rowId": "c0",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0"
    },
    {
      "rowId": "c1",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.000"
    },
    {
      "rowId": "c2",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "12"
    },
    {
      "rowId": "c3",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "revised",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "12.5"
    },
    {
      "rowId": "c4",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "missing-second",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "5"
    },
    {
      "rowId": "c5",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c6",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c7",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "duplicate-counter",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "7"
    },
    {
      "rowId": "c8",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "9"
    },
    {
      "rowId": "c9",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "tracked",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "9"
    },
    {
      "rowId": "c10",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "g",
      "countedQuantity": "1125"
    },
    {
      "rowId": "c11",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "units",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "g",
      "countedQuantity": "1125"
    },
    {
      "rowId": "c12",
      "sessionId": "session-001",
      "passId": "first",
      "sku": "count-only",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.1"
    },
    {
      "rowId": "c13",
      "sessionId": "session-001",
      "passId": "recount",
      "sku": "count-only",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "0.2"
    },
    {
      "rowId": "other-session",
      "sessionId": "another-session",
      "passId": "first",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "99"
    },
    {
      "rowId": "other-pass",
      "sessionId": "session-001",
      "passId": "ignored",
      "sku": "0001",
      "locationId": "warehouse-A",
      "lotId": "",
      "unit": "each",
      "countedQuantity": "88"
    }
  ],
  "baselineCsv": "",
  "countsCsv": "",
  "baselineColumns": {
    "rowId": "rowId",
    "sessionId": "sessionId",
    "sku": "sku",
    "locationId": "locationId",
    "lotId": "lotId",
    "unit": "unit",
    "quantity": "quantity"
  },
  "countColumns": {
    "rowId": "rowId",
    "sessionId": "sessionId",
    "passId": "passId",
    "sku": "sku",
    "locationId": "locationId",
    "lotId": "lotId",
    "unit": "unit",
    "countedQuantity": "countedQuantity"
  }
}' |
apify call h_murdock/count-pass-consistency-evidence --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,h_murdock/count-pass-consistency-evidence"
        }
    }
}
```

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/kBgBwgd5yhlVxjR3p/builds/FfQVGkbOdT7FShX9V/openapi.json
