# Shoptet XML specification

URL: https://shoptet.dev/tools-resources/data-import-export/shoptet-xml-specification

## Valid XML feed

A Shoptet e-shop can be filled with product data, and the data kept up to date, either by importing an XML file manually or by an automated import, which downloads an XML feed regularly and imports it. In both cases the feed must be a valid XML document that follows the Shoptet specification below.

To check a feed, use the [XML validation](https://www.shoptet.cz/xml-validace/) page: enter the feed's URL or upload the file, and in the **Typ XML feedu** (feed type) drop-down choose **Shoptet** for a feed following this specification, or **Heureka** for a feed in the Heureka format. The same validator is available in Slovak at [shoptet.sk/xml-validacia](https://www.shoptet.sk/xml-validacia/) and in Hungarian at [shoptet.hu/xml-ervenyesites](https://www.shoptet.hu/xml-ervenyesites/) .

## RELAX NG schemas

The structure of a feed is defined by RELAX NG schemas:

- [RELAX NG data types](https://www.shoptet.cz/export/schema/products-datatype-v10.rng) – the shared data types and their limits, used by both schemas below
- [RELAX NG specification, supplier](https://www.shoptet.cz/export/schema/products-supplier-v10.rng) – the base product feed. Automated imports use this schema.
- [RELAX NG specification, complete](https://www.shoptet.cz/export/schema/products-complete-v10.rng) – extends the supplier schema with more product data (for example `GUID` and `FLAG_VALIDITY` ). The manual XML import uses this schema.
The products exports *Supplier export* and *Complete export* (see [Data export](/tools-resources/data-import-export/data-export/) ) produce feeds in these two formats, so an export of an existing e-shop is a good reference.

## Feed structure

The root element is `<SHOP>` , holding one `<SHOPITEM>` per product. A product without variants carries its code, prices, stock and the other variant-level data directly in `<SHOPITEM>` . A product with variants has a `<VARIANTS>` element instead, with one `<VARIANT>` per variant; each variant carries that data itself, plus a `<PARAMETERS>` element listing the `<PARAMETER>` ( `<NAME>` and `<VALUE>` ) pairs that tell the variants apart.

Some of the limits defined in the data types schema:

| Element | Limit 
| `NAME` (product name, parameter name) | 1–250 characters 
| `VALUE` (variant parameter value) | 1–128 characters 
| `CODE` | 1–64 characters 
| `APPENDIX` | up to 150 characters 
| `MANUFACTURER` | up to 200 characters 
| `SUPPLIER` | up to 255 characters 
| `WARRANTY` | up to 100 characters 
| `VAT` | 0–100 
| `CURRENCY` | an ISO 4217 code from the list in the schema, for example `CZK` , `EUR` , `HUF` 

The schema files are the authoritative source: check them for the complete list of elements and allowed values.

### Variant images

Images are listed once per product, in `<IMAGES>` (one `<IMAGE>` per image). To assign one of them to a variant, put its URL into the variant's `<IMAGE_REF>` element:

```xml
<VARIANT>
  <!-- … -->
  <IMAGE_REF>https://example.com/images/product-red.jpg</IMAGE_REF>
</VARIANT>
```

The URL has to match one of the product's `<IMAGE>` URLs; an `<IMAGE_REF>` that matches none of them is ignored.

## Sample XML file

Download the [sample XML file](https://www.shoptet.cz/user/documents/VariantItem.xml) . It shows both a product with variants and a product without them.

## Where to upload the feed

- **Manual import** – in the administration under **Products → Product Import** , see [Data import](/tools-resources/data-import-export/data-import/) .
- **Automated imports** – under **Products → Automated imports** . Shoptet downloads the feed from the URL you set (HTTP, HTTPS, FTP or SFTP) on a schedule and imports it.

## Feed producers

XML feeds are often generated automatically by a supplier or another online service and loaded into Shoptet by an automated import. To let the producer return only what is needed, Shoptet sends the HTTP header `A-IM` with every automated download:

| Import type | Header | Meaning 
| Full import | `A-IM: full` | Shoptet expects all products with their full data. 
| Update import | `A-IM: update` | Shoptet updates only the data present in the file (for example prices and stock amounts) of products that already exist. 

An automated import started manually from the administration sends `A-IM: full` as well.

Full imports can be scheduled once a day, between 00:00 and 07:00. Update imports can be scheduled between 08:00 and 23:00; how many per day depends on the e-shop's plan.
