# Shop List

### Overview <a href="#shoplistapidocumentation-overview" id="shoplistapidocumentation-overview"></a>

This API  allows users to access and obtain a comprehensive list of products available . Additionally, the service enables users to obtain detailed information about individual products, such as specifications, pricing, and availability. This facilitates efficient distribution processes by providing a centralized hub for managing and acquiring products from multiple suppliers or manufacturers.. It supports various query parameters for flexible searches and provides paginated results

### Endpoint <a href="#shoplistapidocumentation-endpoints" id="shoplistapidocumentation-endpoints"></a>

#### Query Shop Items <a href="#shoplistapidocumentation-queryshopitems" id="shoplistapidocumentation-queryshopitems"></a>

Retrieves a list of shop items based on the provided query parameters.

* **URL:** `/shop/products`
* **Method:** `GET`
* **Query Parameters:**

<table data-header-hidden><thead><tr><th width="290"></th><th></th><th></th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Description</td></tr><tr><td><code>pageToken</code></td><td>string</td><td>Optional. A token for pagination to fetch the next set of results.<br>in order to use pagination you need to send <code>pageToken</code> if it exists on previous request</td></tr><tr><td><code>pageSize</code></td><td>number</td><td>Optional,  the size of each page. Range between <code>5-50</code></td></tr><tr><td><code>parentId</code></td><td>string</td><td>Optional, filter the products list based on parentId</td></tr></tbody></table>

* **Success Response:**
  * **Code:** 200 OK
  * **Content:**
  * ```json
    {
        "nextPageToken": "<TOKEN_FOR_NEXT_PAGE>",
        "result": [
              {
                    "country": "GLOBAL",
                    "productId": "038-00",
                    "name": "THE_GLOBAL_GIFT_CARD",
                    "state": "ACTIVE",
                    "region": "global",
                    "parentId": "038",
                    "baseCurrency": "EUR",
                    "variants": {
                        "038-00-range": {
                            "range": {
                                "min": 5,
                                "max": 5000,
                                "step": 5,
                            },
                            "state": "ACTIVE",
                            "name": "Global Gift Card",
                            "sku": "038-00-range"
                        }
                    },
                    "productType": "range",
                    "customerDeal": "CustomerDeal"
                },
        ]
    }
    ```
* **Note:** The `nextPageToken` value is provided for pagination. Include this token as the `pageToken` parameter in your next request to retrieve subsequent pages.

#### Response Data <a href="#shoplistapidocumentation-responsedata" id="shoplistapidocumentation-responsedata"></a>

The response from the "Query Shop Items" endpoint contains a JSON object with two main properties: `nextPageToken` and `result`. Below is a detailed description of each field within the response data:

* `nextPageToken` (<mark style="color:orange;">string</mark> | <mark style="color:orange;">null</mark>): A token that can be used to fetch the next page of results. This value is `null` if there are no more pages to retrieve.

* `result` (<mark style="color:orange;">array</mark>): An array of shop item objects. Each object in the array represents a single shop item and contains the following fields:
  * `parentId` (<mark style="color:orange;">string</mark>): The ID of the parent item. This field helps in understanding the hierarchy or brand of items within the shop.
  * `region`: The region of the product (`LOCAL`, `GLOBAL ,`[`Read this`](https://neomsolutions.gitbook.io/gifthub-api-doc/general/region)).   this means where product can be redeemed&#x20;
  * `productId` (<mark style="color:orange;">string</mark>): A unique identifier for the product. This is crucial for fetching specific product details or performing operations related to the product.
  * `name` (<mark style="color:orange;">string</mark>): The English name of the product. This is the human-readable name used to identify the product in listings or searches.
  * [`baseCurrency`](https://neomsolutions.gitbook.io/gifthub-api-doc/general/currency-codes) (<mark style="color:orange;">string</mark>): The base currency code (ISO 4217) for the product prices. Indicates the currency in which product prices are quoted.
  * `variants` (<mark style="color:orange;">object</mark>): Depending on [`productType`](https://neomsolutions.gitbook.io/gifthub-api-doc/general/product-types), this object contains detailed information about each variant of the product:

    * For `productType` = <mark style="color:red;">`fixed`</mark>,&#x20;
      * variants are described by:
        * `sku` (<mark style="color:orange;">string</mark>): The stock-keeping unit identifier.
        * `state` (<mark style="color:orange;">string</mark>): The availability state (`ACTIVE` or `INACTIVE`).
        * `name` (<mark style="color:orange;">string</mark>): The name of the variant.
        * `quote` (<mark style="color:orange;">number</mark>): The price of the variant.

    * For `productType` = <mark style="color:red;">`range`</mark>,&#x20;

    * variants represent a range of options, described by:
      * `state` (<mark style="color:orange;">number</mark>): The availability state (`ACTIVE` or `INACTIVE`).
      * `sku` (<mark style="color:orange;">string</mark>): The stock-keeping unit identifier for the range.
      * `name` (<mark style="color:orange;">number</mark>): The name of the variant.
      * `range` (<mark style="color:orange;">object</mark>):

        * `min` (<mark style="color:orange;">number</mark>): The minimum value in the range.
        * `max` (<mark style="color:orange;">number</mark>): The maximum value in the range.
        * `step` (<mark style="color:orange;">number</mark>): The increment between values in the range.

    * For `productType` = <mark style="color:red;">`time`</mark>,&#x20;

    * variants  described by:
      * equity(<mark style="color:orange;">string</mark>):  basically a label for the variants (12 Gem )
      * `sku` (<mark style="color:orange;">string</mark>): The stock-keeping unit identifier.
      * `state` (<mark style="color:orange;">string</mark>): The availability state (`ACTIVE` or `INACTIVE`).
      * `name` (<mark style="color:orange;">string</mark>): The name of the variant.
      * `quote` (<mark style="color:orange;">number</mark>): The price of the variant.

    * For `productType` = <mark style="color:red;">`custom_fixed`</mark>,&#x20;

    * variants  described by:
      \*
      * `sku` (<mark style="color:orange;">string</mark>): The stock-keeping unit identifier.
      * `state` (<mark style="color:orange;">string</mark>): The availability state (`ACTIVE` or `INACTIVE`).
      * `name` (<mark style="color:orange;">string</mark>): The name of the variant.
      * `quote` (<mark style="color:orange;">number</mark>): The price of the variant.

* [`productType`](https://neomsolutions.gitbook.io/gifthub-api-doc/general/product-types) (<mark style="color:orange;">string</mark>): Indicates the type of product, affecting the structure of `variants`. Possible values include `fixed` for specific items and `range` for items available in a range of options.

* `customerDeal` (<mark style="color:orange;">object</mark>):  See [Customer Deal](https://app.gitbook.com/o/rAHTXDKVzIOr4Jqk2SBF/s/bgpTyn5ehDgNS21U6ST7/~/changes/33/customer/customer-deal)
