> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.xmenu.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Dettagli categoria

> Restituisce i dettagli di una singola categoria tramite il suo identificativo univoco.



## OpenAPI

````yaml openapi-it.json GET /menu/category
openapi: 3.1.0
info:
  title: xMenu API
  description: API Pubblica xMenu - Endpoint REST e notifiche webhook
  version: 1.0.0
servers:
  - url: https://app.xmenu.it/api
    description: xMenu API Production
security: []
paths:
  /menu/category:
    get:
      tags:
        - Consultazione menu
      summary: Dettagli categoria
      description: >-
        Restituisce i dettagli di una singola categoria tramite il suo
        identificativo univoco.
      operationId: getCategory
      parameters:
        - name: uid
          in: query
          required: true
          schema:
            type: string
          description: Identificatore univoco categoria
      responses:
        '200':
          description: Risposta categoria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - apiKey: []
        - clientId: []
          clientSecret: []
        - oauth2: []
components:
  schemas:
    CategoryResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: >-
            Risultato dell'operazione: `true` se ha avuto successo, `false` se
            fallita
        category:
          $ref: '#/components/schemas/MenuCategory'
        error:
          type: string
          description: >-
            Codice errore se l'operazione è fallita. Valori possibili:

            - `CATEGORY_NOT_FOUND` = Categoria richiesta non trovata


            Vedi [Codici errore](/docs/it/overview/error-codes) per i codici di
            errore generali che possono verificarsi.
        message:
          type: string
          description: Descrizione leggibile dell'errore se l'operazione è fallita
    MenuCategory:
      type: object
      description: Categoria del menu
      properties:
        uid:
          type: string
          description: Identificatore univoco categoria
        name:
          type: string
          description: Nome categoria
        description:
          type: string
          description: Descrizione categoria
        image:
          type: string
          description: URL immagine
        products_count:
          type: integer
          description: Numero di prodotti nella categoria
        url:
          type: string
          description: URL pagina categoria
        hidden:
          type: boolean
          description: Stato di visibilità
        position:
          type: integer
          description: Posizione di visualizzazione
        subrestaurant_uids:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Elenco degli UID dei subrestaurant dove questa categoria è
            disponibile (null = disponibile in tutti i locali)
        ext_id:
          $ref: '#/components/schemas/ExtId'
        options:
          type: array
          description: Opzioni categoria ereditate dai prodotti
          items:
            $ref: '#/components/schemas/MenuOption'
    ExtId:
      type: string
      description: >-
        Disponibile in caso di richiesta con autenticazione via API Client: ID
        esterno passato in fase di importazione menu
    MenuOption:
      type: object
      description: Opzione menu di prodotto o categoria
      properties:
        uid:
          type: string
          description: Identificatore univoco opzione
        name:
          type: string
          description: Titolo opzione
        short_name:
          type: string
          description: Titolo abbreviato opzione
        type:
          type: string
          enum:
            - single
            - multiple
          description: |-
            Tipo di selezione:
            - `single` = Scelta singola
            - `multiple` = Scelte multiple consentite
        min_selectable:
          type: integer
          description: Numero minimo di valori selezionabili (solo per tipo `multiple`)
        max_selectable:
          type: integer
          description: Numero massimo di valori selezionabili (solo per tipo `multiple`)
        max_quantity:
          type: integer
          description: Quantità massima per selezione valore (se >1)
        note:
          type: string
          description: Note relative all'opzione
        hidden:
          type: boolean
          description: |-
            Stato di visibilità:
            - `false` = Visibile
            - `true` = Archiviato
        position:
          type: integer
          description: Posizione di visualizzazione (inizia da 1)
        primary:
          type: boolean
          description: |-
            Flag opzione primaria (solo per tipo `single`):
            - `false` = Non primaria
            - `true` = Opzione primaria
        first_default:
          type: boolean
          description: |-
            Comportamento selezione predefinita (solo per tipo `single`):
            - `false` = L'utente deve selezionare
            - `true` = Usa il primo valore come predefinito
        show_caption:
          type: boolean
          description: |-
            Impostazione visualizzazione carrello (solo per tipo `single`):
            - `false` = Nascondi nel carrello
            - `true` = Visualizza nel carrello
        print_caption:
          type: boolean
          description: |-
            Comportamento stampa:
            - `false` = Ometti dalla stampa ordine
            - `true` = Includi nella stampa
        subrestaurant_uids:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Elenco degli UID dei subrestaurant dove questa opzione è disponibile
            (null = disponibile in tutti i locali)
        ext_id:
          $ref: '#/components/schemas/ExtId'
        option_values:
          type: array
          description: Valori opzione disponibili
          items:
            $ref: '#/components/schemas/MenuOptionValue'
    MenuOptionValue:
      type: object
      description: Valore opzione menu con modificatore di prezzo
      properties:
        uid:
          type: string
          description: Identificatore univoco valore opzione
        name:
          type: string
          description: Nome valore opzione
        short_name:
          type: string
          description: Nome abbreviato valore opzione
        price_operator:
          type: string
          enum:
            - +
            - '-'
            - '*'
            - /
          description: |-
            Operatore modifica prezzo:
            - `+` = Addizione
            - `-` = Sottrazione
            - `*` = Moltiplicazione
            - `/` = Divisione
        price_operand:
          type: number
          description: Valore modifica prezzo
        hidden:
          type: boolean
          description: |-
            Stato di visibilità:
            - `false` = Visibile
            - `true` = Archiviato
        position:
          type: integer
          description: Posizione di visualizzazione (inizia da 1)
        checked_default:
          type: boolean
          description: |-
            Stato di selezione predefinito:
            - `false` = Non preselezionato
            - `true` = Preselezionato di default
        subrestaurant_uids:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            Elenco degli UID dei subrestaurant dove questo valore è disponibile
            (null = disponibile in tutti i locali)
        restrict_to_primary_value_uids:
          type: array
          items:
            type: string
          nullable: true
          description: >-
            UID dei valori dell'opzione principale per cui questo valore è
            disponibile:

            - `null` = Nessuna restrizione (sempre disponibile)

            - `[]` = Restrizione attiva, ma nessun valore principale ammesso
            (mai disponibile)

            - `["uid1", ...]` = Disponibile solo quando è selezionato uno di
            questi valori dell'opzione principale
        ext_id:
          $ref: '#/components/schemas/ExtId'
  responses:
    Unauthorized:
      description: Autenticazione fallita.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                description: >-
                  Formato errore standard (quando si usa autenticazione API Key
                  o Client ID/Secret)
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Sempre false per gli errori
                  error:
                    type: string
                    enum:
                      - RESTAURANT_NOT_FOUND
                      - INVALID_KEY
                      - INVALID_AUTH
                    description: Codice errore
                  message:
                    type: string
                    description: Descrizione errore leggibile
              - type: object
                description: >-
                  Formato errore OAuth (quando si usa l'autenticazione Bearer
                  token)
                required:
                  - error
                properties:
                  error:
                    type: string
                    enum:
                      - invalid_token
                      - invalid_request
                    description: Codice errore OAuth (RFC 6749)
                  error_description:
                    type: string
                    description: Descrizione errore leggibile
          examples:
            standard:
              summary: Formato errore standard (API Key / Client ID+Secret)
              value:
                success: false
                error: INVALID_KEY
                message: La chiave API fornita non è valida
            oauth:
              summary: Formato errore OAuth (Bearer token)
              value:
                error: invalid_token
                error_description: Access token non valido o scaduto
    Forbidden:
      description: Autorizzazione fallita - permessi insufficienti o accesso negato.
      content:
        application/json:
          schema:
            oneOf:
              - type: object
                description: >-
                  Formato errore standard (quando si usa autenticazione API Key
                  o Client ID/Secret)
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    description: Sempre false per gli errori
                  error:
                    type: string
                    enum:
                      - API_DISABLED
                      - INSUFFICIENT_SCOPE
                      - UNAUTHORIZED
                    description: Codice errore
                  message:
                    type: string
                    description: Descrizione errore leggibile
              - type: object
                description: >-
                  Formato errore OAuth (quando si usa l'autenticazione Bearer
                  token)
                required:
                  - error
                properties:
                  error:
                    type: string
                    enum:
                      - insufficient_scope
                      - invalid_request
                    description: Codice errore OAuth (RFC 6749)
                  error_description:
                    type: string
                    description: Descrizione errore leggibile
          examples:
            standard:
              summary: Formato errore standard (API Key / Client ID+Secret)
              value:
                success: false
                error: API_DISABLED
                message: L'accesso API non è abilitato per il ristorante
            oauth:
              summary: Formato errore OAuth (Bearer token)
              value:
                error: insufficient_scope
                error_description: 'Permessi mancanti richiesti: write:orders'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Chiave API del ristorante. Può essere ottenuta da Strumenti > Accesso
        API nella dashboard xMenu.
    clientId:
      type: apiKey
      in: header
      name: X-Client-Id
      description: >-
        Client ID per l'autenticazione API Client (deve essere usato insieme al
        Client Secret)
    clientSecret:
      type: apiKey
      in: header
      name: X-Client-Secret
      description: >-
        Client Secret per l'autenticazione API Client (deve essere usato insieme
        al Client ID)
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://app.xmenu.it/oauth/token
          scopes: {}
      description: >-
        Autenticazione OAuth 2.0 utilizzando il flusso client credentials. Il
        token di accesso deve essere incluso nell'header Authorization come
        Bearer token.

````