# Supplier Invoice Price Check - Dated Contract Price Audit (`wheresprada/supplier-invoice-price-check`) Actor

Compare invoice CSV batches with supplier price agreements effective on each invoice date. Flag price differences, overlapping agreements and missing matches; download a traceable review report. No ERP login or OCR.

- **URL**: https://apify.com/wheresprada/supplier-invoice-price-check.md
- **Developed by:** [Mahruf Hossain](https://apify.com/wheresprada) (community)
- **Categories:** Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / completed supplier price review

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

## Supplier Invoice Price Check

**Check what suppliers billed against the price that applied on the invoice date.** Paste an invoice CSV and a dated supplier price list. Receive a review report showing price differences, missing agreements and conflicting records, with the exact CSV row references behind each finding.

This is for accounts-payable teams, procurement analysts, distributors and outsourced bookkeepers who already have structured exports and want an independent price check without connecting an ERP. It helps organize a review; it does not decide whether an invoice should be paid or whether money is recoverable.

### Key features

- **Date-effective prices:** January invoices use January agreements rather than today's price list. Validity dates are inclusive.
- **Batch checking:** Up to 5,000 invoice lines against 5,000 agreement rows in one report, within a 2 MB input limit.
- **Visible evidence:** Each line includes the invoice CSV row, selected agreement row, compared prices and the calculated difference.
- **Honest uncertainty:** Missing prices, overlapping agreements, duplicate invoice-line IDs, incompatible units and different currencies are review findings, never silent matches.
- **Decimal calculations:** Prices and quantities retain up to six decimal places. Extended differences retain twelve; amounts are not silently rounded to cents.
- **Simple setup:** Two CSV text boxes, one optional tolerance. No additional API key, OCR subscription, external crawler or accounting-system login.

### Who should use it?

Finance teams reviewing recurring supplier bills; purchasing teams checking agreed price changes; accounting practices preparing a client's discrepancy list; and automation developers handling periodic invoice exports.

It fits workflows where supplier and SKU identifiers are already consistent. If your invoices are scanned PDFs, your product codes differ between systems, or you need receipt/PO quantity reconciliation, prepare the data first or use a different tool.

### Practical uses

1. Check a monthly invoice batch against agreements that changed partway through the month.
2. Review a distributor's bills against independently maintained supplier price lists.
3. Identify invoices with no applicable price agreement before a person investigates them.
4. Recheck bookkeeping exports after correcting a duplicate record or an overlapping validity period.
5. Add a consistent price-review step to an existing API workflow without granting access to the accounting system.

### Quick start

Open the Actor's Input tab. Both CSV boxes contain a working **invented demonstration**, so your first run needs no files or credentials. A completed demonstration is charged at the displayed report price.

The demonstration has two agreements for the same item. One invoice uses the earlier agreed price correctly; the other bills 2.40 against a later agreement of 2.20 for 100 units. The report shows a 20.000000000000 price difference requiring investigation.

For your own records, paste CSV text exported with the following exact headers. Column order may vary; extra columns are rejected to discourage accidental submission of unnecessary information.

```json
{
  "agreementsCsv": "supplierId,sku,unit,currency,unitPrice,validFrom,validTo\nDEMO-SUPPLIER,BOLT,EA,USD,2.00,2026-01-01,2026-06-30\nDEMO-SUPPLIER,BOLT,EA,USD,2.20,2026-07-01,2026-12-31",
  "invoicesCsv": "invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate\nDEMO-INV-1,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.00,2026-05-01\nDEMO-INV-2,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.40,2026-09-01",
  "tolerancePercent": "0"
}
```

### Input reference

| Field | Required | Default | Rules |
|---|---|---|---|
| `agreementsCsv` | Yes | Demonstration prefill | 1–5,000 agreement rows; headers shown above |
| `invoicesCsv` | Yes | Demonstration prefill | 1–5,000 positive invoice lines; headers shown above |
| `tolerancePercent` | No | `"0"` | Decimal string from 0 to 100; six decimal places maximum |

Identifiers are exact and case-sensitive after surrounding whitespace is removed. Preserve leading zeros. Each text value is limited to 100 characters. Quoted commas, escaped quotes, UTF-8 BOM, LF and CRLF are accepted. Multiline cell values and control characters are rejected.

Prices and quantities use plain nonnegative decimals, without currency symbols, commas or scientific notation. Quantity must exceed zero. Dates must be actual calendar dates in `YYYY-MM-DD`. Use consistent three-letter uppercase currency codes; the Actor checks their format, not membership in the ISO registry. Units are exact text labels such as `EA`; no box-to-piece conversion is attempted. At most 100 dated agreements may share one supplier/SKU key.

### Output and interpretation

Open **Full report (JSON)** in Output. The dataset contains the same complete report as one item. This verified demonstration excerpt shows the second invoice line; the full report also includes timestamps, counts, per-currency totals and an SHA-256 fingerprint of the input.

```json
{
  "invoiceId": "DEMO-INV-2",
  "lineId": "1",
  "supplierId": "DEMO-SUPPLIER",
  "sku": "BOLT",
  "currency": "USD",
  "unit": "EA",
  "invoiceDate": "2026-09-01",
  "invoiceSourceRow": 3,
  "invoicedUnitPrice": "2.40",
  "quantity": "100",
  "agreementSourceRow": 3,
  "agreedUnitPrice": "2.20",
  "priceDifference": "0.200000",
  "extendedDifference": "20.000000000000",
  "status": "ABOVE_AGREED_PRICE"
}
```

`WITHIN_TOLERANCE` means the provided prices agree within your allowance. `ABOVE_AGREED_PRICE` and `BELOW_AGREED_PRICE` identify differences outside it. `NO_ACTIVE_AGREEMENT`, `AMBIGUOUS_AGREEMENT`, `DUPLICATE_INVOICE_LINE`, `CURRENCY_MISMATCH` and `UNIT_MISMATCH` mean that line cannot be compared safely. Those lines have no calculated extended difference. Review-required is true whenever any line needs attention.

Observed difference totals are separated by currency and direction. They include comparable lines inside tolerance as well as outside it. They do **not** represent confirmed overpayments, outstanding claims, lost revenue or available savings.

### How checking works

The Actor finds agreements by exact supplier/SKU and invoice date. Exactly one active agreement is required. It then checks units and currency before comparing net unit prices and multiplying the price difference by the invoiced quantity. A duplicate supplier/invoice/line identity excludes every occurrence. Overlapping agreements are never resolved by choosing a convenient price.

Tolerance applies to the absolute unit-price difference relative to the agreed price; equality passes. A positive invoice price against a zero agreement is outside tolerance. No language model performs calculations or makes matching decisions.

### Pricing

Launch price: **$0.10 per completed report**, covering the documented input limits. One `price-check-completed` event is charged after output is saved. Findings and unresolved matches are still useful completed reports and count. Malformed input fails before the report event. Repeating the same input creates another report and another charge.

| Completed reports | Actor report charges |
|---:|---:|
| 1 | $0.10 |
| 100 | $10.00 |
| 1,000 | $100.00 |

The Store Pricing tab is authoritative. Apify may separately display platform or start charges according to the run's pricing settings. There are no proxy, OCR or third-party API charges from this implementation. A run's spending limit must cover the complete report event; setting a lower budget does not buy a partial report.

### API and scheduling

Use the official Apify client, passing a securely stored token through the environment. This Python example runs the same demonstration and retrieves its report:

```python
import json, os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
with open("sample_input.json", encoding="utf-8") as f:
    input_data = json.load(f)
run = client.actor("wheresprada/supplier-invoice-price-check").call(
    run_input=input_data, memory_mbytes=128, timeout_secs=30,
    max_total_charge_usd=0.25)
report = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("OUTPUT")["value"]
print(report["summary"])
```

The Actor API tab provides JavaScript and HTTP equivalents. For periodic use, save a task and refresh the input exports for each period. A schedule rerunning an unchanged task does not fetch new supplier data. Configure an Apify success webhook to notify your downstream workflow and retrieve OUTPUT using the completed run ID. Avoid automatically approving payments from a finding report.

### Limits and accuracy

This checks the records you provide, not their completeness, authenticity or contractual enforceability. It does not read PDFs, collect invoices, match fuzzy descriptions, reconcile delivered quantities, inspect taxes/freight/discounts, process credit notes, perform FX conversion, or write to accounting systems. Use already comparable net unit prices. Different price-per-pack bases must be normalized before input.

Memory is fixed at 128 MB; documented runtime target is under 30 seconds. Inputs exceeding limits fail clearly. Export valid dated agreements covering the whole invoice period; incomplete references create unresolved matches. A clean result is not an audit opinion or payment authorization.

### Privacy and security

No customer data is sent to an external API or model. The Actor requires limited Apify permissions and writes only its own run storage. Inputs and reports are still processed and retained on Apify according to your platform/account storage settings. This is not zero retention. Submit only authorized operational data; exclude names, bank details, credentials and other unnecessary personal information. No certifications or regulatory guarantees are claimed.

### Troubleshooting and FAQ

**Why is an agreement missing?** Check exact supplier/SKU spelling and whether the invoice date falls within the inclusive validity period.

**Why are two valid prices ambiguous?** More than one agreement covers that supplier/SKU and date. Correct the overlap; the Actor does not guess which contract takes precedence.

**Can I upload an Excel workbook or PDF?** Not directly. Export the required columns as CSV and paste the text. Preserve decimal precision and text IDs.

**Can a BOX price match an EA invoice?** No. Normalize both to the same unit and price basis before running.

**Why does a small difference appear in totals but not need review?** Totals show observed differences even inside tolerance. Review status follows your configured allowance.

**Does a duplicate mean the supplier billed twice?** No. It means duplicate identities exist in your input; investigate the export and underlying documents.

**Does a price difference prove money is owed?** No. Discounts, amendments and other terms outside this input may explain it. Check the original records before acting.

**Will a failed input be charged?** It does not create a completed-report event. Apify's own applicable platform charges can still apply to an attempted run.

### Support

Use the Actor's Apify Issues tab. Include the run ID, expected behavior and a minimal invented example reproducing the problem. Do not post confidential invoices or credentials publicly. Support and fixes are provided through the listing; no response-time guarantee is advertised.

# Actor input Schema

## `agreementsCsv` (type: `string`):

1–5000 rows. Headers: supplierId,sku,unit,currency,unitPrice,validFrom,validTo. Dates YYYY-MM-DD; prices plain decimals. Inclusive validity dates.

## `invoicesCsv` (type: `string`):

1–5000 rows. Headers: invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate. Positive quantities only. No names, bank details or personal information.

## `tolerancePercent` (type: `string`):

Default 0. Plain decimal 0–100 with at most six decimal places. Equality is allowed. Applied in both directions.

## Actor input object example

```json
{
  "agreementsCsv": "supplierId,sku,unit,currency,unitPrice,validFrom,validTo\nDEMO-SUPPLIER,BOLT,EA,USD,2.00,2026-01-01,2026-06-30\nDEMO-SUPPLIER,BOLT,EA,USD,2.20,2026-07-01,2026-12-31",
  "invoicesCsv": "invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate\nDEMO-INV-1,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.00,2026-05-01\nDEMO-INV-2,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.40,2026-09-01",
  "tolerancePercent": "0"
}
```

# Actor output Schema

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

No description

## `reports` (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 = {
    "agreementsCsv": `supplierId,sku,unit,currency,unitPrice,validFrom,validTo
DEMO-SUPPLIER,BOLT,EA,USD,2.00,2026-01-01,2026-06-30
DEMO-SUPPLIER,BOLT,EA,USD,2.20,2026-07-01,2026-12-31`,
    "invoicesCsv": `invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate
DEMO-INV-1,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.00,2026-05-01
DEMO-INV-2,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.40,2026-09-01`,
    "tolerancePercent": "0"
};

// Run the Actor and wait for it to finish
const run = await client.actor("wheresprada/supplier-invoice-price-check").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 = {
    "agreementsCsv": """supplierId,sku,unit,currency,unitPrice,validFrom,validTo
DEMO-SUPPLIER,BOLT,EA,USD,2.00,2026-01-01,2026-06-30
DEMO-SUPPLIER,BOLT,EA,USD,2.20,2026-07-01,2026-12-31""",
    "invoicesCsv": """invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate
DEMO-INV-1,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.00,2026-05-01
DEMO-INV-2,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.40,2026-09-01""",
    "tolerancePercent": "0",
}

# Run the Actor and wait for it to finish
run = client.actor("wheresprada/supplier-invoice-price-check").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 '{
  "agreementsCsv": "supplierId,sku,unit,currency,unitPrice,validFrom,validTo\\nDEMO-SUPPLIER,BOLT,EA,USD,2.00,2026-01-01,2026-06-30\\nDEMO-SUPPLIER,BOLT,EA,USD,2.20,2026-07-01,2026-12-31",
  "invoicesCsv": "invoiceId,lineId,supplierId,sku,unit,currency,quantity,unitPrice,invoiceDate\\nDEMO-INV-1,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.00,2026-05-01\\nDEMO-INV-2,1,DEMO-SUPPLIER,BOLT,EA,USD,100,2.40,2026-09-01",
  "tolerancePercent": "0"
}' |
apify call wheresprada/supplier-invoice-price-check --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,wheresprada/supplier-invoice-price-check"
        }
    }
}
```

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/8wOIeYFkxiSNwQxWW/builds/SYjHoiBSAE3RArsYG/openapi.json
