> ## 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.

# Obter esquema de campos personalizados

Retorna o esquema de campos personalizados publicado do seu comerciante, como JSON Schema (padrão) ou como a definição de campos nativa da Localpayment (?format=definition). Use-o para criar formulários e validar attributes antes de chamar a API.

* Os esquemas são definidos e publicados pela Localpayment para o seu comerciante durante o onboarding; solicite alterações por meio do seu gerente de conta.
* Quando nenhum esquema está publicado, attributes é aceito sem validação e este endpoint retorna 404.
* O esquema se aplica a entidades INDIVIDUAL e COMPANY.

Erros usam `application/problem+json` com um `code` estável. Catálogo completo: [Status de Entidades e Códigos de Erro](https://docs.localpayment.com/pt-br/reference/entity-statuses-and-error-codes.md).


## OpenAPI

````yaml openapi/pt-br/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: Obter esquema de campos personalizados
      operationId: get-custom-fields-schema
      parameters:
        - name: Authorization
          in: header
          description: >-
            Token de acesso Bearer para autenticação. Este token é obtido nos
            endpoints [Obter token de acesso](/pt-br/reference/get-token) ou
            [Renovar token de acesso](/pt-br/reference/refresh-token). Sua conta
            de comerciante e o usuário que realiza a ação são identificados a
            partir dele.
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: >-
            Identificador de rastreamento (UUID). Exibido na resposta; gerado
            pelo Localpayment se ausente.
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: format
          in: query
          description: >-
            Definição para receber a lista de campos nativos. Padrão: 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: 'Não autorizado. UNAUTHORIZED: Token de acesso ausente ou inválido.'
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalhes do problema segundo a RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumo do problema.
                  status:
                    type: integer
                    description: Código de status HTTP.
                  detail:
                    type: string
                    description: Explicação em linguagem acessível a humanos.
                  instance:
                    type: string
                    description: Caminho da solicitação.
                  code:
                    type: string
                    description: >-
                      Código de erro estável e legível por máquina. Faça a
                      ramificação da lógica com base nesse valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador da solicitação. Informe-o ao entrar em
                      contato com o suporte.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, quando aplicável.
                    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: >-
            Não encontrado. CUSTOM_FIELD_SCHEMA_NOT_FOUND: Nenhum esquema de
            campos personalizados foi publicado para o seu comerciante.
          content:
            application/problem+json:
              schema:
                type: object
                description: >-
                  Detalhes do problema segundo a RFC 9457
                  (application/problem+json).
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: Breve resumo do problema.
                  status:
                    type: integer
                    description: Código de status HTTP.
                  detail:
                    type: string
                    description: Explicação em linguagem acessível a humanos.
                  instance:
                    type: string
                    description: Caminho da solicitação.
                  code:
                    type: string
                    description: >-
                      Código de erro estável e legível por máquina. Faça a
                      ramificação da lógica com base nesse valor.
                  correlationId:
                    type: string
                    format: uuid
                    description: >-
                      Identificador da solicitação. Informe-o ao entrar em
                      contato com o suporte.
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: Campos problemáticos, quando aplicável.
                    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.