# Purchase Offer Validator: Item, Cost & Evidence (`agentutilitylabs/purchase-offer-validator`) Actor

Check supplied offers against purchasing requirements in batches. Flag item, condition, quantity, total, freshness and delivery mismatches. Does not buy or fetch products.

- **URL**: https://apify.com/agentutilitylabs/purchase-offer-validator.md
- **Developed by:** [Juan Carlos Morales](https://apify.com/agentutilitylabs) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 purchase comparisons

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 Offer Validator

Check whether a structured offer meets the purchasing requirements your agent already holds. Process up to 100 comparisons in a batch and receive structured results suitable for a workflow branch, review queue or audit record.

This tool checks exact product identifiers and variants, item condition, quantity, currency, destination reference, reported stock, order-total arithmetic, budget, quote freshness, delivery date and return-window length. An optional previous offer exposes changed fields and price differences.

### Try it

Run `{"demo": true, "checks": []}` for three fictional examples: a match, a refurbished-item mismatch and unknown shipping. These samples trigger no `purchase-checked` event fee. Any platform charges shown in Console remain applicable. The demo never checks your own purchases.

For your own offers, send `{"demo": false, "checks": [PAYLOAD]}`. Each PAYLOAD contains `requirements`, `offer`, and optionally `previous_offer`. The complete JSON Schema is included as `PURCHASE_SCHEMA.json`. The demo output is a result, not a reusable current quote; supply actual offer facts from your authorized source.

Money must be decimal strings. Cost components are whole-order amounts: subtotal + shipping + tax + fees - discount = total. Quantities must already be normalized to the same sellable unit; this Actor does not infer pack sizes or minimum orders. Use one identifier namespace and exact variant attributes. Use opaque destination references, not addresses. Unsupported facts must be null, not invented values. Supplied timestamps must have a timezone.

### Results

One dataset row per completed comparison, in input order:

- `matches_supplied_requirements`: supplied facts satisfy the requirements.
- `mismatch`: at least one supplied fact conflicts with a requirement.
- `needs_evidence`: necessary information is missing or stale.

Rows include `input_index`, `issues`, `changes`, `computed_total`, `reported_total`, `input_sha256`, and `payment_authorized: false`. `OUTPUT` in the run's key-value store summarizes delivered comparisons and spending-limit stops.

### Charging

Price: $0.01 per completed comparison (`purchase-checked` event). One completed non-demo comparison triggers one event, including mismatch and needs-evidence results. Invalid batches are rejected before any comparison event. There is no event charge for fictional demos.

Set a maximum run charge in Console or the API. The Actor stops when its SDK reports the event budget is exhausted. Results already delivered remain in the dataset. Check OUTPUT and the dataset before retrying. Restarting an already-started run is refused to reduce duplicate processing; starting a separate run is a new request and can incur a new charge. Interrupted storage/payment operations are not guaranteed atomic and must be reconciled before retries.

### Scope and privacy

The Actor does not scrape, retrieve prices, verify merchant claims, parse documents, place orders, authorize payment, establish product compatibility, or guarantee delivery/returns. A matching result is not permission to spend. It needs no merchant credentials, browsing proxy or LLM key.

Apify stores run inputs and result datasets under its platform settings; this hosted version is not local-only. Do not submit credentials, payment-card details, customer identities, street addresses or confidential source URLs. Result rows can contain supplied offer IDs, source references and changed values. Keep run datasets private and control retention through your Apify account. We do not add a separate analytics or data-resale pipeline.

Maximum input: 1 MB and 100 comparisons. Execution is batch-based, not a low-latency payment gate. Caller-submitted strings and URLs are treated as data, not fetched or executed.

For agent integration, call this Actor through the Apify API or an Apify MCP tool configured by your operator. Use the returned status and issues, while keeping purchase authorization in your existing workflow. Report reproducible issues with synthetic/redacted examples through the listing's Issues tab.

# Actor input Schema

## `demo` (type: `boolean`):

Three generated examples; no purchase-checked event fee. Leave checks empty.

## `checks` (type: `array`):

1–100 supplied requirements/offer pairs. Set demo=false for real inputs. Use decimal strings and null for unknown facts.

## Actor input object example

```json
{
  "demo": true,
  "checks": []
}
```

# Actor output Schema

## `results` (type: `string`):

One row per completed comparison, including status, costs, mismatches and missing evidence.

## `summary` (type: `string`):

Requested and delivered comparison counts and whether the spending limit stopped the batch. Created for valid inputs.

# 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 = {
    "demo": true,
    "checks": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("agentutilitylabs/purchase-offer-validator").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 = {
    "demo": True,
    "checks": [],
}

# Run the Actor and wait for it to finish
run = client.actor("agentutilitylabs/purchase-offer-validator").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 '{
  "demo": true,
  "checks": []
}' |
apify call agentutilitylabs/purchase-offer-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,agentutilitylabs/purchase-offer-validator"
        }
    }
}
```

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/K0zh6vPHphRh4gDVK/builds/4adny2dHYdheUTpkU/openapi.json
