Catalog Management ****************** PDEA Object =========== PDEA stands for Product DEscribing Attributes. All attributes that can be present in a product's :ref:`productAttributes ` should be defined as a PDEA object. .. todo:: Verify if it's mandatory to be put in the catalog .. list-table:: **Attributes** :widths: 30, 70 :header-rows: 0 * - field_name - String representing the name of the field * - field_data_type - String representing the datatype of the field. Can be one of ``string``, ``list``, ``double``, ``integer``, ``boolean``, or ``dict``. * - display_data - This is a list of **display_data** objects that specify how to display this field in different locales. At least one locale must be speficied. .. list-table:: **Display data attributes** :widths: 30, 70 :header-rows: 0 * - locale - The locale for which this object is defining how to display the field as a string. A locale is either a language code (like ``en``) or a language in combination with a country (like ``en-us``). * - display_name - This should be a UTF-8 string representing the field in the language of the locale above. PDEA Sample JSON ---------------- .. literalinclude:: pdea_object.json :language: JSON Catalog Object ============== Catalog is an object that represents the exhaustive pdea list of a group of products. .. list-table:: **Attributes** :widths: 30, 70 :header-rows: 0 * - clientCatalogId - This is a string representing the unique id of the catalog. * - description - This is an optional string description of the catalog. .. todo:: Check if this is actually optional. * - exhaustive_pdea_list - This should be the complete list of :ref:`PDEA Object`\ s that will be used in the products created under this catalog. Catalog Sample JSON ------------------- .. literalinclude:: catalog_object.json :language: JSON Retrieve a Catalog ================== Retrieve all Catalogs ===================== .. http:get:: /api-gateway/mdm-service/wms-masterdata/catalog Retrieves all catalogs currently in the system. :reqheader Accept: the response content type depends on :mailheader:`Accept` header :reqheader Authorization: OAuth token to authenticate :resheader Content-Type: this depends on :mailheader:`Accept` header of request :statuscode 200: No error :statuscode 401: Unauthorized to view this resource .. container:: toggle .. container:: header **Example request**: .. sourcecode:: http GET /api-gateway/mdm-service/wms-masterdata/catalog HTTP/1.1 Host: example.com Accept: application/json, text/javascript .. container:: toggle .. container:: header **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 .. literalinclude:: catalog_retrieve_all_response.json :language: JSON Create or Update a Catalog ========================== .. http:post:: /api-gateway/mdm-service/wms-masterdata/catalog To create or update a catalog, a :ref:`Catalog Object` has to be sent in a HTTP POST request to the above endpoint. The newly created or modified object will be returned in the response if the request is successful. :reqheader Content-Type: the request's content-type has to be passed in this header :reqheader Accept: the response content type depends on :mailheader:`Accept` header :reqheader Authorization: OAuth token to authenticate :statuscode 200: No error :statuscode 400: Bad data .. container:: toggle .. container:: header **Example request**: .. sourcecode:: http POST /api-gateway/mdm-service/wms-masterdata/catalog HTTP/1.1 Host: example.com Content-Type: application/json Accept: application/json, text/javascript .. literalinclude:: catalog_object.json :language: JSON .. container:: toggle .. container:: header **Example Response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 .. literalinclude:: catalog_object.json :language: JSON Delete a Catalog ================ .. todo:: Fid out if this is supported.