> For the complete documentation index, see [llms.txt](https://docs-kr.verifyvasp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-kr.verifyvasp.com/reference/enclave-api-reference/v1/error-report-api.md).

# 에러 상황 리포트 API

## 에러 리포트

<mark style="color:green;">`POST`</mark> `http://<enclave-endpoint>/v1/verifications/error`

> Beneficiary VASP에 실패 결과를 리포트 하기 위한 API입니다.
>
> 예를 들어, Verification 은 성공적으로 이뤄졌지만, 자체적인 이슈 (e.g. Sanction list에 Beneficiary가 속해 있다거나 등) 가 있어 트랜잭션을 영구적으로 전송하지 않기로 결정한 경우 Beneficiary VASP 와 에러 상황을 공유해야 합니다.

{% hint style="info" %}
**호출 정책**

* 송신 VASP는 실제 가상 자산 거래를 영구히 하지 않기로 결정하자마자 이 API를 통해 VerifyVASP에 에러 상황을 보고해야 합니다.
* 그래야 수신 VASP에서 특정 사용자 검증(verification)에 대한 트랜잭션 상태 문의를 할 필요가 없다는 것을 즉각 알 수 있습니다.
  {% endhint %}

## Request Body

<details>

<summary>Request Body Examples</summary>

```json
{
  "result": "DENIED",
  "reason": "BLACKLISTED",
  "message": "Beneficiary person is in blacklist.",
  "verificationUuid": "8557f2b2-985e-431f-8d52-75c2e5a01e46"
}
```

</details>

| Field Name         | Data Type | Required                               | Example      | Description                                             |
| ------------------ | --------- | -------------------------------------- | ------------ | ------------------------------------------------------- |
| result             | string    | true                                   | “VERIFIED”   | 사용자 검증 수행 결과. (하단 설명 참조)                                |
| reason             | string    | true                                   | “OK”         | 검증이 실패한 경우에 그 이유를 나타내는 에러 코드 (하단 설명 참조). 성공적인 경우에는 "OK" |
| message            | string    | false                                  | -            | 각 에러 코드에 대한 추가적인 메시지 (하단 설명 참조)                         |
| verificationUuid\* | string    | "64ab871b-14a3-47df-9b80-368e29fe8180" | 사용자 검증 요청 ID |                                                         |

* <mark style="color:blue;">**reason**</mark> 필드에는 다음과 같은 값이 들어갈 수 있습니다.

  * 단, 사용자 검증 요청에 대한 결과 `result` 필드의 값이 **DENIED** 일 때에만 유효합니다.
  * `message` 필드에는, 아래 표에 설명된 값을 string으로 전달합니다. (하단 표 내용 참조)

  | <p>reason</p><p>(string)</p> | <p>result</p><p>(string)</p> | <p>message</p><p>(string)</p>    | Description                                       |
  | ---------------------------- | ---------------------------- | -------------------------------- | ------------------------------------------------- |
  | `UNKNOWN-SYMBOL`             | DENIED                       | 해당 VASP에서 취급하지 않는다고 판명된 심벌 이름    | 거래소에서 취급하지 않는 심벌일 경우 (VASP가 취급하지 않는 자산일 경우)       |
  | `UNKNOWN-NETWORK`            | DENIED                       | 해당 VASP에서 취급하지 않는다고 판명된 네트워크 이름  | 거래소에서 취급하지 않는 네트워크일 경우 (심벌은 동일하지만 네트워크가 맞지 않는 경우) |
  | `UNKNOWN-ADDRESS`            | DENIED                       | 해당 VASP 소유의 주소가 아니라고 판명된 지갑 주소   | 가상 자산 주소가 해당 VASP의 주소가 아닌 경우                      |
  | `LACK-OF-INFORMATION`        | DENIED                       | 부족한 개인 정보 필드 코드 목록 (쉼표로 구분)      | 상대방 사용자의 정보가 검증을 수행하기에 부족한 경우                     |
  | `UNAVAILABLE-INFORMATION`    | DENIED                       | 넘겨줄 수 없는 개인 정보 필드 코드 목록 (쉼표로 구분) | 상대방이 요청한 개인 정보가 없거나 넘겨줄 수 없는 경우                   |
  | `BLACKLISTED`                | DENIED                       | -                                | 상대방 사용자에 대한 sanction screening 결과 문제가 있는 경우       |
  | `UNVERIFIED-KYC`             | DENIED                       | -                                | 자신의 VASP의 해당 사용자가 KYC 인증이 되어 있지 않은 경우             |
  | `MISMATCHED-NAME`            | DENIED                       | -                                | 수신자의 이름이 송신 VASP에서 보내준 이름과 일치하지 않는 경우             |
  | `NOT-ALLOWED`                | DENIED                       | 거부 사유                            | 송신 VASP에서 어떤 이유로든 해당 사용자의 출금 요청을 거부한 경우           |
  | `UNDEFINED-ERROR`            | DENIED                       | 에러 내용                            | 그 밖에, 따로 정의되어 있지 않은 에러가 발생한 경우                    |

## Response Body

### 성공 케이스

<details>

<summary>Response Body Examples</summary>

* 200 OK

```json
{
  "result": true
}
```

</details>

| Field Name | Data Type | Required | Description                    |
| ---------- | --------- | -------- | ------------------------------ |
| result     | boolean   | true     | Beneficiary VASP에 에러 리포팅 완료 여부 |

### 실패 케이스

#### 필수 파라미터를 입력하지 않은 경우

<details>

<summary>Response Body Examples</summary>

* 400 Bad Request

```json
{
  "code": "MISSING-RESULT",
  "message": "`result` is required."
}
```

</details>

#### 파라미터에 잘못된 값을 입력했을 경우

<details>

<summary>Response Body Examples</summary>

* 400 Bad Request

```json
{
  "code": "INVALID-RESULT",
  "message": "`result` should be one of 'VERIFIED', 'DENIED', 'ERROR'."
}
```

</details>

#### 존재하지 않는 verification uuid를 입력한 경우

<details>

<summary>Response Body Examples</summary>

* 400 Bad Request

```json
{
  "code": "VERIFICATION-NOT-FOUND",
  "message": "Verification(9faab87c-54a6-4145-baa9-7a3a42d7410c) is not found"
}
```

</details>
