# 删除记账凭证接口

### 接口概述

该接口用于删除主体下已有的记账凭证，每次删除一条。

* **请求方式**：`DELETE`
* **请求 URL**：`https://openapi.elven.com/open/v4/journal`

### 请求头参数

<table><thead><tr><th width="202">参数名</th><th width="90">类型</th><th width="64">必填</th><th>说明</th></tr></thead><tbody><tr><td>elven-api-key</td><td>String</td><td>是</td><td>分配给您的API密钥</td></tr><tr><td>elven-api-sign</td><td>String</td><td>是</td><td>请求签名，用于验证请求合法性</td></tr><tr><td>elven-api-timestamp</td><td>String</td><td>是</td><td>请求时间戳，毫秒级</td></tr></tbody></table>

[查看详细说明](https://docs.elven.com/v3/openapi/jie-kou-shou-quan#elven-api-sign)

### Body参数

<table><thead><tr><th width="240.33203125">参数名</th><th width="94">类型</th><th width="64">必填</th><th>说明</th></tr></thead><tbody><tr><td>journalNo</td><td>String</td><td>是</td><td>要删除的数据源的sourceId</td></tr><tr><td>journalImportSourceName</td><td>String</td><td>否</td><td>Journal 所属的 Source 名称。若传入，则仅在该 Source 范围内删除；若不传，则不限制。</td></tr></tbody></table>

#### 请求示例

```json
{
    "journalNo":"abcde-00001",
    "journalImportSourceName":""
}
```

### 响应参数

<table><thead><tr><th width="209">参数名</th><th width="94">类型</th><th>说明</th></tr></thead><tbody><tr><td>status</td><td>String</td><td>请求状态，值为 “success” 或 “failed”</td></tr><tr><td>data</td><td>Object</td><td>返回的主要数据，如果成功删除将会返回删除数据的 <code>journalNo</code></td></tr><tr><td>requestId</td><td>String</td><td>请求的唯一标识符</td></tr></tbody></table>

#### 响应示例

```json
{
    "status": "success",
    "data": {
        "journalNo": "JN202508130003"
    },
    "requestId": "7e7e1d7c-0665-43d3-8f0e-7dd3b64438f8"
}
```

**注意事项**

1. **单次仅能删除 1 条 Journal**。
2. 被删除的 Journal 不可恢复，请谨慎调用。
3. 若同时提供 `journalNo` 与 `journalImportSourceName`，则系统仅在该 Source 范围内删除 Journal。
4. 系统会严格校验 Journal 状态，满足限制条件的 Journal 将拒绝删除并返回错误信息。
5. 操作会完整记录到安全日志，便于审计。

**错误信息**

<table><thead><tr><th width="320.12890625">错误原因</th><th>报错文案</th></tr></thead><tbody><tr><td><code>journalNo</code> 没有匹配到 Journal</td><td>No journal was matched for the provided Journal No.</td></tr><tr><td><code>journalNo</code> 匹配到多个 Journal</td><td>Multiple journals were matched for the provided Journal No.</td></tr><tr><td>匹配到已经在对账任务中匹配或者解释的 Journal</td><td>The journal is matched or explained in a reconciliation task and cannot be deleted.</td></tr><tr><td>匹配到已审核状态 Journal</td><td>The journal is approved and cannot be deleted.</td></tr><tr><td>匹配到 Valuation Automation 生成的 Journal</td><td>The journal was generated by valuation automation and cannot be deleted.</td></tr></tbody></table>
