> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 企业 CSV 批量导入导出：Didit 企业管理

> 通过 CSV 批量导入 Didit 企业（KYB）实体，并导出完整企业表。可在 Didit Business Console 中使用，按调用次数计费。



批量导入/导出企业提示词
        将提示词复制到剪贴板



      
      

\<pre>

\````# Goal — bulk-load (or extract) Didit Business entities programmatically

CSV import / export is console-only. For programmatic bulk operations, loop `POST /v3/businesses/create/` for imports and paginate `GET /v3/businesses/` for exports.

\## Bulk import — loop the create endpoint

\```bash
\# businesses.json — array of records
\# [{"vendor_data":"biz-acme","display_name":"Acme Corp","country_code":"GBR"}, ...]

jq -c '.[]' businesses.json | while read biz; do
curl -X POST https://verification.didit.me/v3/businesses/create/ \
-H "x-api-key: $DIDIT_API_KEY" \
-H "Content-Type: application/json" \
-d "$biz"
sleep 0.1   # respect rate limits — see /integration/rate-limiting
done
\```

Record shape (matches `POST /v3/businesses/create/`):

\```json
\{
"vendor_data": "biz-acme",         // required, unique per app
"display_name": "Acme Corp",       // optional
"country_code": "GBR",             // ISO 3166-1 alpha-3, optional
"metadata": {"partner": "Acme Holdings"},
"tags": ["b2b-tier-1"]
}
\```

\`create` is **not** idempotent. Upsert pattern:

\```bash
if curl -s -o /dev/null -w "%{http_code}" \
 https://verification.didit.me/v3/businesses/$VD/ \
 -H "x-api-key: $DIDIT_API_KEY" | grep -q 200; then
curl -X PATCH https://verification.didit.me/v3/businesses/$VD/ \
-H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" \
-d "$BODY"
else
curl -X POST https://verification.didit.me/v3/businesses/create/ \
-H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" \
-d "$BODY"
fi
\```

\## Bulk export — paginate the list endpoint

\```bash
PAGE=1
while :; do
RESP=$(curl -sG https://verification.didit.me/v3/businesses/ \
-H "x-api-key: $DIDIT_API_KEY" \
\--data-urlencode "page=$PAGE" \
\--data-urlencode "page_size=100")
echo "$RESP" | jq -c '.results[]' >> businesses.ndjson
HAS_NEXT=$(echo "$RESP" | jq -r '.next // empty')
\[ -z "$HAS_NEXT" ] && break
PAGE=$((PAGE+1))
done
\```

Filter with `status`, `country_code`, `search`, date ranges (see /management-api/businesses/list).

\## What survives on update vs what stays

\| Field | Behaviour |
\|---|---|
\| `display_name`, `metadata`, `tags` | Overwritten by PATCH |
\| `legal_name`, `registration_number`, `country_code` | Read-only after a verified KYB session (overrides logged in audit log) |
\| Aggregate counters, `features` map | Computed by Didit — never accept writes |

\## Failure modes

\- `409` on create — `vendor_data` exists; use PATCH.
\- `429` — rate limit; back off using `Retry-After`. Insert 100ms+ between calls for large batches.
\- `400` — bad country code or bad JSON. Log and continue.

\## Console fallback

The Business Console (Businesses → Import / Export) handles up to 100K rows for imports and 1M rows for exports with chunked async processing and an emailed signed download link.

\## Sources of truth

\- /management-api/businesses/create — POST /v3/businesses/create/ schema
\- /management-api/businesses/list — GET /v3/businesses/ pagination
\- /entities/businesses/data-model — mutable vs read-only fields
\- /integration/rate-limiting — rate limits
\- /integration/integration-prompt — canonical end-to-end prompt````

\</pre>



      
      

粘贴到

企业控制台支持批量导入和导出企业实体。流程与用户批量导入导出相同，但字段已针对企业进行调整。> [!NOTE]
>
> 此处的批量导入/导出仅创建或更新企业档案。它不会重建历史 KYB 会话、公司登记报告、高级管理人员、实际受益人或服务商决策。如需从其他服务商迁移完整的 KYB 数据，或导入公司登记数据导出文件，请参阅[从其他服务商导入数据](https://docs.didit.me/zh/sessions-api/import-verifications.md)。## 从 CSV 导入企业### 适用场景- 从其他 KYB 供应商**迁移**。
- **合作伙伴入驻**：加载合作伙伴的客户列表。
- **元数据回填**：批量更新大量企业的标签、等级或自定义字段。### 模板列从 *Businesses → Import → Download template* 下载模板：| 列名 | 是否必填 | 说明 |
| - | - | - |
| `vendor_data` | 是 | 您为该企业设定的标识符。在每个应用内唯一。 |
| `display_name` | 否 | 便于阅读的名称。 |
| `legal_name` | 否 | 企业法定名称。将被已验证的公司登记数据覆盖。 |
| `registration_number` | 否 | 公司注册号。将被已验证的公司登记数据覆盖。 |
| `country_code` | 否 | ISO 3166-1 alpha-3 格式。会触发危险国家/地区检查。 |
| `status` | 否 | `ACTIVE`、`FLAGGED` 或 `BLOCKED`。默认为 `ACTIVE`。 |
| `tags` | 否 | 以逗号分隔的标签。 |
| `metadata_json` | 否 | 用于自定义元数据的字符串化 JSON。 |### 执行导入**1. 上传 CSV***Businesses → Import → Upload CSV*。**2. 检查预览**无效行会被高亮显示。重复项（已存在的 `vendor_data`）会被标记为更新。**3. 开始导入**Didit 以异步方式处理各行数据；可在 *Businesses → Import history* 中查看进度。**4. 查看结果**下载被跳过行的错误报告。### 更新与创建- 新的 `vendor_data` → 创建新的企业。
- 已存在的 `vendor_data` → 更新该企业的可变字段和元数据。
- 在企业验证（KYB）会话填充公司登记衍生字段（`legal_name`、`registration_number`、`country_code`）后，导入**不会**覆盖这些字段。## 将企业导出为 CSV### 适用场景- **合规审计**及监管机构请求。
- 为商业智能分析进行**数据仓库同步**。
- **合作伙伴报告**：按国家/地区、等级或标签筛选企业视图。### 执行导出1) 进入 *Businesses → Export*。
2) 应用筛选条件（状态、国家/地区、日期范围、搜索、标签）。
3) 选择列。
4) 提交后，Didit 异步生成导出文件，并通过电子邮件向您发送带签名的下载链接。存在角色限制，请参阅[角色与权限](https://docs.didit.me/zh/console/roles-permissions.md)。## 审计日志所有导入和导出操作都会记录操作人、行数和时间戳。请参阅[审计日志](https://docs.didit.me/zh/console/audit-logs.md)。## 后续步骤> [card] [创建企业 API](https://docs.didit.me/zh/management-api/businesses/create.md)
>
> 以编程方式批量创建。> [card] [数据保留](https://docs.didit.me/zh/console/data-retention.md)
>
> 导入的数据会保留多久。> [card] [审计日志](https://docs.didit.me/zh/console/audit-logs.md)
>
> 查看导入和导出历史。


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