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 Qnubu 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.qnubu.com/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@qnubu.com 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.qnubu.com/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": "ACFU0046",
        "productName": "Pop Top 120mm Qnubu California (Pack 600 Units)",
        "category": 326,
        "shortDescription": "<p><strong>Qnubu California Pop Tops</strong> Vials offer the safest option for packaging, preserving and dispensing your flowers. They come in different formats with different capacities:</p>\n\n<p>20ml - 6D<br />\n50ml - 13D<br />\n70ml - 19D<br />\n110ml - 30D<br />\n220ml - 60D<br />\nSlim Case<br />\nCone - 120mm</p>\n\n<p><br />\n<span style=\"color:#daa520;\"><strong>Carton 600 Units</strong></span></p>\n\n<p><span style=\"color:#daa520;\"><strong>MINIMUM ORDER QUANTITY 1 FULL CARTON</strong></span></p>\n\n<p><strong>Simply by pressing the upper part you can easily open the jar and close it again keeping its flowers always fresh and without giving off odors.</strong></p>",
        "description": "<p><strong>Specifications:</strong> </p>\n\n<ul>\n\t<li>Easy Opening: Pop System</li>\n\t<li>Hermetic closing: Hermetic closing to avoid the entrance of oxygen and the degradation of its flowers.</li>\n\t<li>Anti-Odour: Does not give off odours</li>\n\t<li>Moisture resistant</li>\n\t<li>BPA free - FDA</li>\n\t<li>Suitable for food and pharmaceutical use.</li>\n</ul>\n\n<p><strong>Qnubu's California Safe Pack</strong> line offers the latest in packaging used by dispensaries in the United States and Canada and complies with the most demanding manufacturing and safety standards. We have: Pop Pots, Vacuum Pots, Aluminum Pouches, Lock Pouches</p>",
        "tecnicalDetails": "",
        "manufacturer": "",
        "variationGroup": -1,
        "images": [
            "https://api.qnubu.com/p/ACFU0046/ACFU0046-00.png"
        ]
    },
    {
        "itemCode": "ACVA0061",
        "productName": "Needle tip bottle 15 ml",
        "category": 320,
        "shortDescription": "",
        "description": "",
        "tecnicalDetails": "",
        "manufacturer": "",
        "variationGroup": -1,
        "images": [
            "https://api.qnubu.com/p/ACVA0061/ACVA0061-00.png"
        ]
    }
]

Method to get the catalog

Here is an example call to get the catalog:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/product/getAllProducts',
6  headers: { 
7    'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjYXJkQ29kZSI6IkMwMDAxMCIsImdyb3VwQ29kZSI6MTI3LCJsaXN0TnVtIjoxMiwibm9EaXNjb3VudCI6Ik4iLCJkaXNjUmVsIjoiSCIsIm11ZXN0cmFPY3VsdGFzIjoxLCJpYXQiOjE2MTQyNTQzODMsImV4cCI6MTYxNDM0MDc4M30.kDXELgGovdtnpUri5MeaCKZQqT7ba_q_LY7VZ3eurWQ'
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 Category

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

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


Endpoint:

GET /product/getCategory

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": 141,
        "name": "Extract",
        "father": 1,
        "position": "1"
    },
   {
        "id": 320,
        "name": "Pack",
        "father": 1,
        "position": "9"
    }
]

Method to obtain the categories of Qnubu

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.qnubu.com/api/product/getCategory',
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
22

Get Stock

Obtains the Stock of available products.


Endpoint:

GET /product/getStock

Correct answer of obtaining product stock

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

[
    {
        "itemCode": "ACFU0046",
        "stock": 99999
    },
    {
        "itemCode": "ACVA0061",
        "stock": 99999
    },
    {
        "itemCode": "ACVA0062",
        "stock": 2
    },
    {
        "itemCode": "ACVA0063",
        "stock": 99999
    }
]

Method to obtain the stock of the product

GetStock example call:

1var axios = require('axios');
2    
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/product/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 /product/getMeasurementUnits

Correct answer of obtaining units of measure

Here is an example of the correct answer obtained:

[
    {
        "itemcode": "ACFU0046",
        "uomcode": "Unt",
        "quantity": 1,
        "weight": 0.05,
        "width": 2,
        "height": 2,
        "length": 12,
        "volume": 48
    },
    {
        "itemcode": "ACFU0046",
        "uomcode": "Box",
        "quantity": 600,
        "weight": 3.8,
        "width": 34,
        "height": 36,
        "length": 30,
        "volume": 36720
    }
]

Method to obtain the sales format of the product

Example getMeasurementUnits call:

1var axios = require('axios');
2var data = '';
3 
4var config = {
5  method: 'get',
6  url: 'https://api.qnubu.com/api/product/getMeasurementUnits',
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 Precio

Obtiene la tarifa completa de precios del cliente. Estos precios incluyen el descuento aplicado. Además se envía el precio PVP del producto.


Endpoint:

GET /product/getPrice

Respuesta correcta de obtención de precio del producto

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

[
    {
        "itemCode": "ACVA0061",
        "price": 0.56,
        "pvp": 0.93
    },
    {
        "itemCode": "ACVA0062",
        "price": 0.35,
        "pvp": 0.58
    }
]

Método para obtener el precio del producto

Llamada de ejemplo getPrecio:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/product/getPrice',
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 /product/getAmountDiscount

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 getAmountDiscount:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/product/getAmountDiscount',
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 Catalogue 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.qnubu.com/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

Returns the complete list of items prepared for data import into Prestashop platforms.


Endpoint:

GET /producto/getCsvPrestashop

Response obtain catalogue

Here is an example of the correct answer obtained:

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

Method to obtain the catalogue adapted to Prestashop

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.qnubu.com/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 Catalogue 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.qnubu.com/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/getCsvVariations

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.qnubu.com/api/producto/getCsvVariations',
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/getCsvAtributes

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.qnubu.com/api/producto/getCsvAtributes',
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 /order/newOrder

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": "Do not send documentation",
    "remarks": "Order Comments",
    "items": [
        {
            "itemCode": "MAEX0188",
            "quantity": 10
        },
        {
            "itemCode": "PREN0009",
            "quantity": 1
        }
    ]
}

Correct Answer Obtained

Order successfully grabbed

Method to create new order

Example createNewOrder 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.qnubu.com/api/order/newOrder',
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 /customer/getShippingAddress

Correct Answer Obtained

[
{
        "address": "My address",
        "street": "123rd test street",
        "city": "Montilla",
        "zipCode": "14550",
        "state": "Córdoba",
        "country": "Córdoba",
        "contactPerson": "Manuel Fernández López.",
        "phone": "+34 6xx xx xx xx",
        "schedule": "From 10 a.m. to 2 p.m.",
        "remark": "Transport Remarks"
    }
]

Method to obtain the shipping address(es)

Example call getShippingAddress:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/customer/getShippingAddress',
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 /customer/createShippingAddress

Example object

1{
2    "name": "Córdoba Shop 2",
3    "street": "Sample Street 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": "Transport Remarks"
12}

Correct Answer Obtained

Address 'Córdoba Shop 2' created successfully.

Method to create a new shipping address

Example call createShippingAddress:

1var axios = require('axios');
2var data = JSON.stringify({
3    "name": "Córdoba Shop 2",
4    "street": "Sample Street 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": "Transport Remarks"
13});
14 
15var config = {
16  method: 'post',
17  url: 'https://api.qnubu.com/api/customer/createShippingAddress',
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 /customer/updateShippingAddress

Correct Answer Obtained

Address 'Córdoba Shop 2' updated successfully.

Method to update the data of your shipping addresses

Sample call updateShippingAddress:

1var axios = require('axios');
2var data = JSON.stringify({"address":"My address","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.qnubu.com/api/customer/updateShippingAddress',
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 /customer/deleteShippingAddress

Example object

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

Correct answer obtained

Address 'Córdoba Tienda 2' deleted successfully.

Method to remove a shipping address

Example call deleteShippingAddress:

1var axios = require('axios');
2var data = JSON.stringify({  "address": "Tienda Córdoba" });
3 
4var config = {
5  method: 'delete',
6  url: 'https://api.qnubu.com/api/customer/deleteShippingAddress',
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 /customer/getBillingAddress

Correct Answer Obtained

[
    {
        "address": "Córdoba Address",
        "street": "Sample street 123",
        "city": "Montilla",
        "zipCode": "14550",
        "state": "Córdoba",
        "country": "Córdoba"
    }
]

Method to obtain the billing address(es)

Example call getBillingAddress:

1var axios = require('axios');
2 
3var config = {
4  method: 'get',
5  url: 'https://api.qnubu.com/api/customer/getBillingAddress',
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.