PIM Categories and Attributes


Categories of the marketplace

laets manages a hierarchical category tree to classify products or services. This tree can be fetched with the following api request:


  {{api_url}}/v1/application_category/?application={{APPLICATION_ID}}

The response will contain:

  • the total number of categories
  • the list of categories of the application
  
  {
  "meta": {
  "limit": 60,
  "next": null,
  "offset": 0,
  "previous": null,
  "total_count": 21
  },
  "objects": [
  {
    "application": {
        "id": 743,
        "pk": 743,
        "resource_uri": "https://api.sandbox.iceberg.technology/v1/application/743/"
    },
    "available_product_data": [],
    "breadcrumb_name": "",
    "children": [
        {
            "id": 63774,
            "pk": 63774,
            "resource_uri": "https://api.sandbox.iceberg.technology/v1/application_category/63774/"
        },
        {
            "id": 63775,
            "pk": 63775,
            "resource_uri": "https://api.sandbox.iceberg.technology/v1/application_category/63775/"
        }
    ],
    "children_count": 2,
    "description": "",
    "external_id": null,
    "google_taxonomy": null,
    "id": 63773,
    "image": "",
    "keywords": "",
    "language": "fr",
    "localization_id": 5665,
    "localized_available_product_data": [],
    "name": "Couples",
    "parent_ids_tree": [
        63773
    ],
    "parents": [],
    "resource_uri": "https://api.sandbox.iceberg.technology/v1/application_category/63773/",
    "shown_in_languages": [
        "fr"
    ],
    "slug": "books-couple",
    "sort_order": 10,
    "status": 1,
    "status_localized": "actif",
    "weight": 0
  }
  .....
  ]
  }

The response contains:

  • external_id: the category external identifier
  • name: the name of the category
  • parents: the parent category identifier to manage the hierarchy

Note :

The recommendation is to use the external_id (not the id) to be consistent between the sandbox environment and the production environment.


Standard Attributes

To retrieve the standard attributes of the marketplace, the following api request must be used:

  
  {{api_url}}/v1/mapper_entity/product_and_offer/?application_id={{APPLICATION_ID}}

The response contains:

  • id: the attribute unique identifier
  • name: the name of the attribute
  • mandatory: field to know if the attribute is required
  • type: the type of the attribute
  • choices: the possible choices when it’s a closed list


Custom/Additional attributes

Custom attributes are specific attributes for different entity types. To retrieve the custom attributes, several api request must be used:

Note :

It’s mandatory to fetch attributes by looping on category because an attribute can be mandatory for one category and not for an other.

  
  {{api_url}}/v1/productoffer/helpers/attributes/?exclude_base_attributes=1&application_categories={{application_category_id}}&application_id={{APPLICATION_ID}}
  {{api_url}}/v1/product/helpers/attributes/?exclude_base_attributes=1&application_categories={{application_category_id}}&application_id={{APPLICATION_ID}}
  {{api_url}}/v1/productoffer/helpers/attributes/?application_id={{APPLICATION_ID}}&exclude_base_attributes=1
  {{api_url}}/v1/product/helpers/attributes/?application_id={{APPLICATION_ID}}&exclude_base_attributes=1

The response contains:

  • name: the name of the attribute
  • nullable: field to know if the attribute is required
  • type: the type of the attribute
  • choices: the possible choices when it’s a closed list