From product identifiers to UUID

Compatible versions: v7 / SaaS

#From product identifier to product UUID

This guide only concerns 7.0 and Serenity users.

The goal of this guide is to help you to move from a product-identifier-based logic to a UUID one.

#What will happen?

We deployed 8 new API endpoints, endpoints that have the same role as already-existing ones:

From November 2022, the product identifier value (pim_catalog_identifier attribute) has now become optional.

#Why do we do that?

A PIM used to contain one and only identification: the so-called field identifier (the only pim_catalog_identifier attribute of the whole product). In Serenity, this field value is the main identifier of the product. You can now change your main identifier and choose another identifier attribute instead of the SKU. But what if the main identifier for your catalog changes overtime? What if you would like to transition from the SKU to an EAN as the main identifier for example? The identifiers on your products would then change and this why we recommend using our UUID API endpoints. The product UUID (for Universally Unique Identifier) allows every product on the PIM to have a unique and immutable way to identify it.

That's the purpose of the brand-new product UUID feature.

But before making it happen, a product must have a unique and immutable way to identify it: that's why we introduced the product UUID (for Universally Unique Identifier).

#What are the impacts?

Of course, Products endpoints will remain available (and they be enriched with a UUID property), even whith the availability of the new API endpoints. Nevertheless, now that the current product identifier is optional:

#What do we advise you?

As UUID API endpoints have now been released, we recommend you to jump on the bandwagon right away:

#An example of what you may have to do?

Let's imagine you developed a product-identifier-based solution that synchronizes PIM products to a random eCommerce solution.

You persist the correlation between PIM products and eCommerce ones in a correlation table.

    TABLE correlation {
          akeneo_identifier,
          ecommerce_identifier
      }
    

Today, its running is as follows:

  Get all Akeneo products with GET /api/rest/v1/products
      For each retrieved products:
        identifier = identifier of the product
        Get the ecommerce_identifier matching identifier by querying the correlation table
        if ecommerce_identifier was not found
          Add the product to the eCommerce
          Add (identifier, ecommerce_identifier) in the correlation table
        else
          Update the product identified by ecommerce_identifier in the eCommerce
    

How do you turn your application into a product-UUID one?

Firstly, replace the way of getting Akeneo products: from GET /api/rest/v1/products to GET /api/rest/v1/products-uuid. Then, add a UUID column to your correlation table.

    TABLE correlation {
          akeneo_identifier,
          akeneo_uuid,
          ecommerce_identifier
      }
    

And at last, step by step, replace akeneo_identifier in your correlation table with uuid

    Get all Akeneo products with GET /api/rest/v1/products-uuid
        For each retrieved products:
            identifier = identifier of the product
            uuid = uuid of the product
            Get the ecommerce_identifier matching uuid in the correlation table
            if ecommerce_identifier was not found
                Get the ecommerce_identifier matching identifier in the correlation table
                if ecommerce_identifier was found
                    Add uuid in the correlation table
                    Update the product in the eCommerce
                else
                    Add the product to the eCommerce
                    Add (identifier, uuid, ecommerce_identifier) in the correlation table
            else
                Update the product identified by ecommerce_identifier in the eCommerce
    

If you need help, don't hesitate to contact us!