PXM Hierarchies/
PXM Hierarchies API/
Create a Hierarchy

Create a Hierarchy

POST Create a Hierarchy

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

Creates a hierarchy.

Parameters

Headers

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

Body

NameRequiredTypeDescription
typeRequiredstringAlways: hierarchy
attributes.nameRequiredstringThe name of the hierarchy. The maximum length is 1000 characters.
attributes.descriptionOptionalstringA description of the hierarchy.
attributes.slugOptionalstringA unique slug for the hierarchy.
attributes.localesOptionalobjectThe product details localized in the supported languages. For example, product names or descriptions.

Request Example

curl -X POST https://api.moltin.com/pcm/hierarchies/ \
     -H "Authorization: Bearer XXXX" \
     -d $'{
        "data":{
            "type":"hierarchy",
            "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
Get a Hierarchy

Learn

Docs