Service Category

Link to swagger documentation

  1. Introduction
  2. How to find out the category id?
  3. How to get the attributes specific to a category?
  4. Markets

Introduction

This part of the API will give you the information regarding the categories and their attributes, VAT and commission fees per market.

To prepare your product data file, you need to know to which METRO Markets categoryID your product belongs to and which attributes are needed.

Please take into consideration the following:

  • There are general attributes which are needed for all products (regardless of the category).
  • There are general attributes which are specific per market (example product name, description, key feature).
  • There are attributes which are specific to a category.
  • A specific category attribute can be mandatory in category A and optional in category B.
  • Some attributes are localizable (that means they need to be provided for every indicated market. You will get the info in requiredLanguages).
  • Categoryids are the same on all markets.

How to find out the category id?

The GET /public/api/v1/{market}/categories request provides a full list of all categoriesIDs. You can see the main category (parent) and subcategories inside (children). Please, select the categoryIDs from the lowest level inside each category.
You can get all supported {market} values here

Example: GETrequest sent to https://service-category.sandbox.infra.metro-markets.cloud/public/api/v1/DE/categories

In the snippet of the response you can see that the lowest category for Smoker is f0442c89-82c0-481b-be5b-a2b992ac4360, as it doesn´t have more subcatgories (children). This is the category id you need to use on you product data. You can also see the applied comissionFee and the VAT.

Snippet response

[
    {
        "children": [
            {
                "children": [
                    {
                        "children": [
                            {
                                "children": [],
                                "id": "f0442c89-82c0-481b-be5b-a2b992ac4360",
                                "name": "Smoker",
                                "commissionFee": 10,
                                "parentIds": [
                                    "1070ec46-c3bd-4d0d-b709-ead9600dcc8f"
                                ],
                                "taxes": [
                                    {
                                        "type": "VAT",
                                        "amount": 16
                                    }
                                ]
                            }
                        ],
              ......

How to get the attributes specific to a category?

To get a list of all attributes of that category id you need to use GET /public/api/v1/{market}/categories/{id}.

Example with the id previously obtained:

GET sent to https://service-category.sandbox.infra.metro-markets.cloud/public/api/v1/DE/categories/f0442c89-82c0-481b-be5b-a2b992ac4360 and in the response you will see the attributes which are specific to that category.

Here you can see a snippet of the response.
In this case the categoryid f0442c89-82c0-481b-be5b-a2b992ac4360 the following specific attributes Length, Length Unit, Color need to be provided in the headers.

{
  "attributes": [
    {
      "type": {
        "value": 1,
        "text": "List of value",
        "baseUnit": null,
        "possibleUnits": null,
        "possibleValues": [
          "lila",
          "rot",
          "weiss",
          "gelb"
        ]
      },
      "id": "50dae0e4-f391-4195-bd19-54b2d12b53b7",
      "code": "color",
      "name": "Farbe",
      "csvHeaderLabel": "Color",
      "description": "",
      "required": false,
      "requiredLanguages": null
    },
    {
      "type": {
        "value": 6,
        "text": "Decimal",
        "baseUnit": "m",
        "possibleUnits": [
          "mm",
          "cm",
          "m",
          "in"
        ],
        "possibleValues": null
      },
      "id": "b4547557-2f3d-448d-92a8-f8395a8f4e6a",
      "code": "length_depth_product",
      "name": "Produktlänge/-tiefe",
      "csvHeaderLabel": "Length",
      "description": "Länge eines Produkts: Messung eines aufgebauten Produkts vom Anfang bis zum Ende seiner längsten Seite. Bitte verwenden Sie den Punkt (.) als Trennzeichen für Dezimalstellen.",
      "required": false,
      "requiredLanguages": null
    },
    {
      "type": {
        "value": 3,
        "text": "Text",
        "baseUnit": null,
        "possibleUnits": null,
        "possibleValues": null
      },
      "id": "c904fe13-9b20-4315-9391-413aa13b27b5",
      "code": "accessories",
      "name": "Accessories",
      "csvHeaderLabel": "Accessories",
      "description": "Accessoires, die im Produktumfang enthalten sind, z. B. eine Messerhülle",
      "required": false,
      "requiredLanguages": [
        "DE",
        "ES"
      ]
    }
..... 

Explanation of the values:

  • id: internal attribute’s id number
  • code: internal attribute’s name
  • name: attribute’s name in the specific language of that market
  • csvHeaderLabel: this is the header name, please use it inside your product data file
  • description: brief explanation
  • required: boolean value to check whether attribute is mandatory or not
  • requiredLanguages: it specifies if attribute is localizable, that means, it needs to be given in the language of every market from the list. The requiredLanguages is indicated for example in Text and File types attributes. In the example above, you would need to provide Accessories DE, Accessories ES. If it´s null, then it´s not needed.
  • type: it´s an array which informs you about the type of attribute (value and text), the possibleUnits and possibleValues. In the example above a Decimal is given with possibleUnits, so you need to provide two columns: Length decimal number | Length Unit indicating one of the possibleUnits values.

Value Text Comment
1 List of values Provide a value from the possible options list
2 Boolean
3 Text localizable
4 Integer a number + add measure unit in a separate column if necessary
5 File url to the file
6 Decimal a decimal + add measure unit in separate column if necesarry
7 Image url to the image
8 LongText localizable

Markets

You can get all supported {market} values here.