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

# 上传证明

上传支持已声明文档的文件（身份证件图像、地址证明 PDF、公司章程）。证明将以 verificationStatus: PENDING 状态创建并加密存储；Localpayment 会对其进行审核。上传所有文件后，请调用 Request Verification。

* 每个文档的文件数。一个文档可以包含您所需数量的证明：身份证件的正面、背面和自拍照，合同的各页，收据。每个文档 id 的文件数量没有限制。
* 替换。FRONT、BACK 和 SELFIE 各自只有一个当前文件：再次上传相同类型会替换先前的文件，后者将变为 SUPERSEDED。DOCUMENT 和 OTHER 会累积：每次上传都会新增一个文件（合同的各页、多张收据）。
* 已批准的文件会被保留。替换已为 APPROVED 的 FRONT、BACK 或 SELFIE 会返回 409 PROOF\_APPROVED。
* 审核期间。当实体处于 IN\_REVIEW 状态时，不能上传、替换或删除任何文件（409 ENTITY\_IN\_REVIEW）。
* 请检查响应中的 sizeBytes > 0：不含文件部分的 multipart 请求会存储一个空证明。
* 文件永远不会内联返回；请通过 Get a Proof 或 Download a Proof File 下载。

错误使用 `application/problem+json` 格式，并附带稳定的 `code`。完整目录：[实体状态和错误代码](https://docs.localpayment.com/zh/reference/entity-statuses-and-error-codes.md)。


## OpenAPI

````yaml openapi/zh/localpayment.json POST /api/entity/v1/documents/{docId}/proofs
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/documents/{docId}/proofs:
    post:
      summary: 上传证明
      operationId: upload-proof
      parameters:
        - name: Authorization
          in: header
          description: >-
            用于身份验证的 Bearer
            访问令牌。该令牌可从[获取访问令牌](/zh/reference/get-token)或[刷新访问令牌](/zh/reference/refresh-token)endpoint
            获取。系统将据此识别您的商户账户和执行操作的用户。
          required: true
          schema:
            type: string
            examples:
              - Bearer <your_access_token>
        - name: X-Correlation-ID
          in: header
          description: 跟踪标识符（UUID）。会在响应中原样返回；如未提供，则由 Localpayment 生成。
          required: false
          schema:
            type: string
            examples:
              - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
        - name: docId
          in: path
          description: 文件所属文档的 documentId。
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - e0ea9515-442e-4bc5-bc82-b8d278255c37
        - name: proofType
          in: query
          description: FRONT、BACK、SELFIE、DOCUMENT、OTHER。
          required: true
          schema:
            type: string
            examples:
              - FRONT
            enum:
              - FRONT
              - BACK
              - SELFIE
              - DOCUMENT
              - OTHER
        - name: metadata
          in: query
          description: 带有自由格式元数据的 URL 编码 JSON 对象，例如 %7B%22issuer%22%3A%22utility%22%7D。
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: JPG、PNG 或 PDF 格式，最大 10 MB。Multipart 部分名为 file。
                  examples:
                    - id_front.jpg
      responses:
        '201':
          description: 已创建。
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    examples:
                      - 2c4c2f74-7179-4113-83fb-f11dbce9e07d
                    description: 证明标识符（proofId）。
                  documentId:
                    type: string
                    examples:
                      - 2e16d844-4fa9-4295-9a21-83ec32ef241a
                    format: uuid
                    description: 该文件所佐证的文档。
                  proofType:
                    type: string
                    examples:
                      - FRONT
                    enum:
                      - FRONT
                      - BACK
                      - SELFIE
                      - DOCUMENT
                      - OTHER
                    description: FRONT、BACK、SELFIE、DOCUMENT、OTHER。
                  fileName:
                    type: string
                    examples:
                      - id_front.jpg
                    description: 已上传文件的元数据。上传后请检查 sizeBytes > 0。
                  mimeType:
                    type: string
                    examples:
                      - image/jpeg
                    description: 已上传文件的元数据。上传后请检查 sizeBytes > 0。
                  sizeBytes:
                    type: integer
                    examples:
                      - 102400
                    description: 已上传文件的元数据。上传后请检查 sizeBytes > 0。
                  verificationStatus:
                    type: string
                    examples:
                      - PENDING
                    enum:
                      - PENDING
                      - IN_REVIEW
                      - APPROVED
                      - REJECTED
                    description: PENDING、IN_REVIEW、APPROVED、REJECTED。由 Localpayment 合规部门设置。
                  verifiedBy:
                    type:
                      - string
                      - 'null'
                    description: 验证结果。拒绝时会填写 verificationReason。
                  verifiedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: 验证结果。拒绝时会填写 verificationReason。
                  verificationReason:
                    type:
                      - string
                      - 'null'
                    description: 验证结果。拒绝时会填写 verificationReason。
                  uploadedBy:
                    type: string
                    examples:
                      - '12345'
                    description: 您帐户中上传文件的用户（通过访问令牌）和上传时间。
                  uploadedAt:
                    type: string
                    examples:
                      - '2024-01-15T17:03:13Z'
                    format: date-time
                    description: 您帐户中上传文件的用户（通过访问令牌）和上传时间。
                  status:
                    type: string
                    examples:
                      - CURRENT
                    enum:
                      - CURRENT
                      - SUPERSEDED
                      - DELETED
                    description: >-
                      证明生命周期：CURRENT（有效）、SUPERSEDED（已被相同 proofType 的新上传证明替换）或
                      DELETED。与 verificationStatus 无关。
                  supersededAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: 证明被替换时设置。
                  supersededBy:
                    type:
                      - string
                      - 'null'
                    description: 证明被替换时设置。
                  replacedByProofId:
                    type:
                      - string
                      - 'null'
                    format: uuid
                    description: 证明被替换时设置。
                  deletedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: 证明被删除时设置。
                  deletedBy:
                    type:
                      - string
                      - 'null'
                    description: 证明被删除时设置。
                  inVerification:
                    type: boolean
                    examples:
                      - false
                    description: 当证明文件属于正在进行的审核（实体 IN_REVIEW）时为 true；此时无法替换或删除。
              examples:
                Example 1:
                  value:
                    id: 2c4c2f74-7179-4113-83fb-f11dbce9e07d
                    documentId: 2e16d844-4fa9-4295-9a21-83ec32ef241a
                    proofType: FRONT
                    fileName: id_front.jpg
                    mimeType: image/jpeg
                    sizeBytes: 102400
                    verificationStatus: PENDING
                    verifiedBy: null
                    verifiedAt: null
                    verificationReason: null
                    uploadedBy: '12345'
                    uploadedAt: '2024-01-15T17:03:13Z'
                    status: CURRENT
                    supersededAt: null
                    supersededBy: null
                    replacedByProofId: null
                    deletedAt: null
                    deletedBy: null
                    inVerification: false
                Example 2 - PDF upload with metadata:
                  value:
                    id: 20d6aa56-73ce-4a52-95e2-903bc9971d08
                    documentId: 396809f2-f4b1-486a-a636-7cd7ad16073c
                    proofType: DOCUMENT
                    fileName: proof_of_address.pdf
                    mimeType: application/pdf
                    sizeBytes: 51200
                    verificationStatus: PENDING
                    verifiedBy: null
                    verifiedAt: null
                    verificationReason: null
                    uploadedBy: '12345'
                    uploadedAt: '2024-01-15T17:19:44Z'
                    status: CURRENT
                    supersededAt: null
                    supersededBy: null
                    replacedByProofId: null
                    deletedAt: null
                    deletedBy: null
                    inVerification: false
        '400':
          description: 错误请求。验证错误：缺少字段、标头、路径或查询参数，或者参数未知或无效。details[] 列出了字段和问题。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - VALIDATION_ERROR:
                  value:
                    type: about:blank
                    title: Validation error
                    status: 400
                    detail: >-
                      A field, header, path or query parameter is missing,
                      unknown or invalid. details[] lists field and issue.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: VALIDATION_ERROR
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details:
                      - field: externalId
                        issue: REQUIRED
        '401':
          description: 未授权。UNAUTHORIZED：缺少或无效的访问令牌。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    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/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: UNAUTHORIZED
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '404':
          description: 未找到。DOCUMENT_NOT_FOUND：该文档不存在、已被删除或属于其他商家。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - DOCUMENT_NOT_FOUND:
                  value:
                    type: about:blank
                    title: Not found
                    status: 404
                    detail: >-
                      The document does not exist, was deleted, or belongs to
                      another merchant.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: DOCUMENT_NOT_FOUND
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '409':
          description: >-
            冲突。ENTITY_IN_REVIEW：该实体处于 IN_REVIEW 状态：在 Localpayment
            合规团队处理完毕之前，其数据、文档、文件和 UBO 关联将被冻结。PROOF_APPROVED：该证明处于 APPROVED
            状态：无法替换或删除。ENTITY_NOT_EDITABLE：该实体处于 REJECTED、BLOCKED 或 CLOSED
            状态，或者该操作将删除主文档或唯一文档。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - ENTITY_IN_REVIEW:
                  value:
                    type: about:blank
                    title: Conflict
                    status: 409
                    detail: >-
                      The entity is IN_REVIEW: its data, documents, files and
                      UBO links are frozen until Localpayment Compliance
                      resolves it.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: ENTITY_IN_REVIEW
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
                Example 2 - PROOF_APPROVED:
                  value:
                    type: about:blank
                    title: Conflict
                    status: 409
                    detail: 'The proof is APPROVED: it cannot be replaced or deleted.'
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: PROOF_APPROVED
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
                Example 3 - ENTITY_NOT_EDITABLE:
                  value:
                    type: about:blank
                    title: Conflict
                    status: 409
                    detail: >-
                      The entity is REJECTED, BLOCKED or CLOSED, or the
                      operation would remove the primary document or the only
                      document.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: ENTITY_NOT_EDITABLE
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '413':
          description: 有效载荷过大。FILE_TOO_LARGE：上传的文件超过 10 MB。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - FILE_TOO_LARGE:
                  value:
                    type: about:blank
                    title: Payload too large
                    status: 413
                    detail: The uploaded file exceeds 10 MB.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: FILE_TOO_LARGE
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '415':
          description: 不支持的媒体类型。UNSUPPORTED_FILE_TYPE：上传的文件不是 JPG、PNG 或 PDF 格式。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - UNSUPPORTED_FILE_TYPE:
                  value:
                    type: about:blank
                    title: Unsupported media type
                    status: 415
                    detail: The uploaded file is not a JPG, PNG or PDF.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: UNSUPPORTED_FILE_TYPE
                    correlationId: 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                    details: []
        '502':
          description: 网关错误。STORAGE_WRITE_FAILED：文件无法存储。请重试上传。
          content:
            application/problem+json:
              schema:
                type: object
                description: RFC 9457 问题详情（application/problem+json）。
                properties:
                  type:
                    type: string
                    examples:
                      - about:blank
                  title:
                    type: string
                    description: 问题简述。
                  status:
                    type: integer
                    description: HTTP状态码。
                  detail:
                    type: string
                    description: 易于理解的解释。
                  instance:
                    type: string
                    description: 请求路径。
                  code:
                    type: string
                    description: 稳定的机器可读错误代码。根据此值进行分支。
                  correlationId:
                    type: string
                    format: uuid
                    description: 请求标识符。联系客服时请提供此标识符。
                    examples:
                      - 0e8f6a2c-5b3d-4c1e-9a7f-6d5e4c3b2a10
                  details:
                    type: array
                    description: 出错字段（如适用）。
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          examples:
                            - numberOfEmployees
                        issue:
                          type: string
                          examples:
                            - NOT_IN_OPTIONS
              examples:
                Example 1 - STORAGE_WRITE_FAILED:
                  value:
                    type: about:blank
                    title: Bad gateway
                    status: 502
                    detail: The file could not be stored. Retry the upload.
                    instance: >-
                      /api/entity/v1/documents/e0ea9515-442e-4bc5-bc82-b8d278255c37/proofs
                    code: STORAGE_WRITE_FAILED
                    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.