FacetFlux

pim.traits.create

Create a trait in a schema, or return the existing one if `code` already exists. Traits are reusable groups of attribute definitions; products opt in to traits to gain their attributes. To bind attribute definitions to the trait after creation, use pim.traits.attributes.add (or set `traitId` directly when creating attribute definitions). Response: { trait: {...}, created: bool }. Errors: { error: { code: 'not_found' | 'bad_input', ... } }.

Remote revuo:facetflux

Other tools also called pim.traits.create? See providers with this name

Input Schema


            {
  "type": "object",
  "properties": {
    "schemaId": {
      "description": "Schema id.",
      "type": "string"
    },
    "code": {
      "description": "Trait code. Unique within schema.",
      "type": "string"
    },
    "labels": {
      "description": "Localized labels.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ]
      },
      "default": null
    },
    "sortOrder": {
      "description": "Sort order.",
      "type": "integer",
      "default": 0
    }
  },
  "required": [
    "schemaId",
    "code"
  ]
}