Import, export, API and cron
CSV import
Section titled “CSV import”Catalog → GPSR → Import and export → CSV import (Import a export):
- In What you import (Čo importujete) choose Manufacturers, EU responsible persons, importers or Assignments (products, combinations, brands, categories).
- Choose the CSV file: UTF-8 encoding (a Windows-1250 file is converted), semicolon or comma separator, the first row with column names, at most 10 MB.
- Click Check (Skontrolovať). The module checks the file and writes nothing. It shows the number of valid rows and rows with errors, and the errors by row (the first 200).
- Click Import rows without errors (Importovať riadky bez chyby).
Download file templates in Export and templates: Template – manufacturers and persons and Template – assignments. The easiest way is to download a template, fill it in in a spreadsheet editor and save it as CSV.
Manufacturers and persons
Section titled “Manufacturers and persons”type;name;trade_name;street;city;postcode;country;email;phone;website;contact_address;contact_email;brand;active| Column | Meaning |
|---|---|
type |
Required. manufacturer, responsible (EU responsible person) or importer. Also accepts vyrobca, zodpovedna_osoba, dovozca. |
name |
Required. Company name. |
trade_name |
Trade name, optional. |
street, city, postcode |
Postal address. |
country |
Two-letter ISO country code, for example SK, DE, CN. |
email, phone, website |
Contacts. A website without https:// is completed. |
contact_address, contact_email |
Contact point for consumers, optional. |
brand |
Brand in the shop (ID or exact name). The manufacturer is linked to it. |
active |
1 or 0, empty = active. |
If a company with the same type and company name already exists, it is updated. No duplicate is created.
Assignments
Section titled “Assignments”level;object;combination;country;manufacturer;responsible;importer;warnings;documents;mode| Column | Meaning |
|---|---|
level |
global (whole shop), brand, category, product (default), combination. |
object |
Required (except global). Product ID or reference, brand or category ID or name. |
combination |
For a combination: combination ID or reference. |
country |
Delivery country code, empty = all countries. |
manufacturer, responsible, importer |
Company ID or exact company name. Empty = inherit. |
warnings, documents |
IDs or names separated by |. |
mode |
For a product and combination: merge (with inherited) or replace. |
Example:
level;object;combination;country;manufacturer;responsible;importer;warnings;documents;modebrand;ToyCo;;;ToyCo Ltd;EU Rep s.r.o.;;;;category;Toys;;;;;;1;;product;TOY-001;;;;;;8|9;3;mergeproduct;TOY-002;;CZ;;CZ Rep s.r.o.;;;;After the import the status of the affected products is recalculated.
Export
Section titled “Export”In Export and templates:
- Manufacturers and persons (CSV) – all companies in the same columns as the import,
- Assignments (CSV) – all assignments in the same columns as the import,
- Products with missing data (CSV) – product and combination ID, reference, name, brand, status and what is missing.
You can edit the export of manufacturers and assignments and import it back, or move it to another shop.
The API connects ERP, PIM or warehouse systems so that GPSR data does not have to be entered by hand. It is off until you create a key.
In the module settings, in the API for ERP, PIM and warehouse panel:
- Enter a key name (for example “Pohoda”) and click Create key (Vytvoriť kľúč).
- The key is shown only once, copy it. The module stores only its fingerprint.
- The list shows the name, the end of the key, the creation date and the last use. The Cancel (Zrušiť) button blocks the key. When you cancel all keys, the API is off.
Send the key in the X-Api-Key header (or Authorization: Bearer). The API URL is in the same panel.
| Request | What it does |
|---|---|
GET ?action=product&id_product=1&id_product_attribute=0&country=SK&lang=sk |
Product data as the customer sees it: manufacturer, EU person, importer, warnings, documents, status and what is missing. |
POST ?action=map |
Writes assignments. JSON body {"rows":[…],"dry_run":false}; rows have the same columns as the CSV import, at most 1000 rows. With "dry_run":true it only checks. |
POST ?action=reindex |
Recalculates the status. {"products":[1,2]} for selected products, {"after":0} for the whole catalogue in batches of 100 products. The response contains next. Send it as after in the next request until it is 0. |
Responses: a missing or invalid key returns error 401, an invalid licence 503. For map with errors in some rows the response is 207 with the list of errors.
API calls are written to the change log.
The cron URL with a secret token is in the module settings in the Cron panel. One run:
- recalculates the product status and stores a point for the trend chart in the Overview,
- prepares Brand matching suggestions,
- deletes change log records older than Keep the change log (Uchovávať záznam zmien).
It processes products in batches of 100 until about 50 seconds have passed. What it does not finish, it completes in the next run from where it stopped. The cron output shows the number of processed products and “continues in the next run” or “done”.
Recommended setting on the server:
15 3 * * * curl -s "cron URL" > /dev/nullWith a large catalogue, when one run is not enough, run the cron every hour at night:
15 1-5 * * * curl -s "cron URL" > /dev/nullThe New cron URL (Nová adresa cronu) button creates a new token. The old URL stops working, update it on the server too. A general guide is in Cron.
Thank you for your answer.
We are sorry. Tell us what is missing or unclear:Write to support