Skip to Content

Import a whole range

Load many products from one file, check the file first with a dry run, and read the result of every row.

Imports load many products from one file, for a first catalogue load or a full refresh. An import runs in the background and applies the same rules as sending products.

Start an import

POST/api/v1/importsproducts:write

The file is NDJSON with one product per line in the POST /api/v1/products format, or CSV with the same field names in the header row. In a CSV file, write dimensionsCm as dimensionsCm.w, dimensionsCm.h and dimensionsCm.d. Pass the file as fileUrl, an https link we can fetch. One import holds up to 100,000 products.

Request
{
  "fileUrl": "https://files.example.com/exports/products-2026-11-02.ndjson",
  "format": "ndjson"
}

POST /api/v1/imports answers 202 with the import. import.completed is sent when the import has finished.

curl -sS -X POST https://platform.charpstar.co/api/v1/imports \
  -H "Authorization: Bearer $CHARPSTAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fileUrl": "https://example.com/exports/catalogue.ndjson", "format": "ndjson" }'

Check a file with a dry run

With "dryRun": true, the whole file is checked and the outcome is reported without writing anything.

curl -sS -X POST https://platform.charpstar.co/api/v1/imports \
  -H "Authorization: Bearer $CHARPSTAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fileUrl": "https://example.com/exports/catalogue.ndjson", "format": "ndjson", "dryRun": true }'

See how an import is going

GET/api/v1/imports/{importId}products:read

This shows the import's status (queued, running, completed or failed), how many rows it has processed and a count for each result. orderId is the order the imported products landed in; it is null for a dry run. When an import failed, error says why.

curl -sS https://platform.charpstar.co/api/v1/imports/$IMPORT_ID \
  -H "Authorization: Bearer $CHARPSTAR_API_KEY"

Read the result of every row

GET/api/v1/imports/{importId}/resultsproducts:read

This returns one line per product, as NDJSON, with the same fields as a POST /api/v1/products result plus the row number, counting from 1. It is available once the import has finished.

curl -sS https://platform.charpstar.co/api/v1/imports/$IMPORT_ID/results \
  -H "Authorization: Bearer $CHARPSTAR_API_KEY"

On this page