The most widespread format that offers the best compatibility is CSV (comma-separated values), which has been used since before the advent of personal computers; the format was already supported in 1972 in IBM Fortran. Its close relationship with SQL makes it the simplest format to use. However, it has several limitations that have led to the use of data interchange formats: XML, JSON, and YAML today. It is also possible to import from the Microsoft Excel format, which is more practical for less experienced users who use Windows and MS Office, but it is important to emphasize that for the transfer, the XLSX file must contain only text and numbers, no formulas or images. If we want to work with CSV files, I recommend installing LibreOffice on your PC to easily modify the files.
To summarize, the format to choose for data interchange is among the following:
- CSV (comma-separated values) for its greater diffusion and compatibility; with this format, one must be very careful that the fields do not contain the character used as a text separator and column delimiter. A particular feature of CSV is also the ease with which it can be split into multiple parts (see here), which is very convenient to avoid timeouts (error 502) from the server, if we use the native import of PrestaShop or a module that performs the import without AJAX,
- XML (eXtensible Markup Language) is much more robust, widely used, and allows the management of any type of information. It is no coincidence that XML was chosen for electronic invoices. It is important to use the CDATA syntax for HTML and text fields.
The JSON format (Javascript Object Notation) can be used to import data, where the simplicity of representation, serialization, and transmission gives the format better agility in certain contexts. While it is excellent when paired with technologies like Ajax and Javascript, and very useful for structured data and rich snippets for which JSON-LD is used today, I do not consider it valid for importing product catalogs, customers, and data into management systems and PrestaShop, as it is poorly used for such activities.
Unfortunately, it may happen that some suppliers provide you access to APIs that give you data in this format. The PrestaShop APIs also allow data to be provided in JSON; the reason is simple: it is natively supported by many languages and requires less work than XML in generation.
The YAML format is not very widespread; it is easier for humans to read and extends the JSON format. You will rarely find yourself importing data from this format into PrestaShop.