A schema is a JSON object (regardless of the feed being in an XML or JSON format) composed of three sections:
-
The metadata section is a SchemaMetadata object.
-
The fields section is a list of SchemaField objects.
-
The labels section is a list of SchemaLabel objects.
Example
{
"metadata": { ... },
"fields": [ ... ],
"labels": [ ... ]
}
SchemaMetadata
A heading object with basic information about the schema.
Name |
Description |
---|---|
shop |
Indicates the URL of the shop. |
lang |
Indicates the language of the schema. |
currency |
Indicates the currency of the schema. |
created_at |
Indicates when the schema was created. |
source |
Indicates the platform information. |
version |
Indicates the version of the schema. |
feed.format Optional |
Indicates the format of the feed: JSON or XML. By default is JSON. |
feed.category Optional |
Indicates how to parse the category type field. An object with the following fields:
|
Example
"metadata": {
"shop": "https://universobalonmano.com/",
"lang": "es",
"currency": "EUR",
"created_at": "2022-01-04T16:22:51+01:00",
"source": "Motive/1.6.0; Prestashop/1.6.1.24; PHP/5.6.40",
"version": "0.1.0",
"feed": {
"format": "JSON",
"category": {
"treeSeparator": "|>",
"arraySeparator": "|"
}
}
}
SchemaField
An object describing a field.
Name |
Description |
---|---|
id |
The field identifier. Must be unique. |
type |
The type of the field. One of FieldType. |
path |
The path of the field in the schema. Examplepath.to.field
Feed example
|
features |
An object indicating the enabled or disabled features for the field:
A missing feature in the object is considered false. Example
|
Example of fields
"fields": [
{
"id": "id",
"type": "id",
"path": "id"
},
{
"id": "url",
"type": "link",
"path": "url"
},
{
"id": "images",
"type": "image",
"path": "images"
},
{
"id": "availability",
"type": "availability",
"path": "availability",
"label": "Disponibilidad",
"features":
{
"facetable": true
}
},
{
"id": "price",
"type": "price",
"path": "price",
"label": "Precio",
"features":
{
"facetable": true,
"sortable": true
}
},
{
"id": "code",
"type": "code",
"path": "code",
"label": "Código",
"features":
{
"searchable": true
}
},
{
"id": "name",
"type": "name",
"path": "name",
"label": "Nombre",
"features":
{
"searchable": true
}
},
{
"id": "description",
"type": "description",
"path": "description",
"label": "Descripción",
"features":
{
"searchable": true
}
}
]
FieldType
These are the different field types that there are:
- Optional: A field type that can be defined in the schema, but it's not mandatory.
- Required: A field type that must be defined at least once in the schema.
- Unique: A field type that must be defined only once in the schema.
- Flat: A field type that should be defined in the schema only if we need to replace the corresponding object with separated fields.
Name | Type |
Description |
---|---|---|
id |
Required Unique |
Indicates the identifier of the product. Feed example
|
name |
Required Unique |
Indicates a short name of the product. Feed example
|
description |
Optional Unique |
Indicates the description of the product. Feed example
|
link |
Required Unique |
Indicates the URL of the product. Feed example
|
image |
Required Unique |
A list of image objects with the following fields:
Feed example
|
image_url |
Required Flat |
A list of image URLs. Feed example
|
image_alt |
Optional Flat |
A list of image alt texts. Feed example
|
price |
Required Unique |
A price object with the following fields:
Feed example
|
price_regular |
Required Unique Flat |
Indicates the regular price. Feed example
|
price_on_sale |
Optional Unique Flat |
Indicates the price on sale. Feed example
|
category |
Optional Unique |
Indicates the item category, which can be customised. Feed example"whatever-key-category": [ "2|Todo|>2555|Superheroes|>7|Comics", "2|Todo|>3|Solo me puedo gastar...|>14|Entre 15\u20ac y 30\u20ac", "2|Todo|>2555|Superheroes|>7|Comics|>80|Avengers y m\u00e1s de Marvel", "2|Todo|>2555|Superheroes|>144|Regalos|>146|Algo que ponerse|>116|Toallas y Chanclas", "2|Todo|>2555|Superheroes|>144|Regalos|>146|Algo que ponerse", "2|Todo|>2555|Superheroes|>7|Comics|>80|Avengers y m\u00e1s de Marvel|>295|Moda Marvel", "2|Todo|>2555|Superheroes|>7|Comics|>80|Avengers y m\u00e1s de Marvel|>297|M\u00e1s regalos de Marvel" ] |
availability |
Required Unique |
An availability object with the following fields:
Feed example
|
availability_allow_order |
Required Flat |
Indicates the number of items in stock. Feed example
|
availability_stock |
Optional Flat |
Indicates if the item can be purcharsed. If not specified, it will be understood as true for items with stock higher than 0. Feed example
|
color |
Optional |
A color object with the following fields:
Feed example
|
code |
Optional Unique |
An object with the following fields:
Feed example
|
code_reference |
Optional Unique Flat |
Indicates the reference of the item. Feed example
|
code_gtin |
Optional Unique Flat |
Indicates the Global Trade Item Number. Feed example
|
code_mpn |
Optional Unique Flat |
Indicates the Manufacturer Part Number. Feed example
|
variation |
Optional Unique |
A special type to define the possible product variations. It includes a nested list of variant fields. Feed example
|
brand |
Optional Unique |
Indicates the brand of the product. Feed example
|
text |
Optional |
A custom text field. |
boolean |
Optional |
A custom boolean field. |
long |
Optional |
A custom long field. |
double |
Optional |
A custom double field. |
SchemaLabel
The SchemaLabel is an object describing the label of a field.
Name |
Description |
---|---|
field |
The field identifier. |
label |
The display name for the field. Shown in the filters section and in the sorting options. |
Example of labels
"labels": [
{
"field": "availability",
"label": "Disponibilidad"
},
{
"field": "price",
"label": "Precio"
},
{
"field": "code",
"label": "Código"
},
{
"field": "name",
"label": "Nombre"
},
{
"field": "description",
"label": "Descripción"
},
{
"field": "short_description",
"label": "Descripción corta"
},
{
"field": "category",
"label": "Categoría"
},
{
"field": "tags",
"label": "Etiquetas"
}
]
Comments
0 comments
Please sign in to leave a comment.