Introduction

What is an API?

The term API is an abbreviation for Application Programming Interfaces. It is a set of definitions and protocols used to develop and integrate software.

What is this API for?

This API makes it easier for us to provide information and collect data from Natural Systems customers, in an automated manner.

We provide methods to obtain catalog data, stock, units of measure, prices and addresses.

In addition, we give the possibility of modifying data, such as addresses, order recordings or budgets.

How do I start?

Here is our base URL

https://api.naturalsystems.es/api

Authentication

We use API keys to authenticate requests.

You can see, edit, and delete your API keys in your user account, in the developer section.

Your API keys allow access to a lot of your sensitive information, so make sure you keep them very secure. Don't expose them in public areas like GitHub or through unsecure requests.

API authentication is performed through the HTTP Authorization header via Bearer token, using the access token obtained by executing the /login method with your API Key.

Remember: All requests must be made over HTTPS. If they are done over HTTP, they will fail.

Do you need help with your API Key?

Generate an API key in your user profile

The authentication header should look like the one in this example:

"Authorization: 
    Bearer yJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

Errors

We use conventional HTTP response codes to indicate the success or failure of an API request.

The codes of the 2xx range indicate the correct operation of the call.

The codes of the 4xx range represent errors in the calls made (due to missing fields, incorrect information, unauthenticated user, etc.).

The codes of the 5xx range represent an error in the JSON syntax of the call, or in very rare cases, a connection error with the Qnubu servers.

In case of getting 5xx server errors, you can contact it@naturalsystems.es by sending the call made and the content sent, so that we can review the problem and find a solution if possible.

Summary of error codes

200 - OK. Everything works as expected.

204 - OK. Everything worked fine, but the call should not return any content.

400 - Error. Error processing the call. The specific error is returned as a response.

401 - Not authorized. Failed to perform successful pre-connection authentication.

403 - Forbidden. The api key does not have permissions to make the call.

500 - Server error. Something went wrong, malformed JSON or server connection error (rare)

Login

It makes an authentication request, the API key is verified, and if it is correct, it returns the token to be used in the rest of the methods.

The generated token has an expiration of 24 hours.

Endpoint:

POST /login

Method for log in

Here we show you an example call to perform the log in:

1var axios = require('axios');
2var data = JSON.stringify({"apiKey":"$2b$12$zni4xlVH0qqhHS0/QlJ9R.YHOLESSG8/XhzgoyatDnaBJrncNlVN"});
3 
4var config = {
5  method: 'post',
6  url: 'https://api.naturalsystems.es/api/login',
7  headers: { 
8    'Content-Type': 'application/json'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});
20

Get Catalog

Returns the complete list of articles with references, images, descriptions, etc.


Endpoint:

GET /producto/getCatalogo

Get catalog response

Here is an example of the correct answer obtained:

[
   {
        "itemCode": "ABRA0009",
        "productName": "Abrazadera Metálica Sin Fin",
        "category": 3866,
        "shortDescription": "<p><span style=\"color: rgb(255, 0, 0); font-weight: 700;\">Para comprar una caja&nbsp;añadir 50&nbsp;unidades.</span></p>",
        "description": "",
        "tecnicalDetails": "",
        "manufacturer": "",
        "images": [
            "https://newapi.naturalsystems.es/p/ABRA0009/ABRA0009-00.png"
        ]
    },
    {
        "itemCode": "ACCE0001",
        "productName": "Codo Metálico",
        "category": 3866,
        "shortDescription": "<p>CODO CURVO METALICO</p>\n<p>Se trata de un Codo Curvo Metálico con ángulo de 90º.</p>\n<p>Sirve para la unión de tubos de ventilación de aluminio flexible. o cualquier modelo de tubo de extracción o intracción.</p>\n<p>Disponible en diferentes diámetros de boca.</p>\n<p>Si en tu sistema de ventilación necesitas unir dos tubos formando esquina (ángulo de 90º). esta es la pieza que estás buscando.</p>",
        "description": "",
        "tecnicalDetails": "",
        "manufacturer": "",
        "images": [
            "https://newapi.naturalsystems.es/p/ACCE0001/ACCE0001-00.png"
        ]
    }
]

Method to get the catalog

Here is an example call to get the catalog:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCatalogo',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Get Category

Returns the complete product category tree in the same order as on the Natural Systems website.

The father: null attribute defines the parent category of the tree, while the rest have the immediately superior category.


Endpoint:

GET /producto/getCategoria

Correct answer of obtaining the categories

Next, we show you an example of the correct answer obtained:

[
    {
        "id": 1,
        "name": "",
        "father": null,
        "position": "1"
    },
    {
        "id": 2828,
        "name": "Sustratos",
        "father": 1,
        "position": "1"
    },
   {
        "id": 3770,
        "name": "Iluminación",
        "father": 1,
        "position": "9"
    }
]

Method to obtain the categories of Natural Systems

Here is an example call to get the category tree:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCategoria',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTUxOTQ0MzQsImV4cCI6MTYxNTI4MDgzNH0.4SCvWNwD-nzP033a1Rt95uoWlmQkOfpj0hAqB01yMwI', 
9    'Content-Type': 'application/json'
10  },
11  data : data
12};
13 
14axios(config)
15.then(function (response) {
16  console.log(JSON.stringify(response.data));
17})
18.catch(function (error) {
19  console.log(error);
20});
21

Get Stock

Obtains the Stock of available products.


Endpoint:

GET /producto/getStock

Correct answer of obtaining product stock

Next, we show you an example of the correct answer obtained:

[
    {
        "itemCode": "ACCE0032",
        "stock": 99999
    },
    {
        "itemCode": "ACCE0033",
        "stock": 15
    },
    {
        "itemCode": "ACCE0034",
        "stock": 22
    },
    {
        "itemCode": "ACCE0036",
        "stock": 99999
    }
]

Method to obtain the stock of the product

Example call:

1var axios = require('axios');
2    
3var config = {
4  method: 'get',
5  url: 'https://api.naturalsystems.es/api/producto/getStock',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMjIyNSIsImdyb3VwQ29kZSI6MTA2LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQ5NTE4ODgsImV4cCI6MTYxNTAzODI4OH0.bWL_rLE4mmW9Aq2DmVl50LIKu7VisPgHeY5K_n9_GtI'
8  }
9};
10
11axios(config)
12.then(function (response) {
13  console.log(JSON.stringify(response.data));
14})
15.catch(function (error) {
16  console.log(error);
17});

Get Units of Measure

Returns the sales format of each of the products (box, pallet, unit), with the unit quantity of the product, its weight in kg and measurements in cm.


Endpoint:

GET /producto/getUnidadMedida

Correct answer of obtaining units of measure

Here is an example of the correct answer obtained:

[
    {
        "itemCode": "ABRA0004",
        "uomCode": "Unidad",
        "quantity": 1,
        "weight": 0.04,
        "width": 12,
        "height": 12,
        "length": 1,
        "volume": 144
    },
    {
        "itemCode": "ABRA0004",
        "uomCode": "Caja",
        "quantity": 50,
        "weight": 2,
        "width": 14,
        "height": 15,
        "length": 40,
        "volume": 8400
    },
    {
        "itemCode": "ABRA0004",
        "uomCode": "Palet",
        "quantity": 11200,
        "weight": 0,
        "width": 0,
        "height": 0,
        "length": 0,
        "volume": 0
    }
]

Method to obtain the sales format of the product

Example call:

1var axios = require('axios');
2var data = '';
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getUnidadMedida',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTUxOTQ0MzQsImV4cCI6MTYxNTI4MDgzNH0.4SCvWNwD-nzP033a1Rt95uoWlmQkOfpj0hAqB01yMwI'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});
20

Get Price

You get the full price list from the client. These prices include the applied discount. In addition, the PVP price of the product is sent.


Endpoint:

GET /producto/getPrecio

Correct answer of obtaining price of the product

Next, we show you an example of the correct answer obtained:

[
    {
        "itemCode": "ABRA0004",
        "price": 0.5,
        "pvp": 1.07
    },
    {
        "itemCode": "ABRA0005",
        "price": 0.54,
        "pvp": 1.16
    },
    {
        "itemCode": "ABRA0006",
        "price": 0.58,
        "pvp": 1.24
    }
]

Method to obtain the price of the product

Example call:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.naturalsystems.es/api/producto/getPrecio',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTUxOTQ0MzQsImV4cCI6MTYxNTI4MDgzNH0.4SCvWNwD-nzP033a1Rt95uoWlmQkOfpj0hAqB01yMwI'
8  }
9};
10 
11axios(config)
12.then(function (response) {
13  console.log(JSON.stringify(response.data));
14})
15.catch(function (error) {
16  console.log(error);
17});

Get Amount Discount

Returns the discount brackets that the products have based on the quantity purchased. I know obtains the quantity in units, the discount applied, the final price with discount, and the range of dates on which the promotion is active.


Endpoint:

GET /producto/getDescuentoCantidad

Respuesta correcta de obtención de descuentos

Correct answer of obtaining discounts:

[
    {
        "itemCode": "ACFU0046",
        "discounts": [
            {
                "quantity": 600,
                "discount": 10,
                "specialPrice": 0.14,
                "fromDate": "2019-11-26T00:00:00.000Z",
                "toDate": "2021-03-09T10:10:11.873Z"
            },
            {
                "quantity": 3000,
                "discount": 20,
                "specialPrice": 0.12,
                "fromDate": "2019-11-26T00:00:00.000Z",
                "toDate": "2021-03-09T10:10:11.873Z"
            },
            {
                "quantity": 12000,
                "discount": 30,
                "specialPrice": 0.11,
                "fromDate": "2019-11-26T00:00:00.000Z",
                "toDate": "2021-03-09T10:10:11.873Z"
            },
            {
                "quantity": 60000,
                "discount": 25,
                "specialPrice": 0.11,
                "fromDate": "2019-11-26T00:00:00.000Z",
                "toDate": "2021-03-09T10:10:11.873Z"
            }
        ]
    }
]

Method to get quantity discounts

Example call:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.naturalsystems.es/api/producto/getDescuentoCantidad',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTUxOTQ0MzQsImV4cCI6MTYxNTI4MDgzNH0.4SCvWNwD-nzP033a1Rt95uoWlmQkOfpj0hAqB01yMwI'
8  }
9};
10 
11axios(config)
12.then(function (response) {
13  console.log(JSON.stringify(response.data));
14})
15.catch(function (error) {
16  console.log(error);
17});

Get Catálogo CSV

Returns the complete list of items with import-ready items in CSV format.


Endpoint:

GET /producto/getCsv

Response obtain catalogue

Here is an example of the correct answer obtained:

REFERENCE;PRODUCT;BRAND;TAX;STOCK;SHORT_DESCRIPTION;DESCRIPTION;IMAGES;CATEGORY_PATH;ID_CATEGORY_PATH;BASE_PRICE;PVP;WEIGHT;WIDTH;HEIGHT;DEPTH;ID_CATEGORY_DEFAULT;REFERENCE_PARENT;ATTR;ATTR2
ABRA0004;"Abrazadera Metálica Sin Fin";;21;99999;"";"";https://newapi.naturalsystems.es/p/ABRA0004/ABRA0004-00.png;Control de Clima > Conductos de ventilación;3772 > 3866;0.75;0.94;0.04;12;12;1;3866;;465
ABRA0005;"Abrazadera Metálica Sin Fin";;21;99999;"";"";https://newapi.naturalsystems.es/p/ABRA0005/ABRA0005-00.png;Control de Clima > Conductos de ventilación;3772 > 3866;0.8;1;0.01;14;14;1;3866;ABRA0004;466

Method to obtain the catalogue in CSV format

Here is a sample call to obtain the catalogue:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCsv',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Get Catálogo Prestashop

Devuelve la lista completa de artículos con preparados para la importación de datos en las plataformas Prestashop.


Endpoint:

GET /producto/getCsvPrestashop

Respuesta obtención catálogo

A continuación, te mostramos un ejemplo de respuesta correcta obtenida:

REFERENCE;PRODUCT;BRAND;TAX;WEIGHT;STOCK;SHORT_DESCRIPTION;DESCRIPTION;IMAGES;CATEGORY_PATH;ID_CATEGORY_PATH;PRICE_CLIENTE;PVP;WIDTH;HEIGHT;DEPTH;ID_CATEGORY_DEFAULT;REFERENCE_PARENT;ATTR;ATTR2
ABRA0004;"Abrazadera Metálica Sin Fin";;21;0.04;99999;"";"";https://newapi.naturalsystems.es/p/ABRA0004/ABRA0004-00.png;Control de Clima > Conductos de ventilación;3772 > 3866;0.75;0.94;12;12;1;3866;;465
ABRA0005;"Abrazadera Metálica Sin Fin";;21;0.01;99999;"";"";https://newapi.naturalsystems.es/p/ABRA0005/ABRA0005-00.png;Control de Clima > Conductos de ventilación;3772 > 3866;0.8;1;14;14;1;3866;ABRA0004;466

Método para obtener el catálogo adaptado a Prestashop

Aquí os mostramos una llamada de ejemplo para obtener el catálogo:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCsvPrestashop',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Get Catálogo Woocommerce

Returns the complete list of items ready for importing data into Woocommerce platforms Woocommerce platforms.


Endpoint:

GET /producto/getCsvWoocommerce

Response obtain catalogue

Here is an example of the correct answer obtained:

Tipo;SKU;Nombre;Publicado;"¿Está destacado?";"Visibilidad en el catálogo";"Descripción corta";Descripción;"Día en que empieza el precio rebajado";"Día en que termina el precio rebajado";"Estado del impuesto";"Clase de impuesto";"¿En inventario?";Inventario;"Cantidad de bajo inventario";"¿Permitir reservas de productos agotados?";"¿Vendido individualmente?";"Peso (kg)";"Longitud (cm)";"Anchura (cm)";"Altura (cm)";"¿Permitir valoraciones de clientes?";"Nota de compra";"Precio rebajado";"Precio normal";Categorías;Etiquetas;"Clase de envío";Imágenes;"Límite de descargas";"Días de caducidad de la descarga";Superior;"Productos agrupados";"Ventas dirigidas";"Ventas cruzadas";URL externa";"Texto del botón";Posición;meta:Brand;"Nombre del atributo 1";"Valor(es) del atributo 1";"Atributo visible 1";"Atributo global 1";"Nombre del atributo 2";"Valor(es) del atributo 2";"Atributo visible 2";"Atributo global 2";"Nombre del atributo 3";"Valor(es) del atributo 3";"Atributo visible 3";"Atributo global 3";"Nombre del atributo 4";"Valor(es) del atributo 4";"Atributo visible 4";"Atributo global 4";"Nombre del atributo 5";"Valor(es) del atributo 5";"Atributo visible 5"
simple;ABRA0004;"Abrazadera Metálica Sin Fin";1;0;visible;"";"";0;0;taxable;;1;99999;;0;0;0.04;1;12;12;1;;;0.75;Control de Clima > Conductos de ventilación;;;https://newapi.naturalsystems.es/p/ABRA0004/ABRA0004-00.png;;;;;;;;;;;100 95mm-105mm;465;1;
simple;ABRA0005;"Abrazadera Metálica Sin Fin";1;0;visible;"";"";0;0;taxable;;1;99999;;0;0;0.01;1;14;14;1;;;0.8;Control de Clima > Conductos de ventilación;;;https://newapi.naturalsystems.es/p/ABRA0005/ABRA0005-00.png;;;;;;;;;;;125 119mm-131mm;466;1;

Method to obtain the catalogue adapted to Woocommerce

Here is a sample call to obtain the catalogue:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCsvWoocommerce',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Get Combinations

Returns the complete list of item combinations prepared for import in CSV format.


Endpoint:

GET /producto/getCsvCombinaciones

Combinations retrieval response

Below, we show you an example of a correct response obtained:

ID_COMB;ITEMCODE
2707;ADNU0003
2707;ADNU0026
2707;ADNU0102
2707;ADNU0101
2708;ADNU0177
2708;ADNU0250

Method to obtain the article combinations

Here we show you an example call to obtain the combinations:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCsvCombinaciones',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Get Attributes

Returns the complete list of item attributes prepared for import in CSV format.


Endpoint:

GET /producto/getCsvAtributos

Attribute retrieval response

Below, we show you an example of a correct response obtained:

ID_ATTRIBUTE_GROUP;NAME_ATTRIBUTE_GROUP;ID_ATTRIBUTE;NAME_ATTRIBUTE
4;Liquidos;44;30 ml
15;Macetas;1580;24.7x24.7x26.1cm (11L)
6;Extractores;1605;3250m3/h (2 Boca Entrada 250mm - 1 Boca Salida 315mm)

Method to obtain the article attributes

Here we show you an example call to obtain the attributes:

1var axios = require('axios');
2var data = JSON.stringify({"lang":1});
3 
4var config = {
5  method: 'get',
6  url: 'https://api.naturalsystems.es/api/producto/getCsvAtributos',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
9  },
10  data : data
11};
12 
13axios(config)
14.then(function (response) {
15  console.log(JSON.stringify(response.data));
16})
17.catch(function (error) {
18  console.log(error);
19});

Create New Order

Submit a new order or quote. Dropshipping and direct orders are allowed.


Endpoint:

POST /pedido/nuevoPedido

Example object

{
    "isQuote": "Y",
    "isDropship": "Y",
    "shipInstructions": "C/ Test 123 Montilla 14550 Córdoba España",
    "shipAddress": "Tienda Córdoba",
    "billAddress": "Tienda Córdoba",
    "orderIntructions": "No enviar documentación",
    "remarks": "Comentarios del pedido",
    "items": [
        {
            "itemCode": "TONE0011",
            "quantity": 80
        },
        {
            "itemCode": "LUMI0017",
            "quantity": 5
        },
        {
            "itemCode": "SUST0110",
            "quantity": 2
        }
    ]
}

Correct Answer Obtained

Order successfully grabbed

Method to create new order

Example call:

1var axios = require('axios');
2var data = JSON.stringify({"isQuote":"Y","isDropship":"Y","shipInstructions":"C/ Test 123 Montilla 14550 Córdoba España","shipAddress":"Tienda Córdoba","billAddress":"Tienda Córdoba","orderIntructions":"No enviar documentación","remarks":"Comentarios del pedido","items":[{"itemCode":"TONE0011","quantity":80},{"itemCode":"LUMI0017","quantity":5},{"itemCode":"SUST0110","quantity":2}]});
3 
4var config = {
5  method: 'post',
6  url: 'https://api.naturalsystems.es/api/pedido/nuevoPedido',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTUxOTQ0MzQsImV4cCI6MTYxNTI4MDgzNH0.4SCvWNwD-nzP033a1Rt95uoWlmQkOfpj0hAqB01yMwI', 
9    'Content-Type': 'application/json'
10  },
11  data : data
12};
13 
14axios(config)
15.then(function (response) {
16  console.log(JSON.stringify(response.data));
17})
18.catch(function (error) {
19  console.log(error);
20});

Get Shipping Address

Gets the shipping addresses registered in the user's account.


Endpoint:

GET /cuenta/getDireccionEnvio

Correct Answer Obtained

[
{
        "address": "MI dirección",
        "street": "Calle de test 123º",
        "city": "Montilla",
        "zipCode": "14550",
        "state": "Córdoba",
        "country": "Córdoba",
        "contactPerson": "Manuel Fernández López.",
        "phone": "+34 6xx xx xx xx",
        "schedule": "De 10 a 14",
        "remark": "Observaciones de transporte"
    }
]

Method to obtain the shipping address(es)

Example call:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.naturalsystems.es/api/cuenta/getDireccionEnvio',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMjIyNSIsImdyb3VwQ29kZSI6MTI2LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTUxMDIsImV4cCI6MTYxNDM0MTUwMn0.2MiXr-C-JOtyvn__o09MXCLlpe7EiUr3ZFPfSEMmUa8'
8  }
9};
10 
11axios(config)
12.then(function (response) {
13  console.log(JSON.stringify(response.data));
14})
15.catch(function (error) {
16  console.log(error);
17});

Create Shipping Address

Create a new shipping address with the call data.


Endpoint:

POST /cuenta/createDireccionEnvio

Example object

1{
2    "name": "Tienda Córdoba 2",
3    "street": "C/ Calle 123",
4    "zipCode": "14550",
5    "city": "Montilla",
6    "state": "Córdoba",
7    "country": "ES",
8    "contactPerson": "Antonio Gutiérrez",
9    "phone": "+34 6xx xx xx xx",
10    "phoneShipping": "+34 6xx xx xx xx",
11    "shippingRemarks": "Observaciones de transporte"
12}

Correct Answer obtained

Address 'Tienda córdoba 2' created successfully.

Method to create a new shipping address

Example call:

1var axios = require('axios');
2var data = JSON.stringify({
3    "name": "Tienda Córdoba 2",
4    "street": "C/ Calle 123",
5    "zipCode": "14550",
6    "city": "Montilla",
7    "state": "Córdoba",
8    "country": "ES",
9    "contactPerson": "Antonio Gutiérrez",
10    "phone": "+34 6xx xx xx xx",
11    "phoneShipping": "+34 6xx xx xx xx",
12    "shippingRemarks": "Observaciones de transporte"
13});
14 
15var config = {
16  method: 'post',
17  url: 'https://api.naturalsystems.es/api/cuenta/updateDireccionEnvio',
18  headers: { 
19    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQ5NDE5MDEsImV4cCI6MTYxNTAyODMwMX0.qesOvjyWZfQJF3TOYk4iHa4o0OYoqZElGXam_yyQWsk', 
20    'Content-Type': 'application/json'
21  },
22  data : data
23  };
24 
25axios(config)
26.then(function (response) {
27  console.log(JSON.stringify(response.data));
28})
29.catch(function (error) {
30  console.log(error);
31});
32

Update Shipping Address

Update the details of an existing shipping address. Only the 'address' field and the fields to be updated are mandatory.


Endpoint:

PATCH /cuenta/updateDireccionEnvio

Correct Answer Obtained

Address 'Tienda córdoba 2' updated successfully.

Method to update the data of your shipping addresses

Sample call:

1var axios = require('axios');
2var data = JSON.stringify({"address":"Test2022","country":"ES","zipCode":"","phone":"+34 6xx xx xx xx","phoneShipping":"+34 6xx xx xx xx xx "});
3 
4var config = {
5  method: 'patch',
6  url: 'https://api.naturalsystems.es/api/cuenta/updateDireccionEnvio',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMjIyNSIsImdyb3VwQ29kZSI6MTA2LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQ5NTE4ODgsImV4cCI6MTYxNTAzODI4OH0.bWL_rLE4mmW9Aq2DmVl50LIKu7VisPgHeY5K_n9_GtI', 
9    'Content-Type': 'application/json'
10  },
11  data : data
12};
13 
14axios(config)
15.then(function (response) {
16  console.log(JSON.stringify(response.data));
17})
18.catch(function (error) {
19  console.log(error);
20});

Delete Shipping Address

Removes the shipping address specified in the call. The address must be exact.


Endpoint:

DELETE /cuenta/deleteDireccionEnvio

Example object

1{
2    "address": "Tienda Córdoba"
3}

Correct answer obtained

Address 'Tienda córdoba 2' deleted successfully.

Method to remove a shipping address

Example call:

1var axios = require('axios');
2var data = JSON.stringify({  "address": "Tienda Córdoba" });
3 
4var config = {
5  method: 'delete',
6  url: 'https://api.naturalsystems.es/api/cuenta/deleteDireccionEnvio',
7  headers: { 
8    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQ5NDE5MDEsImV4cCI6MTYxNTAyODMwMX0.qesOvjyWZfQJF3TOYk4iHa4o0OYoqZElGXam_yyQWsk', 
9    'Content-Type': 'application/json'
10  },
11  data : data
12};
13 
14axios(config)
15.then(function (response) {
16  console.log(JSON.stringify(response.data));
17})
18.catch(function (error) {
19  console.log(error);
20});

Get Billing Address

Get the billing addresses registered in the user's account.


Endpoint:

GET /cuenta/getDireccionFacturacion

Correct Answer Obtained

[
    {
        "address": "Dirección Córdoba",
        "street": "C/ Calle 123",
        "city": "Montilla",
        "zipCode": "14550",
        "state": "Córdoba",
        "country": "Córdoba"
    }
]

Method to obtain the billing address(es)

Example call:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.naturalsystems.es/api/cuenta/getDireccionFacturacion',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQ5NDE5MDEsImV4cCI6MTYxNTAyODMwMX0.qesOvjyWZfQJF3TOYk4iHa4o0OYoqZElGXam_yyQWsk'
8  }
9};
10 
11axios(config)
12.then(function (response) {
13  console.log(JSON.stringify(response.data));
14})
15.catch(function (error) {
16  console.log(error);
17});

Method Collection

To facilitate the use of all these methods we have created a collection for Postman.

You only have to import this file, follow the authentication and login methods and you will have all the necessary data to make requests to our API. This software also allows you to export the necessary code in many technologies.