# CatalogOps — Shopify CSV preflight (`chartreuse_oast/catalogops-shopify-csv-preflight`) Actor

Prepare supplier CSVs for simple Shopify products. Check price changes and mapped blank fields against a baseline, preserve SKU zeros, and return a validation report plus CSV only when preparation passes. No Shopify connection or import. Up to 1,000 rows.

- **URL**: https://apify.com/chartreuse\_oast/catalogops-shopify-csv-preflight.md
- **Developed by:** [jcastra](https://apify.com/chartreuse_oast) (community)
- **Categories:** E-commerce, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.05 / prepared csv file

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## CatalogOps — Shopify CSV preflight

Prepare supplier CSVs for simple Shopify products and inspect price changes and blank fields before importing. This independent tool is not affiliated with Shopify. Version 0.2.2 adds pay-per-event billing. The preparation engine in version 0.2.1 passed six private Apify cloud runs with synthetic data, including 100 and 1,000 rows and rejection of empty or over-limit input; version 0.2.2 also passed prepared/rejected private cloud checks before pricing was enabled. PPE pricing is configured at $0.05 per prepared file. Three private cloud checks of version 0.2.2 verified one prepared-file event after successful preparation, no event on rejected input, and no event when maxChargeEvents=0 rejected preparation. These owner-account checks are not external sales. No external payment or Shopify import has been verified.

### Input

Paste UTF-8 CSV into `supplierCsv`, declare target-to-source columns in `mapping`, and include `baselineCsv` from Shopify when preparing updates. The prefilled two-product example is synthetic. No store credentials are required.

The baseline must identify each simple product once and include default Option1 name/value. Every mapped field for a matching product must be present in the baseline; a missing column is unknown and rejects preparation. Repeated handles, extra image rows, variants, linked options and unknown default options are rejected. Without a baseline, use only for products you have confirmed are new; existing variants cannot be verified.

Mapping requires a handle, title and price. Both current and supported legacy Shopify target names work. Output uses current headings plus default option columns. Mapped blank values that would erase baseline data reject the entire file. For an optional column you intend to preserve, omit it from mapping. SKU/barcode strings retain leading zeros. Decimal separator is explicit; NaN, infinity, currency symbols, thousands separators and fractional precision above two decimals are rejected. Status, when mapped, must be active, draft or archived. Handles are restricted to ASCII letters, digits and dashes.

### Results

Read `OUTPUT` first: `status` is `prepared` or `rejected`, and `preparedKey` is null on rejection. `report.json` includes validation issues and, when the input reaches product comparison, before/after field changes and input hashes. Structural input or limit failures produce a short rejection report. `prepared.csv` exists only on success. A run can finish successfully with a rejected business input; use the manifest status to decide whether to import.

Successful preparation also saves one summary row in the default dataset before requesting any prepared-file charge. It contains `status=prepared`, the run ID, record count, storage keys for the manifest/report/CSV, and input/result hashes; it does not contain the full CSV or assert payment. Read `OUTPUT.billingStatus` and the platform charge record for billing. A fresh rejected run has no dataset row. Resurrecting the same run reuses an identical summary instead of appending another row; a conflicting dataset fails for manual reconciliation. The dataset summary adds no charge event.

The output has no claim of guaranteed import acceptance. Review changes and your store settings before importing. CSV text may be interpreted as formulas by spreadsheet applications. Inspect JSON or import the CSV directly instead of opening untrusted product data in a spreadsheet.

### Limits

Each CSV defaults to 1 MB and 1,000 rows; hard ceilings are 5 MB and 1,000 rows. The mapping is at most 20 KB. Total generated output is capped at 20 MB. Preparation defaults to 15 seconds with a 30-second ceiling. The adapter allows 90 seconds including storage; set the platform run timeout to 120 seconds. Memory is fixed to 512 MB in the Actor definition. Preparation retries are zero; SDK storage may retry within the overall timeout.

Actor event price: $0.05 per prepared file, up to 1,000 rows per input CSV. PPE pricing is configured and the successful-preparation and rejection paths have been checked in private cloud runs. The Store pricing displayed for your run is authoritative. One `prepared-file` event is requested only after your CSV and report are saved and accessible. Rejected inputs have no prepared-file charge. No startup or dataset events are part of this offer. The default `maxChargeEvents=1` permits at most one event; setting it to 0 rejects preparation in PPE mode. Your platform spending limit must allow one event. Outside PPE mode, preparation does not request a charge; standard cloud resource usage may apply.

`OUTPUT.billingStatus` records `charged`, `not_charged`, `not_ppe`, `pending`, `uncertain` or `limit_reached`. `chargeEvents` is 0, 1, or null when the result is unresolved. On an interrupted run, consult the platform charge record; do not interpret a pending receipt as payment confirmation. Already delivered files remain accessible. Resurrecting the same run does not request a second charge; unresolved charges require reconciliation. There is no proxy, AI API, web crawling, external URL download or Shopify write.

Inventory, image availability, Markets pricing, metafields, custom fulfillment and additional Shopify import requirements are outside this version's checks. Do not send customer/order CSVs or credentials. Input and output are stored in the run's Apify storage; access and retention follow that account's settings.

# Actor input Schema

## `supplierCsv` (type: `string`):

UTF-8 CSV text; synthetic example prefilled. No URL fetching.

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

Required for comparison with existing products. Include default Option1 name/value and every mapped field for matching products. Missing fields are unknown and reject preparation. Omit baseline only for products confirmed new.

## `mapping` (type: `object`):

Maps Shopify target names to supplier source headers. Simple products only.

## `maxRows` (type: `integer`):

Row limit per CSV

## `maxBytes` (type: `integer`):

Byte limit per CSV

## `timeoutSecs` (type: `integer`):

Preparation timeout seconds

## `maxRetries` (type: `integer`):

Preparation retries

## `maxChargeEvents` (type: `integer`):

At most one PPE event per run. Zero rejects preparation when PPE is enabled. Platform spending limits also apply.

## Actor input object example

```json
{
  "supplierCsv": "sku,name,brand,price,barcode\n00042,\"Té verde, caja 20 unidades\",Ejemplo,12.50,0001234567895\n00043,Café 250 g,Ejemplo,18.00,0001234567802\n",
  "baselineCsv": "Handle,Title,Vendor,Variant SKU,Variant Price,Variant Barcode,Option1 Name,Option1 Value\n00042,\"Té verde, caja 20 unidades\",Ejemplo,00042,12.00,0001234567895,Title,Default Title\n",
  "mapping": {
    "product_mode": "simple",
    "columns": {
      "Handle": "sku",
      "Title": "name",
      "Vendor": "brand",
      "Variant SKU": "sku",
      "Variant Price": "price",
      "Variant Barcode": "barcode"
    },
    "delimiter": ",",
    "decimal_separator": ".",
    "max_price_change_percent": "50"
  },
  "maxRows": 1000,
  "maxBytes": 1000000,
  "timeoutSecs": 15,
  "maxRetries": 0,
  "maxChargeEvents": 1
}
```

# Actor output Schema

## `OUTPUT` (type: `string`):

Read status and preparedKey first.

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

Present on prepared or rejected input.

## `prepared.csv` (type: `string`):

Exists only if OUTPUT.preparedKey is not null; rejected runs have no CSV.

# 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 = {
    "supplierCsv": `sku,name,brand,price,barcode
00042,"Té verde, caja 20 unidades",Ejemplo,12.50,0001234567895
00043,Café 250 g,Ejemplo,18.00,0001234567802`,
    "baselineCsv": `Handle,Title,Vendor,Variant SKU,Variant Price,Variant Barcode,Option1 Name,Option1 Value
00042,"Té verde, caja 20 unidades",Ejemplo,00042,12.00,0001234567895,Title,Default Title`,
    "mapping": {
        "product_mode": "simple",
        "columns": {
            "Handle": "sku",
            "Title": "name",
            "Vendor": "brand",
            "Variant SKU": "sku",
            "Variant Price": "price",
            "Variant Barcode": "barcode"
        },
        "delimiter": ",",
        "decimal_separator": ".",
        "max_price_change_percent": "50"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("chartreuse_oast/catalogops-shopify-csv-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 = {
    "supplierCsv": """sku,name,brand,price,barcode
00042,\"Té verde, caja 20 unidades\",Ejemplo,12.50,0001234567895
00043,Café 250 g,Ejemplo,18.00,0001234567802
""",
    "baselineCsv": """Handle,Title,Vendor,Variant SKU,Variant Price,Variant Barcode,Option1 Name,Option1 Value
00042,\"Té verde, caja 20 unidades\",Ejemplo,00042,12.00,0001234567895,Title,Default Title
""",
    "mapping": {
        "product_mode": "simple",
        "columns": {
            "Handle": "sku",
            "Title": "name",
            "Vendor": "brand",
            "Variant SKU": "sku",
            "Variant Price": "price",
            "Variant Barcode": "barcode",
        },
        "delimiter": ",",
        "decimal_separator": ".",
        "max_price_change_percent": "50",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("chartreuse_oast/catalogops-shopify-csv-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 '{
  "supplierCsv": "sku,name,brand,price,barcode\\n00042,\\"Té verde, caja 20 unidades\\",Ejemplo,12.50,0001234567895\\n00043,Café 250 g,Ejemplo,18.00,0001234567802\\n",
  "baselineCsv": "Handle,Title,Vendor,Variant SKU,Variant Price,Variant Barcode,Option1 Name,Option1 Value\\n00042,\\"Té verde, caja 20 unidades\\",Ejemplo,00042,12.00,0001234567895,Title,Default Title\\n",
  "mapping": {
    "product_mode": "simple",
    "columns": {
      "Handle": "sku",
      "Title": "name",
      "Vendor": "brand",
      "Variant SKU": "sku",
      "Variant Price": "price",
      "Variant Barcode": "barcode"
    },
    "delimiter": ",",
    "decimal_separator": ".",
    "max_price_change_percent": "50"
  }
}' |
apify call chartreuse_oast/catalogops-shopify-csv-preflight --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chartreuse_oast/catalogops-shopify-csv-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/HTZN9pZGCKeUdJh9r/builds/6gILPvtsebUIi3bNw/openapi.json
