> ## Documentation Index
> Fetch the complete documentation index at: https://docs.localpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ottenere lo schema dei campi personalizzati

Restituisce lo schema dei campi personalizzati pubblicato per il tuo account esercente, come JSON Schema (predefinito) o come definizione dei campi nativa di Localpayment (?format=definition). Usalo per creare moduli e convalidare attributes prima di chiamare l'API.

* Gli schemi vengono definiti e pubblicati da Localpayment per il tuo account esercente durante l'onboarding; richiedi eventuali modifiche tramite il tuo account manager.
* Se non è pubblicato alcuno schema, attributes viene accettato senza convalida e questo endpoint restituisce 404.
* Lo schema si applica sia alle entità INDIVIDUAL sia alle entità COMPANY.

Gli errori usano `application/problem+json` con un `code` stabile. Catalogo completo: [Stati delle entità e codici di errore](https://docs.localpayment.com/it/reference/entity-statuses-and-error-codes.md).


## OpenAPI

````yaml openapi/it/localpayment.json GET /api/entity/v1/custom-fields/schema
openapi: 3.1.0
info:
  version: '1.0'
  title: Localpayment
  contact:
    name: Support
    url: mailto:support@localpayment.com
servers:
  - url: https://api.stage.localpayment.com
    description: Stage
security:
  - token: []
paths:
  /api/entity/v1/custom-fields/schema:
    get:
      summary: Ottenere lo schema dei campi personalizzati
      operationId: get-custom-fields-schema
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token di accesso Bearer per l'autenticazione. Questo token si
            ottiene dagli endpoint [Ottenere il token di
            accesso](/it/reference/get-token) o [Rinnovare il token di
            accesso](/it/reference/refresh-token). Da esso vengono ricavati il
            tuo conto esercente e l'utente che esegue l'operazione.
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: >-
            Identificatore di traccia (UUID). Restituito nella risposta;
            generato da Localpayment se assente.
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: format
          in: query
          description: >-
            definition per ricevere l'elenco dei campi nativi. Valore
            predefinito: JSON Schema 2020-12.
          required: false
          schema:
            type: string
            enum:
              - definition
      responses:
        '200':
          description: OK.
          content:
            application/json:
              schema:
                type: object
                properties:
                  $schema:
                    type: string
                    examples:
                      - https://json-schema.org/draft/2020-12/schema
                  type:
                    type: string
                    examples:
                      - object
                  properties:
                    type: object
                    properties:
                      reasonForAccountOpening:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                          title:
                            type: string
                            examples:
                              - Reason for account opening
                          enum:
                            type: array
                            items:
                              type: string
                              examples:
                                - receive_payments_for_goods_and_services
                      sourceOfFundsAndIncome:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      numberOfEmployees:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                          enum:
                            type: array
                            items:
                              type: string
                              examples:
                                - 1-10
                      estimatedAnnualRevenueUsd:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      estimatedMonthlyVolumeUsd:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      businessActivityDescription:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                          minLength:
                            type: integer
                            examples:
                              - 1
                          maxLength:
                            type: integer
                            examples:
                              - 2000
                      countryTaxResidence:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                          minLength:
                            type: integer
                            examples:
                              - 3
                          maxLength:
                            type: integer
                            examples:
                              - 3
                      socialMedia:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      emailPixKey:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      percentageOfOwnership:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      hasControl:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      documentCountry:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                      countryOfTaxId:
                        type: object
                        properties:
                          type:
                            type: string
                            examples:
                              - string
                  additionalProperties:
                    type: boolean
                    examples:
                      - false
              examples:
                Example 1:
                  value:
                    $schema: https://json-schema.org/draft/2020-12/schema
                    type: object
                    properties:
                      reasonForAccountOpening:
                        type: string
                        title: Reason for account opening
                        enum:
                          - receive_payments_for_goods_and_services
                          - payroll
                          - other
                      sourceOfFundsAndIncome:
                        type: string
                      numberOfEmployees:
                        type: string
                        enum:
                          - 1-10
                          - 11-50
                          - 51-200
                          - 200+
                      estimatedAnnualRevenueUsd:
                        type: string
                      estimatedMonthlyVolumeUsd:
                        type: string
                      businessActivityDescription:
                        type: string
                        minLength: 1
                        maxLength: 2000
                      countryTaxResidence:
                        type: string
                        minLength: 3
                        maxLength: 3
                      socialMedia:
                        type: string
                      emailPixKey:
                        type: string
                      percentageOfOwnership:
                        type: string
                      hasControl:
                        type: string
                      documentCountry:
                        type: string
                      countryOfTaxId:
                        type: string
                    additionalProperties: false
                Example 2 - Response with ?format=definition:
                  value:
                    version: 9
                    status: PUBLISHED
                    fields:
                      - key: reasonForAccountOpening
                        label: Reason for account opening
                        description: null
                        type: ENUM
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options:
                            - receive_payments_for_goods_and_services
                            - payroll
                            - other
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: sourceOfFundsAndIncome
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: numberOfEmployees
                        label: null
                        description: null
                        type: ENUM
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options:
                            - 1-10
                            - 11-50
                            - 51-200
                            - 200+
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: estimatedAnnualRevenueUsd
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: estimatedMonthlyVolumeUsd
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: businessActivityDescription
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: 1
                          maxLength: 2000
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: countryTaxResidence
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: 3
                          maxLength: 3
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: socialMedia
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: emailPixKey
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: percentageOfOwnership
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: hasControl
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: documentCountry
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                      - key: countryOfTaxId
                        label: null
                        description: null
                        type: STRING
                        required: false
                        constraints:
                          minLength: null
                          maxLength: null
                          pattern: null
                          min: null
                          max: null
                          options: null
                          minItems: null
                          maxItems: null
                        children: []
                        items: null
                    createdBy: '12345'
                    createdAt: '2024-01-15T17:18:41Z'
                    approvedBy: '67890'
                    approvedAt: '2024-01-15T17:18:46Z'
        '401':
          description: >-
            Non autorizzato. UNAUTHORIZED: token di accesso mancante o non
            valido.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Dettagli del problema secondo RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve riepilogo del problema.
                  status:
                    type: integer
                    description: Codice di stato HTTP.
                  detail:
                    type: string
                    description: Spiegazione leggibile.
                  instance:
                    type: string
                    description: Percorso della richiesta.
                  code:
                    type: string
                    description: >-
                      Codice di errore stabile e leggibile automaticamente. Basa
                      la tua logica su questo valore.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificatore della richiesta. Indicalo quando contatti
                      l'assistenza.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campi non validi, se applicabile.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - UNAUTHORIZED:
                  value:
                    type: about:blank
                    title: Unauthorized
                    status: 401
                    detail: Missing or invalid access token.
                    instance: /api/entity/v1/custom-fields/schema
                    code: UNAUTHORIZED
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '404':
          description: >-
            Non trovato. CUSTOM_FIELD_SCHEMA_NOT_FOUND: non è pubblicato alcuno
            schema di campi personalizzati per il tuo conto esercente.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Dettagli del problema secondo RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve riepilogo del problema.
                  status:
                    type: integer
                    description: Codice di stato HTTP.
                  detail:
                    type: string
                    description: Spiegazione leggibile.
                  instance:
                    type: string
                    description: Percorso della richiesta.
                  code:
                    type: string
                    description: >-
                      Codice di errore stabile e leggibile automaticamente. Basa
                      la tua logica su questo valore.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificatore della richiesta. Indicalo quando contatti
                      l'assistenza.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campi non validi, se applicabile.
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - CUSTOM_FIELD_SCHEMA_NOT_FOUND:
                  value:
                    type: about:blank
                    title: Not found
                    status: 404
                    detail: No custom-fields schema is published for your merchant.
                    instance: /api/entity/v1/custom-fields/schema
                    code: CUSTOM_FIELD_SCHEMA_NOT_FOUND
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
      security:
        - token: []
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.