• PXM Hierarchies/
    PXM Hierarchies API/
    Update a Hierarchy

    Update a Hierarchy

    PUT Update a Hierarchy

    https://api.moltin.com/pcm/hierarchies/:hierarchyId
    

    Updates the specified hierarchy.

    Parameters

    Path parameters

    NameRequiredTypeDescription
    hierarchyIdRequiredstringThe unique identifier of the hierarchy.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the hierarchy is not updated.

    NameRequiredTypeDescription
    typeRequiredstringAlways: hierarchy
    idRequiredstringThe unique identifier of the hierarchy. Must match the hierarchy ID specified in the request path.
    attributes.nameOptionalstringAn updated name. Cannot be null.
    attributes.descriptionOptionalstringAn updated description.
    attributes.slugOptionalstringAn updated slug. Must be unique.
    attributes.localesOptionalobjectThe product details localized in the supported languages. For example, product names or descriptions.

    Request Example

    curl -X PUT https://api.moltin.com/pcm/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007 \
         -H "Authorization: Bearer XXXX" \
         -d $'{
            "data": {
                "type": "hierarchy",
                "id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
                "attributes":{
                    "name": "Major Appliances",
                    "description": "Free-standing appliances",
                    "slug": "Major-Appliances-MA0"
                    }
                }
            }
        }'
    

    Response Example

    200 OK

    {
        "data": {
            "type": "hierarchy",
            "id": "0e119de2-5fb0-4bca-9b84-b3fc6c903007",
            "attributes": {
                "description": "Free-standing appliances",
                "name": "Major Appliances",
                "slug": "Major-Appliances-MA0",
                "locales":{
                    "fr-FR": {
                        "name": "Gros électroménagers",
                        "description": "Appareils autonomes"
                    }
                }
            },
            "relationships": {
                "children": {
                    "data": [],
                    "links": {
                        "related": "/hierarchies/0e119de2-5fb0-4bca-9b84-b3fc6c903007/children"
                    }
                }
            },
            "meta": {
                "created_at": "2023-02-07T14:01:51.247Z",
                "owner": "store",
                "updated_at": "2023-02-07T14:01:51.247Z"
            }
        }
    }
    

    Was this helpful?

    Previous
    Create a Hierarchy