# Square Catalog Import Preflight (`atesen-software/square-catalog-import-preflight`) Actor

Compare a Square catalog CSV export with an import draft. Flag changed prices, stock, SKUs, locations and missing items before you upload.

- **URL**: https://apify.com/atesen-software/square-catalog-import-preflight.md
- **Developed by:** [Atesen Software](https://apify.com/atesen-software) (community)
- **Categories:** E-commerce, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.02 / completed 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

## Square Catalog Import Preflight

Compare your current Square item library export with the CSV you are about to import, and get a list of every risky or changed field before Square sees it: SKUs that lost leading zeros, items disabled at a location, location price changes, stock set to zero, missing tokens and rows that cannot be matched. Each completed comparison costs **$0.02**, whatever the file size.

### How it works

1. Export your current item library from Square as CSV.
2. Paste that export in `currentCsv` and your draft import in `draftCsv`. Both need the original `Token` column. Leave `replace` off for a partial update.
3. Read the findings. Each one names the CSV line, item, variation, token, field, and the value before and after.

This is a file comparison. It makes no requests to Square and never writes to your item library. It cannot promise that Square will accept the draft. Replacement mode lists tokens the draft leaves out when both files can be matched without doubt; it does not guess what a missing location column will do during import.

### Input

| Field | What it does |
|---|---|
| `currentCsv` | Current Square item library export, up to 256 KiB and 20,000 rows |
| `draftCsv` | The CSV you plan to import, same limits |
| `replace` | `true` if the draft will replace the whole library, `false` (default) for a partial update |

```json
{
  "currentCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\nDEMO-A,Ceramic Mug,Blue,,0012,25.00,25.00,Y",
  "draftCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\nDEMO-A,Ceramic Mug,Blue,,12,25.00,2.50,N"
}
```

### Output

One `report` row per run. Real output for the example above (one finding shown in full):

```json
{
  "recordType": "report",
  "mode": "update",
  "currentRows": 1,
  "draftRows": 1,
  "matchedRows": 1,
  "riskCount": 2,
  "uncertainCount": 0,
  "changeCount": 1,
  "notices": ["Stock check skipped. The draft has no quantity columns."],
  "findings": [
    { "group": "risk", "kind": "SKU loses leading zeros", "file": "Draft", "line": 2, "name": "Ceramic Mug", "variation": "Blue", "token": "DEMO-A", "sku": "12", "field": "SKU", "before": "0012", "after": "12" },
    { "group": "risk", "kind": "Item disabled at location", "field": "Enabled Downtown", "before": "Y", "after": "N" },
    { "group": "change", "kind": "Location price changes", "field": "Price Downtown", "before": "25.00", "after": "2.50" }
  ]
}
```

Findings are grouped as `risk` (likely mistakes), `uncertain` (needs a person to decide) and `change` (intended edits worth a second look). Open the dataset JSON to see every finding.

If no report is written (empty or invalid input, a file over the limits, or a maximum cost per run below $0.02), the run writes one free `status` row that says what to fix, and charges nothing.

### Use via API

Keep your token in the `Authorization` header, not in the URL:

```bash
curl -X POST "https://api.apify.com/v2/acts/atesen-software~square-catalog-import-preflight/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"currentCsv": "Token,Item Name,SKU,Price\nT-1,Mug,0012,25.00", "draftCsv": "Token,Item Name,SKU,Price\nT-1,Mug,12,25.00"}'
```

### Pricing

Pay per event: **$0.02 per completed comparison** (event `report`), no matter how many findings. There is no start fee. Status rows for empty or invalid input and a too-low budget are free.

### Data and privacy

The only data is what you paste. Apify keeps the input and the report in your own run storage. Use catalogs you are allowed to process and keep customer or employee details out of the CSVs. Column names follow Square's [item import guide](https://squareup.com/help/us/en/article/5153-import-items-online) and [location price overrides](https://squareup.com/help/us/en/article/8242-create-item-price-overrides-for-multiple-locations-in-square-dashboard). This Actor is independent and is not made or endorsed by Square.

Built and maintained by Atesen Software

# Actor input Schema

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

Paste the UTF-8 CSV from Square's Item Library, including its Token column. Maximum 256 KiB.

## `draftCsv` (type: `string`):

Paste the proposed import CSV from the same catalog, including the header. Maximum 256 KiB.

## `replace` (type: `boolean`):

Enable only when the draft is intended to contain the entire catalog. Keep off for partial updates.

## Actor input object example

```json
{
  "currentCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\nDEMO-A,Ceramic Mug,Blue,,0012,25.00,25.00,Y",
  "draftCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\nDEMO-A,Ceramic Mug,Blue,,12,25.00,2.50,N",
  "replace": false
}
```

# Actor output Schema

## `reports` (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 = {
    "currentCsv": `Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown
DEMO-A,Ceramic Mug,Blue,,0012,25.00,25.00,Y`,
    "draftCsv": `Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown
DEMO-A,Ceramic Mug,Blue,,12,25.00,2.50,N`
};

// Run the Actor and wait for it to finish
const run = await client.actor("atesen-software/square-catalog-import-preflight").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 = {
    "currentCsv": """Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown
DEMO-A,Ceramic Mug,Blue,,0012,25.00,25.00,Y""",
    "draftCsv": """Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown
DEMO-A,Ceramic Mug,Blue,,12,25.00,2.50,N""",
}

# Run the Actor and wait for it to finish
run = client.actor("atesen-software/square-catalog-import-preflight").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 '{
  "currentCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\\nDEMO-A,Ceramic Mug,Blue,,0012,25.00,25.00,Y",
  "draftCsv": "Token,Item Name,Variation Name,Description,SKU,Price,Price Downtown,Enabled Downtown\\nDEMO-A,Ceramic Mug,Blue,,12,25.00,2.50,N"
}' |
apify call atesen-software/square-catalog-import-preflight --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,atesen-software/square-catalog-import-preflight"
        }
    }
}
```

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/5Jqx7Zl2qmPGuui9T/builds/X4p9lNmNgBEI9ZYZa/openapi.json
