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

# Convalidare un documento d'identità

Convalida i documenti d'identità dei clienti per paese e tipo, per assicurarti che siano formattati correttamente. Usa questo endpoint per ridurre le transazioni non riuscite a causa di dati del documento non validi o errati.


## OpenAPI

````yaml openapi/it/localpayment.json POST /api/validation/document
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/validation/document:
    post:
      summary: Convalidare un documento d'identità
      operationId: validate-identity-document
      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).
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                country:
                  type: string
                  enum:
                    - ARG
                    - BOL
                    - BRA
                    - CHL
                    - COL
                    - CRI
                    - DOM
                    - GTM
                    - HND
                    - MEX
                    - PAN
                    - PRY
                    - PER
                  description: >-
                    [Paese del documento](/it/docs/global-coverage). ISO 3166-1
                    alpha-3.
                document:
                  type: object
                  description: Informazioni sul documento.
                  properties:
                    id:
                      type: string
                      description: >-
                        Identificatore del documento d'identità, di solito è un
                        numero.
                    type:
                      type: string
                      description: >-
                        Il [tipo di documento
                        d'identità](/it/reference/identity-document-types), che
                        varia a seconda del paese di emissione.
                  required:
                    - id
                    - type
              required:
                - country
                - document
            examples:
              200 - Valid id and type document.:
                value:
                  document:
                    id: '1791234561009'
                    type: RUC
                  country: ECU
              300 - Invalid params.:
                value:
                  country: ECU
                  document:
                    id: '12345'
                    type: RUC
              501 - Country not found.:
                value:
                  country: EC
                  document:
                    id: '1791234561009'
                    type: RUC
      responses:
        '200':
          description: Risposta condivisa
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Codice di stato.
                  description:
                    type: string
                    description: Dettagli aggiuntivi della risposta.
                x-examples:
                  Example 1:
                    code: '200'
                    description: Valid id and type document
              examples:
                200 - Valid id and type document.:
                  value:
                    code: '200'
                    description: Valid format of id and type document
        '400':
          description: Richiesta non valida.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Codice di stato.
                  description:
                    type: string
                    description: Dettagli aggiuntivi della risposta.
              examples:
                300 - Invalid param.:
                  value:
                    code: '300'
                    description: >-
                      Invalid param + [document.id] + doesn´t match regex
                      ^[0-9]{13}$
        '401':
          description: Non autorizzato.
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: Informazioni aggiuntive della risposta.
                  code:
                    type: string
                    description: Codice di stato.
                  messages:
                    type: array
                    description: Elenco dei messaggi.
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Classe del token.
                        token_type:
                          type: string
                          description: Tipo di token.
                        message:
                          type: string
                          description: Messaggio con informazioni aggiuntive.
                x-examples:
                  Example 1:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
              examples:
                401 - Token is invalid or expired:
                  value:
                    detail: Given token not valid for any token type
                    code: token_not_valid
                    messages:
                      - token_class: AccessToken
                        token_type: access
                        message: Token is invalid or expired
        '501':
          description: Richiesta non valida.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Codice di stato.
                  description:
                    type: string
                    description: Dettagli aggiuntivi della risposta.
              examples:
                501 - Country not found.:
                  value:
                    code: '501'
                    description: Country not found
      security:
        - token: []
      servers:
        - url: https://api.stage.localpayment.com
          description: Stage
components:
  securitySchemes:
    token:
      type: http
      scheme: bearer

````

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