title: Category Request
x-tags:
  - Catalog
type: object
description: On edit, omitted top-level properties retain their existing values.
properties:
  name:
    type: string
    minLength: 1
    maxLength: 255
    example: Wraps
  tags:
    allOf:
      - $ref: ./CatalogUuidList.yaml
    description: UUIDs of tags to associate with the category.
  media_uuid:
    type:
      - string
      - 'null'
    format: uuid
    description: The UUID of an image in the merchant's media library. Supply `null` to remove existing media.
  media_background_colour:
    type:
      - string
      - 'null'
    pattern: '^#(?:[A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$'
    example: '#F0F0F0'
  availability:
    $ref: ./AvailabilityRequest.yaml
  description:
    type:
      - string
      - 'null'
    minLength: 1
    maxLength: 255
  pos_tag_colour:
    type:
      - string
      - 'null'
    pattern: '^#(?:[A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$'
    example: '#F0F0F0'
  entries:
    allOf:
      - $ref: ./CatalogUuidList.yaml
    description: Ordered UUIDs of items to associate directly with the category.
  sub_categories:
    allOf:
      - $ref: ./CatalogUuidList.yaml
    description: |-
      Ordered UUIDs of existing categories owned by the same merchant. The category cannot reference itself directly.

      On create, omission defaults to an empty array. On edit, omission preserves existing links, a supplied array replaces them, and an empty array clears them. Item relationships in `entries` are managed independently.
  translations:
    type: object
    properties:
      name:
        $ref: ./Translation.yaml
      description:
        $ref: ./Translation.yaml
