Data structure

Deante provides customers with access to an API that allows them to download data in the form of two types of files:

JSON

The latest way the API passes information is through data stored in a JSON format. In many ways it is very similar to XML, being a text file that stores structured data in a 'tree' form. However, it has a more readable form, as all objects, called tags in XML, are defined in JSON format as follows:

JSON file layout example

"Product": {    "id": "XXX_XXXX",    "name": "XXX",    "prices": {        "currency": "PLN",        "netPrice": "00.00",        "hasPromotion": false    }}

An object in JSON notation is specified first by a name and then by the character ": {", denoting the beginning of the range of data that will describe the object. The } character defines the end of the object. As you can see, it is very simple to add another level of indentation, just open the curly brackets again next to the value of the sub-element.

Deante provides the ability to download two JSON files, one containing the full product catalog, with all the information available in the JSON standard, and the other having only information about products stock.

To learn about the structure of Deante's JSON product file go here, while information about the structure of the JSON file with stock levels can be found here.

XML

Deante's original data exchange format. XML (Extensible Markup Language) is used for structured storage of data in text form. The structure is made possible by so-called tags, which in XML are denoted between < > characters and their end is marked with </ >. Example: <PRODUCTS> <\PRODUCTS>

Tags can be assigned so-called attributes, which is additional information in text form intended to specify the use of the tag. A good way to demonstrate the advantages of attributes can be an example from the Deante API, for the <PRICE_NETTO> field. In the API, it presents as follows:

<PRICE_NETTO currency="PLN">14.87</PRICE_NETTO>

The <PRICE_NETTO> tag contains only the price information, while the currency in which the price is given is defined in the currency attribute. A similar effect without the use of the attribute could be achieved by the following structure of the <PRICE_NETTO> field:

<PRICE_NETTO>    <value>14.87</value>    <currency>PLN</currency></PRICE_NETTO>

As you can see, this is less practical, as <PRICE_NETTO> must now have two nested fields, one for the currency and one for the actual price.

Deante provides the ability to download two XML files, one containing the full product catalog, with all the XML information available, and the other having only inventory information. In order to learn about the structure of the XML product file Deante go here, while information on the structure of the stocks XML file can be found here.

Last modifed at : 2022-01-31