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

# 验证身份文件

按国家/地区和类型验证客户身份证明文件，确保格式正确。使用此接口可减少因文件信息无效或错误而导致的交易失败。


## OpenAPI

````yaml openapi/zh/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: 验证身份文件
      operationId: validate-identity-document
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。
          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: '[文件国家](/zh/docs/global-coverage)。ISO 3166-1 alpha-3。'
                document:
                  type: object
                  description: 文件信息。
                  properties:
                    id:
                      type: string
                      description: 身份证件标识符，通常为数字。
                    type:
                      type: string
                      description: >-
                        [身份证明文件类型](/zh/reference/identity-document-types)，因签发国家/地区而异。
                  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: 共享响应
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: 状态码。
                  description:
                    type: string
                    description: 更多回复详情。
                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: 错误的请求。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: 状态码。
                  description:
                    type: string
                    description: 更多回复详情。
              examples:
                300 - Invalid param.:
                  value:
                    code: '300'
                    description: >-
                      Invalid param + [document.id] + doesn´t match regex
                      ^[0-9]{13}$
        '401':
          description: 未经授权。
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                    description: 回复的补充信息。
                  code:
                    type: string
                    description: 状态码。
                  messages:
                    type: array
                    description: 消息列表。
                    items:
                      type: object
                      properties:
                        token_class:
                          type: string
                          description: Token 类。
                        token_type:
                          type: string
                          description: 令牌类型。
                        message:
                          type: string
                          description: 包含补充信息的消息。
                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: 错误的请求。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: 状态码。
                  description:
                    type: string
                    description: 更多回复详情。
              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.