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

# 跟踪审核并修复驳回

> 申请对实体进行 KYC/KYB 审核，查看审核结果，并按 Localpayment 的要求更正内容。

当实体已具备其数据和文件后，您通过[申请验证](https://docs.localpayment.com/zh/reference/request-entity-verification.md)来申请审核；您无法自行批准。Localpayment 合规部门会对每个文件和该实体作出决定。您无需等待结果，也无需轮询该实体。当有内容需要更改时，合规部门会告知您需要更改什么以及原因，您更正后再次申请验证即可。如果您想跟踪结果，请使用[获取 KYC 状态](https://docs.localpayment.com/zh/reference/get-kyc-status.md)和[获取状态历史](https://docs.localpayment.com/zh/reference/get-entity-status-history.md)。

## 先决条件

* 已上传文档和文件的实体。请参阅[上传文档和证明](https://docs.localpayment.com/zh/docs/upload-documents-and-proofs.md)。
* 对于公司而言，每个所有者都与其自己的文档和文件相关联。请参阅[管理最终受益所有人](https://docs.localpayment.com/zh/docs/manage-ubos.md)。

## 谁负责做什么

```mermaid theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'primaryColor': '#31467c', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#0c1a29', 'secondaryColor': '#31467c', 'tertiaryColor': '#ffffff', 'lineColor': '#0c1a29', 'textColor': '#0c1a29', 'edgeLabelBackground': '#ffffff', 'fontFamily': 'Manrope'}, 'fontFamily': 'Manrope', 'htmlLabels': false, 'flowchart': {'htmlLabels': false, 'wrappingWidth': 400, 'padding': 20}}}%%
flowchart TD
    A["您的后端<br/>GET /api/entity/v1/entities/{entityId}/kyc-status"] --> B["Entities API<br/>documentationStatus COMPLETE"]:::lp
    B --> V["您的后端<br/>请求审核<br/>POST /api/entity/v1/entities/{entityId}/verify"]
    V --> C["Entities API<br/>202 Accepted：实体处于 IN_REVIEW"]:::lp
    C --> D["Localpayment 合规团队<br/>逐项审核证明材料：APPROVED 或 REJECTED，并附原因"]:::lp
    D --> E["Localpayment 合规团队<br/>处理该实体：ACTIVE、REJECTED，或退回 PENDING_KYC 以便更正"]:::lp
    E --> F["您的后端（可选）<br/>GET /api/entity/v1/entities/{entityId}/kyc-status<br/>用于跟踪结果"]
    F --> G["您的后端<br/>GET /api/entity/v1/entities/{entityId}/status-history<br/>每次变更及其操作人和原因"]
    classDef default fill:#31467c,stroke:#0c1a29,stroke-width:1px,color:#ffffff,font-family:Manrope
    classDef lp fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef terminal fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef lbl fill:#0c1a29,stroke:#0c1a29,color:#ffffff,font-size:13px
```

> [!NOTE]
>
> 您无需轮询该实体。实体不提供状态变更 webhook；如果您想跟踪审核进度，请以合理的间隔调用获取 KYC 状态，例如在实体处于 `IN_REVIEW` 期间每隔几分钟调用一次。

## 审查之前

* 每份文档均已有其文件：在获取 KYC 状态中，`documentationStatus` 为 `COMPLETE`。
* 对于公司而言，每个所有者都已关联，并拥有自己的文档和文件。
* 至少已上传一个文件；否则 `verify` 会返回 422 `NO_PROOFS_UPLOADED`。

当实体处于 `IN_REVIEW` 状态时，它会被锁定：您无法编辑其数据、添加或编辑文档、上传或删除文件，也无法关联、更改或终止 UBO（409 `ENTITY_IN_REVIEW`）。

## 查看 KYC 状态

当实体处于 `IN_REVIEW` 状态，且合规部门已批准两个文件之后：

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "entityId": "5aced5da-40c1-4bec-85ff-c8cd1bcb4526",
  "status": "IN_REVIEW",
  "documentationStatus": "COMPLETE",
  "statusReason": "Review started",
  "documents": [
    {
      "documentId": "2e16d844-4fa9-4295-9a21-83ec32ef241a",
      "type": "CPF",
      "status": "VERIFIED",
      "proofs": [
        {
          "proofId": "2c4c2f74-7179-4113-83fb-f11dbce9e07d",
          "verificationStatus": "APPROVED"
        }
      ]
    },
    {
      "documentId": "e0ea9515-442e-4bc5-bc82-b8d278255c37",
      "type": "PROOF_OF_ADDRESS",
      "status": "VERIFIED",
      "proofs": [
        {
          "proofId": "acb78b3f-fe18-4094-b6a9-2107f502d709",
          "verificationStatus": "APPROVED"
        }
      ]
    }
  ]
}
```

| 字段 | 如何阅读它 |
| - | - |
| status | 实体的生命周期状态。目标是 ACTIVE。 |
| statusReason | 上次状态变更的原因。当实体重新回到 PENDING\_KYC 状态时，它会说明需要更正的内容。 |
| documentationStatus | 仅涵盖文件。审核前，COMPLETE 且证明材料仍为 PENDING 属于正常情况。 |
| documents\[].status | 当其所有有效证明均为 APPROVED 时为 VERIFIED；只要有任何一项被拒绝则为 REJECTED；如果已超过声明的有效期则为 EXPIRED。 |
| documents\[].proofs\[].verificationStatus | 由 Localpayment 设置，依次为 PENDING、IN\_REVIEW，然后是 APPROVED 或 REJECTED。 |

如果您想跟踪审核，可使用以下 Python 轮询循环：

```python theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
import os
import time
import requests

BASE_URL = "https://api.stage.localpayment.com/api/entity"
access_token = os.environ["LOCALPAYMENT_ACCESS_TOKEN"]
entity_id = "5aced5da-40c1-4bec-85ff-c8cd1bcb4526"
headers = {"Authorization": f"Bearer {access_token}"}
last_reason = None

while True:
    response = requests.get(f"{BASE_URL}/v1/entities/{entity_id}/kyc-status", headers=headers, timeout=30)
    if response.status_code != 200:
        problem = response.json()
        raise RuntimeError(f"{problem.get('code')} correlationId={problem.get('correlationId')}")

    kyc = response.json()
    if kyc["status"] in ("ACTIVE", "REJECTED"):
        break

    if kyc["status"] == "PENDING_KYC" and kyc.get("statusReason") and kyc["statusReason"] != last_reason:
        # Correction requested: read statusReason and the verificationReason of each
        # rejected proof (GET /v1/proofs/{proofId}), then correct the data or upload
        # a replacement with the same proofType, then call POST .../verify again.
        last_reason = kyc["statusReason"]

    time.sleep(300)  # every 5 minutes
```

## 可能的结果

```mermaid theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
%%{init: {'theme': 'base', 'themeVariables': {'background': '#ffffff', 'primaryColor': '#31467c', 'primaryTextColor': '#ffffff', 'primaryBorderColor': '#0c1a29', 'secondaryColor': '#31467c', 'tertiaryColor': '#ffffff', 'lineColor': '#0c1a29', 'textColor': '#0c1a29', 'edgeLabelBackground': '#ffffff', 'fontFamily': 'Manrope'}, 'fontFamily': 'Manrope', 'htmlLabels': false, 'flowchart': {'htmlLabels': false, 'wrappingWidth': 400, 'padding': 20}}}%%
flowchart LR
    R["IN_REVIEW"]:::lp --> A{"合规决定"}
    A --- L1(["所有证明材料均已批准"]):::lbl --> OK["ACTIVE"]
    A --- L2(["要求更正"]):::lbl --> P["PENDING_KYC<br/>statusReason，以及证明材料上的 verificationReason"]
    P --> U["更正数据，或<br/>再次上传相同的 proofType，<br/>然后再次 POST .../verify"]
    U --> R
    A --- L3(["案件被拒绝"]):::lbl --> NO["REJECTED<br/>原因见状态历史"]
    OK --> B["合规团队之后可能会阻止或解除阻止"]
    classDef default fill:#31467c,stroke:#0c1a29,stroke-width:1px,color:#ffffff,font-family:Manrope
    classDef lp fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef terminal fill:#0c1a29,stroke:#0c1a29,color:#ffffff
    classDef lbl fill:#0c1a29,stroke:#0c1a29,color:#ffffff,font-size:13px
```

* **已批准：** 实体变为 `ACTIVE`。
* **要求更正：** 实体返回 `PENDING_KYC`，原因记录在 `statusReason` 中，每个被驳回的文件都带有各自的 `verificationReason`。请使用相同的 `proofType` 上传替换文件，或更正数据，然后再次调用[申请验证](https://docs.localpayment.com/zh/reference/request-entity-verification.md)。
* **已拒绝：** 实体变为 `REJECTED`，原因记录在状态历史中。`REJECTED` 的实体无法再次提交：请使用新的 `externalId` 注册新实体，或联系您的客户经理。

审批后的状态历史记录，包括每次更改、更改者以及更改原因：

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
[
  {
    "fromStatus": "PENDING_KYC",
    "toStatus": "IN_REVIEW",
    "reason": "Review started",
    "changedBy": "12345",
    "correlationId": "b68165b9-1d60-4f9d-9919-7fee12411714",
    "createdAt": "2024-01-15T17:03:15Z"
  },
  {
    "fromStatus": "IN_REVIEW",
    "toStatus": "ACTIVE",
    "reason": "KYC approved",
    "changedBy": "67890",
    "correlationId": "b07a3416-11fb-48d8-8671-be471694f0a2",
    "createdAt": "2024-01-15T17:03:22Z"
  }
]
```

## 要记住的规则

* 您通过 `verify` 申请审核；批准或拒绝仅由 Localpayment 决定。
* 审批后编辑实体数据不会更改已记录的审核。编辑文档会将其已批准的文件重置为 `PENDING`，并重新进行审核。
* `BLOCKED` 以及恢复为 `ACTIVE` 均由合规部门决定。您可以在状态历史记录中查看它们及其原因。

## 下一步

> [card] [管理最终受益所有人](https://docs.localpayment.com/zh/docs/manage-ubos.md)
>
> 对于公司而言：关联受益所有人。

> [card] [实体状态和错误代码](https://docs.localpayment.com/zh/reference/entity-statuses-and-error-codes.md)
>
> 所有状态、转换和错误代码。


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