Skip to content

Create Import

EndpointMethod
/api/admin/settings/data-transfer/importsPOST

Uploads a source file and creates a new import. The import is created in the pending state, ready to be validated and processed.

Send the request as multipart/form-data.

FieldRequiredDescription
typeyesThe importer to use, e.g. products, customers, tax_rates.
actionyesappend (add / update rows) or delete (remove rows).
validation_strategyyesstop-on-errors (abort the run on the first invalid row) or skip-errors (skip invalid rows and continue).
allowed_errorsyesInteger ≥ 0. Maximum number of errors tolerated before the run stops.
field_separatoryesThe column delimiter used in the file, e.g. ,.
process_in_queuenoWhen true, large imports are processed asynchronously.
image_sourcenoWhere a product import reads the images its rows name: directory (default), upload or url.
upload_imageswith uploadA ZIP of the images, up to 100 MB. It is unpacked for this import, and a replacement archive starts from an empty folder.
images_directory_pathwith directoryFolder under storage/app/import holding the images.
fileyesThe import file (csv, xls, xlsx, or xml).

Returns the created import detail with HTTP 201.

Where a product import gets its images

A product row names its images by file name or URL, and image_source decides how those names are resolved:

  • directory — images were placed on the server by hand under storage/app/import/{images_directory_path}. This is the default, and the path is required.
  • upload — the images come with the import as a ZIP in upload_images, unpacked into the import's own folder. The archive is required unless one has already been uploaded for this import.
  • url — each row carries a full URL, downloaded during the run.

The image fields apply only to importers that handle images; a customer or tax-rate import ignores them.

File upload is REST only

Creating an import requires uploading a file, which cannot be done over GraphQL. Use this REST endpoint to create imports.

Permission: settings.data_transfer.imports.create.

Released under the MIT License.