# 上传业务数据

### 接口概述

该接口用于向系统上传业务数据。数据以 JSON 格式传输。

* **请求方式**：`POST`
* **请求 URL**：`https://openapi.elven.com/open/v3/businessData`
* **Content-Type**：`application/json`

### 请求头参数

<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 参数（JSON 格式）

<table><thead><tr><th width="246">参数名</th><th width="85">类型</th><th width="62">必填</th><th>说明</th></tr></thead><tbody><tr><td>businessDataTypeName</td><td>String</td><td>是</td><td>业务数据类型名称，需在系统中已创建</td></tr><tr><td>businessDataSourceName</td><td>String</td><td>是</td><td>业务数据来源名称，未创建则自动创建，类型为 <code>openapi</code></td></tr><tr><td>type</td><td>String</td><td>否</td><td>数据类型，TRANSACTION 为业务交易数据，BALANCE业务余额数据，不传默认为 TRANSACTION</td></tr><tr><td>balanceTransformer</td><td>Object</td><td>否</td><td>业务余额字段类型的识别规则</td></tr><tr><td>businessDataList</td><td>Array</td><td>是</td><td>业务数据列表，每个元素为一个业务数据对象</td></tr></tbody></table>

**balanceTransformer**

定义业务余额数据类型的识别规则，只需要在第一次导入业务余额数据时必传

**示例：**

```json
{ 
    "datetimeColumn": 1, 
    "timezone": "UTC", 
    "currencyColumn": 4, 
    "amountColumn": 8, 
    "auxiliaryTypeName": "User", 
    "auxiliaryValueColumn": 0 
} 
```

<table><thead><tr><th width="246">参数名</th><th width="79">必填</th><th>说明</th></tr></thead><tbody><tr><td>datetimeColumn</td><td>是</td><td>businessDataList下时间字段的下标</td></tr><tr><td>timezone</td><td>是</td><td>业务余额数据中时间对应的时区 <a href="/pages/aGo8tOlAb3LVWBUj7oNv">具体介绍</a></td></tr><tr><td>currencyColumn</td><td>是</td><td>businessDataList币种字段的下标</td></tr><tr><td>amountColumn</td><td>是</td><td>businessDataList币种数量字段的下标</td></tr><tr><td>auxiliaryTypeName</td><td>否</td><td>辅助核算字段名称，请先在系统创建辅助核算类型</td></tr><tr><td>auxiliaryValueColumn</td><td>否</td><td>businessDataList辅助核算字段的下标</td></tr></tbody></table>

**businessDataList 数组元素**

`businessDataList` 中的每个元素都是一个 JSON 对象，包含您的业务数据字段。

**示例：**

```json
[
    {"a": 100, "b": "buy", "c": "2024-07-01 22:33:44"},
    {"a": 100, "b": "sell", "c": "2024-07-01 23:33:44"},
    {"a": 100, "b": "buy", "c": "2024-07-02 06:33:44"}
]
```

#### 请求示例

```json
{
    "businessDataTypeName": "Settlement",
    "businessDataSourceName": "Settlement-2024-07",
    "businessDataList": [
        {"a": 100, "b": "buy", "c": "2024-07-01 22:33:44"},
        {"a": 100, "b": "sell", "c": "2024-07-01 23:33:44"},
        {"a": 100, "b": "buy", "c": "2024-07-02 06:33:44"}
    ]
}
```

### 响应参数

| 参数名     | 类型      | 说明       |
| ------- | ------- | -------- |
| success | Boolean | 上传任务是否成功 |

#### 响应示例

```json
{
    "success": true
}
```

### 在线调试

您可以通过 Apifox 服务进行接口的在线调试：<https://zswsuv3jhf.apifox.cn/api-253901224>

### 注意事项

* **数据大小限制**：请求体的数据大小限制为 **100KB**。如果超过 100KB，请减少 `businessDataList` 中的数据条数，或者联系 Elven 获取帮助。
* **Content-Type**：请求必须使用 `application/json` 作为 Content-Type。
* **业务数据类型**：请确保提供的 `businessDataTypeName` 已经在系统中创建。
* **业务数据来源**：`businessDataSourceName` 如果不存在，将自动创建，类型为 `openapi`。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.elven.com/v3/chinese/openapi/v3/shang-chuan-ye-wu-shu-ju.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
