# Purchase Order vs. Supplier Invoice Checker (`btvglobalco/my-actor-1`) Actor

Compare purchase order and supplier invoice CSVs for price and quantity mismatches, duplicates, and missing PO lines. Sample finding: $72 in price differences across two invoices. Download a report with source rows. $0.50 per comparison. Inputs and reports are stored in Apify.

- **URL**: https://apify.com/btvglobalco/my-actor-1.md
- **Developed by:** [BTVGlobalCo](https://apify.com/btvglobalco) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / completed invoice comparison

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

## Purchase Order vs. Supplier Invoice Checker

Compare a purchase order CSV and a supplier invoice CSV by supplier, PO number, and PO line. Run the prefilled example or replace both samples with your own files. Open Output to find the CSV report, or use Storage → Key-value store → REPORT.csv.

#### See a sample result

The prefilled example finds **$72 in price differences** on PO-100 across two invoice rows. It also flags a separate excess unit, a unit mismatch, a duplicate line, and an invoice line with no PO match. The CSV shows the original row numbers so you can verify each finding.

A completed comparison costs **$0.50**. The example above is visible without running the Actor.

### CSV format

Use UTF-8 comma-delimited files, up to 10,000 rows and 5 MB per file. The purchase order CSV needs supplier_id, po_number, po_line, unit, currency, quantity, and unit_price. The invoice CSV needs those headings plus invoice_id and invoice_line. Include all invoice lines you want counted toward the purchase order. Use positive or zero amounts without currency symbols.

### What the report shows

Find price differences, excess billed quantities, duplicate IDs, mismatched units or currencies, and invoice lines without a matching PO line. Source row numbers show where to review each finding. The sample flags a $72 price difference across two invoices. Price variance and excess quantity are reported separately. Credits, fees, receipts, and currency conversion are outside this version.

### Pricing and storage

A completed comparison costs $0.50. The inputs and report use your Apify run storage. The Actor reports discrepancies for review and does not approve or pay invoices.

Comparing two supplier price lists? Use the [Supplier Price List Checker](https://apify.com/btvglobalco/my-actor).

# Actor input Schema

## `previousFile` (type: `string`):

Required headers: supplier_id, po_number, po_line, unit, currency, quantity, unit_price. Use UTF-8 CSV. Replace both samples to compare your files.

## `currentFile` (type: `string`):

Required headers: supplier_id, po_number, po_line, unit, currency, quantity, unit_price, invoice_id, invoice_line. Use UTF-8 CSV. Replace both samples to compare your files.

## `previousCsv` (type: `string`):

Required headers: supplier_id, po_number, po_line, unit, currency, quantity, unit_price. Use UTF-8 CSV. Replace both samples to compare your files.

## `currentCsv` (type: `string`):

Required headers: supplier_id, po_number, po_line, unit, currency, quantity, unit_price, invoice_id, invoice_line. Use UTF-8 CSV. Replace both samples to compare your files.

## Actor input object example

```json
{
  "previousCsv": "supplier_id,po_number,po_line,unit,currency,quantity,unit_price\nV01,PO-100,001,EA,USD,24,18\nV01,PO-100,002,EA,USD,5,4\nV01,PO-100,003,EA,USD,2,10\nV01,PO-100,004,EA,USD,6,2\n",
  "currentCsv": "supplier_id,po_number,po_line,unit,currency,quantity,unit_price,invoice_id,invoice_line\nV01,PO-100,001,EA,USD,12,21,INV-1,01\nV01,PO-100,001,EA,USD,12,21,INV-2,01\nV01,PO-100,002,EA,USD,6,4,INV-1,02\nV01,PO-100,003,CASE,USD,2,10,INV-1,03\nV01,PO-100,004,EA,USD,2,2,INV-2,02\nV01,PO-100,004,EA,USD,2,2,INV-2,02\nV01,PO-999,001,EA,USD,1,8,INV-2,03\n"
}
```

# Actor output Schema

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

No description

## `summary` (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 = {
    "previousCsv": `supplier_id,po_number,po_line,unit,currency,quantity,unit_price
V01,PO-100,001,EA,USD,24,18
V01,PO-100,002,EA,USD,5,4
V01,PO-100,003,EA,USD,2,10
V01,PO-100,004,EA,USD,6,2`,
    "currentCsv": `supplier_id,po_number,po_line,unit,currency,quantity,unit_price,invoice_id,invoice_line
V01,PO-100,001,EA,USD,12,21,INV-1,01
V01,PO-100,001,EA,USD,12,21,INV-2,01
V01,PO-100,002,EA,USD,6,4,INV-1,02
V01,PO-100,003,CASE,USD,2,10,INV-1,03
V01,PO-100,004,EA,USD,2,2,INV-2,02
V01,PO-100,004,EA,USD,2,2,INV-2,02
V01,PO-999,001,EA,USD,1,8,INV-2,03`
};

// Run the Actor and wait for it to finish
const run = await client.actor("btvglobalco/my-actor-1").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 = {
    "previousCsv": """supplier_id,po_number,po_line,unit,currency,quantity,unit_price
V01,PO-100,001,EA,USD,24,18
V01,PO-100,002,EA,USD,5,4
V01,PO-100,003,EA,USD,2,10
V01,PO-100,004,EA,USD,6,2
""",
    "currentCsv": """supplier_id,po_number,po_line,unit,currency,quantity,unit_price,invoice_id,invoice_line
V01,PO-100,001,EA,USD,12,21,INV-1,01
V01,PO-100,001,EA,USD,12,21,INV-2,01
V01,PO-100,002,EA,USD,6,4,INV-1,02
V01,PO-100,003,CASE,USD,2,10,INV-1,03
V01,PO-100,004,EA,USD,2,2,INV-2,02
V01,PO-100,004,EA,USD,2,2,INV-2,02
V01,PO-999,001,EA,USD,1,8,INV-2,03
""",
}

# Run the Actor and wait for it to finish
run = client.actor("btvglobalco/my-actor-1").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 '{
  "previousCsv": "supplier_id,po_number,po_line,unit,currency,quantity,unit_price\\nV01,PO-100,001,EA,USD,24,18\\nV01,PO-100,002,EA,USD,5,4\\nV01,PO-100,003,EA,USD,2,10\\nV01,PO-100,004,EA,USD,6,2\\n",
  "currentCsv": "supplier_id,po_number,po_line,unit,currency,quantity,unit_price,invoice_id,invoice_line\\nV01,PO-100,001,EA,USD,12,21,INV-1,01\\nV01,PO-100,001,EA,USD,12,21,INV-2,01\\nV01,PO-100,002,EA,USD,6,4,INV-1,02\\nV01,PO-100,003,CASE,USD,2,10,INV-1,03\\nV01,PO-100,004,EA,USD,2,2,INV-2,02\\nV01,PO-100,004,EA,USD,2,2,INV-2,02\\nV01,PO-999,001,EA,USD,1,8,INV-2,03\\n"
}' |
apify call btvglobalco/my-actor-1 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,btvglobalco/my-actor-1"
        }
    }
}
```

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/hwywbyNtOfTxaxKLn/builds/8kKB32QLfLzrAGn4D/openapi.json
