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

# 创建企业 API：供应商 KYB 实体

> 在 KYB 会话运行前预先创建 Didit 企业（KYB）实体。可从外部数据库批量导入，或登记用于交易监控。



创建企业提示词
        将提示词复制到剪贴板



      
      

\<pre>

\`Goal: Pre-create a Didit Business (KYB) entity by vendor_data before any KYB session runs.

Endpoint: POST https://verification.didit.me/v3/businesses/create/
Auth header: x-api-key: <DIDIT_API_KEY>
Content-Type: application/json

Request body fields:
\- vendor_data (string, REQUIRED) — your unique identifier. Free-form string, NOT a UUID. Must be unique among non-deleted businesses for the app. Normalised lowercase + whitespace trim ("COMPANY-1" and "company-1" collide).
\- display_name (string, nullable) — friendly display name shown in Console (takes precedence over legal_name).
\- legal_name (string, nullable)
\- registration_number (string, nullable)
\- country_code (string, nullable) — country of incorporation, ISO 3166-1 alpha-2 (e.g. "GB", "US").
\- region (string, nullable) — ISO 3166-2 subdivision code.
\- status (enum) — "ACTIVE" | "FLAGGED" | "BLOCKED" (VendorBusinessStatusChoices). Defaults to "ACTIVE".
\- metadata (object, nullable) — arbitrary JSON.

curl:
curl -X POST 'https://verification.didit.me/v3/businesses/create/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"vendor_data": "company-456", "legal_name": "New Corp Ltd", "country_code": "US"}'

Response 201: full BusinessDetailItem (same shape as GET /v3/businesses/{vendor_data}/). Includes didit_internal_id (UUID), session_count=0, metadata, comments=[], created_at, updated_at. See /reference/data-models.

Failure modes (envelope {"detail": "..."} for auth):
\- 400 — validation errors keyed by field. Common cases:
\{ "vendor_data": ["A business with this vendor_data already exists."] }  // NOT idempotent — use PATCH /v3/businesses/{vendor_data}/ to update.
\{ "vendor_data": ["This field is required."] }
\{ "metadata": ["Metadata must be a JSON object."] }
\- 401 — missing/invalid x-api-key.
\- 403 — lacks create:businesses.
\- 429 — rate-limited.

Upsert pattern (NOT idempotent on vendor_data):
GET /v3/businesses/{vendor_data}/  → on 404, POST /v3/businesses/create/; on 200, PATCH /v3/businesses/{vendor_data}/.

Notes:
\- Registry-derived fields (legal_name, registration_number, country_code) can be seeded here but will be OVERWRITTEN by the first approved Business Verification (KYB) session's registry data.
\- last_activity_at is set at the moment of creation.

For end-to-end Didit integration, paste in the full prompt at /integration/integration-prompt.`

\</pre>



      
      

粘贴到

## 概述在任何企业验证（KYB）会话开始之前，显式创建一个[企业实体](https://docs.didit.me/zh/entities/businesses/overview.md)。## 适用场景- **预先写入元数据**（合作伙伴、等级、内部标识符），然后再发起首次企业验证（KYB）会话。
- **迁移**：从其他 KYB 供应商迁入现有企业名册。
- **仅交易登记**：为通过线下流程完成验证的企业提交交易。## 注意事项- `vendor_data` 为必填项，且在每个应用内唯一。重复提交会返回冲突错误。如需更新，请使用 [`PATCH /v3/businesses/{vendor_data}/`](https://docs.didit.me/zh/management-api/businesses/update)。
- 基于公司登记信息的字段（`legal_name`、`registration_number`、`country_code`）可以预先填写，但会被首次通过的企业验证（KYB）会话中的公司登记数据**覆盖**。
- 如果 `country_code` 与你应用的[高风险国家/地区](https://docs.didit.me/zh/entities/businesses/blocklist.md#危险国家/地区)列表匹配，该企业将以 `BLOCKED` 状态创建。
- 会触发 `business.data.updated`。## 权限角色必须具有 `create:businesses` 权限。## 相关内容- [企业数据模型](https://docs.didit.me/zh/entities/businesses/data-model.md)
- [供应商数据关联](https://docs.didit.me/zh/entities/vendor-data-linking.md)
- [企业操作](https://docs.didit.me/zh/entities/businesses/operations.md)


## OpenAPI

````yaml zh/openapi-25.json POST /v3/businesses/create/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 身份证件验证 API。使用 x-api-key 请求头进行身份验证。
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/businesses/create/:
    post:
      tags:
        - Businesses
      summary: 创建企业
      description: >-
        预先创建[企业](/entities/businesses)（*不*包含 KYB 会话）。所有字段均为可选，但您应始终发送
        `vendor_data`，若缺少该字段，该记录将无法与会话或交易关联。提供时，`vendor_data`
        在未删除的企业中必须唯一（精确匹配；冲突将返回 400）。非幂等。
      operationId: create_business
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                vendor_data:
                  type: string
                  nullable: true
                  description: >-
                    您对此企业的唯一标识符（自由格式字符串，非
                    UUID）。可选但强烈建议提供。提供时，在该应用中未删除的企业之间必须唯一；按发送的内容精确匹配。
                display_name:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: 控制台中显示的易读显示名称（在界面显示时优先级高于 `legal_name`）。
                legal_name:
                  type: string
                  nullable: true
                  maxLength: 255
                  description: 企业的官方法定名称。
                registration_number:
                  type: string
                  nullable: true
                  maxLength: 100
                  description: 企业注册号或成立号。
                country_code:
                  type: string
                  nullable: true
                  maxLength: 10
                  description: 注册国家/地区（ISO 3166-1 alpha-2，例如 `GB`、`US`）。
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - FLAGGED
                    - BLOCKED
                  default: ACTIVE
                  description: 初始生命周期状态。默认为 `ACTIVE`。
                metadata:
                  type: object
                  nullable: true
                  description: 附加到企业的任意 JSON 对象。默认为 `{}`。
            examples:
              Basic:
                summary: 建议的最小值
                value:
                  vendor_data: company-456
                  legal_name: New Corp Ltd
                  country_code: US
              Full:
                summary: 所有字段
                value:
                  vendor_data: company-789
                  display_name: New Corp
                  legal_name: New Corp International Ltd
                  registration_number: '98765432'
                  country_code: DE
                  status: ACTIVE
                  metadata:
                    industry: fintech
                    tier: enterprise
      responses:
        '201':
          description: 企业已创建。返回完整企业记录（数据结构与获取企业相同）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDetailItem'
              examples:
                Created:
                  value:
                    didit_internal_id: a1b2c3d4-e5f6-4890-abcd-ef1234567890
                    vendor_data: company-456
                    display_name: null
                    legal_name: New Corp Ltd
                    registration_number: null
                    country_code: US
                    effective_name: New Corp Ltd
                    status: ACTIVE
                    session_count: 0
                    approved_count: 0
                    declined_count: 0
                    in_review_count: 0
                    features: {}
                    features_list: []
                    last_session_at: null
                    last_activity_at: '2026-03-15T10:30:00Z'
                    first_session_at: null
                    tags: []
                    created_at: '2026-03-15T10:30:00Z'
                    metadata: {}
                    updated_at: '2026-03-15T10:30:00Z'
        '400':
          description: 无效的请求体，通常是重复的 `vendor_data`、未知的 `status` 或格式错误的 `metadata`。
          content:
            application/json:
              examples:
                Duplicate:
                  value:
                    vendor_data:
                      - A business with this vendor_data already exists.
                Bad status:
                  value:
                    status:
                      - >-
                        Invalid status. Valid options are: ACTIVE, FLAGGED,
                        BLOCKED
                Bad metadata:
                  value:
                    metadata:
                      - Metadata must be a JSON object.
        '403':
          description: API 密钥缺失、无效或已撤销，或者该密钥无法为此应用创建企业。缺少密钥返回 `403`；错误、已撤销或已过期的密钥返回 `401`。
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '429':
          description: 超出速率限制；请退避并在 `Retry-After` 指定的间隔后重试。
          content:
            application/json:
              examples:
                Rate limited:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: |-
            curl -X POST 'https://verification.didit.me/v3/businesses/create/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"vendor_data": "company-456", "legal_name": "New Corp Ltd", "country_code": "US"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.businesses.create(
                vendor_data="company-456",
                legal_name="New Corp Ltd",
                country_code="US",
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY.
            const didit = new Didit();

            const result = await didit.businesses.create({
              vendor_data: "company-456",
              legal_name: "New Corp Ltd",
              country_code: "US",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Businesses.Create(ctx, didit.BusinessesCreateParams{\n\tVendorData:  didit.String(\"company-456\"),\n\tLegalName:   didit.String(\"New Corp Ltd\"),\n\tCountryCode: didit.String(\"US\"),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.BusinessesCreateParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.businesses().create(BusinessesCreateParams.builder()
                    .vendorData("company-456")
                    .legalName("New Corp Ltd")
                    .countryCode("US")
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY.
            $didit = new DiditClient();

            $result = $didit->businesses->create([
                'vendor_data' => 'company-456',
                'legal_name' => 'New Corp Ltd',
                'country_code' => 'US',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.businesses.create(
              vendor_data: "company-456",
              legal_name: "New Corp Ltd",
              country_code: "US"
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await client.Businesses.CreateAsync(new
            BusinessesCreateParams

            {
                VendorData = "company-456",
                LegalName = "New Corp Ltd",
                CountryCode = "US",
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    BusinessDetailItem:
      type: object
      description: 完整企业详情。在 BusinessListItem 基础上扩展了元数据和 updated_at。
      allOf:
        - $ref: '#/components/schemas/BusinessListItem'
        - type: object
          properties:
            metadata:
              type: object
              description: 您附加到此企业的自定义元数据 JSON。默认为 `{}`。
            updated_at:
              type: string
              format: date-time
    BusinessListItem:
      type: object
      description: 已验证的企业。
      properties:
        didit_internal_id:
          type: string
          format: uuid
          description: Didit 为此企业分配的稳定内部 UUID。
        vendor_data:
          type: string
          nullable: true
          description: 您对此企业的唯一标识符（创建会话时传入）。未提供供应商标识符时可为 null。
        display_name:
          type: string
          nullable: true
          description: 您设置的自定义显示名称
        legal_name:
          type: string
          nullable: true
          description: 来自登记处或手动输入的官方法定名称
        registration_number:
          type: string
          nullable: true
          description: 企业注册号或成立号
        country_code:
          type: string
          nullable: true
          description: 注册国家/地区（ISO 3166-1 alpha-2，例如 `GB`、`US`）。
        effective_name:
          type: string
          nullable: true
          description: 最佳可用名称：如果已设置则为 display_name，否则为 legal_name
        status:
          type: string
          enum:
            - ACTIVE
            - FLAGGED
            - BLOCKED
          description: >-
            企业记录的生命周期状态（并非会话状态）。`ACTIVE` 为默认值，`FLAGGED` 标记为需要人工关注，`BLOCKED` 会阻止该
            `vendor_data` 创建新会话。
        session_count:
          type: integer
          description: 该企业的验证会话总数
        approved_count:
          type: integer
          description: 已通过的会话数量
        declined_count:
          type: integer
          description: 已拒绝的会话数量
        in_review_count:
          type: integer
          description: 审核中的会话数量
        features:
          type: object
          description: >-
            该企业所有 KYB 会话的每项功能汇总状态。目前唯一的键为
            `KYB`（公司登记核验状态）。可选值：`Approved`、`Declined`、`In Review`、`Not
            Finished`、`Resub Requested`。
        features_list:
          type: array
          items:
            type: object
            properties:
              feature:
                type: string
              status:
                type: string
          description: 与 `features` 相同的数据，为 `{feature, status}` 对象的有序数组。
        last_session_at:
          type: string
          format: date-time
          nullable: true
          description: 最近一次会话的时间戳
        first_session_at:
          type: string
          format: date-time
          nullable: true
          description: 首次会话的时间戳
        last_activity_at:
          type: string
          format: date-time
          nullable: true
          description: 最近一次活动的时间戳（状态变更、会话更新等）
        tags:
          type: array
          items:
            type: object
            properties:
              uuid:
                type: string
                format: uuid
              name:
                type: string
              color:
                type: string
          description: 分配给该企业的标签
        created_at:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        您的应用 API 密钥，可在 Business Console 的“开发者 -> API
        密钥”中获取。主密钥拥有完整访问权限。指定名称的密钥可设置作用域：针对每个资源设为无权限、只读或读写，限定于特定工作流或已通过的会话、限定于
        IP 地址列表，以及设置到期日期。401 表示密钥错误、已撤销或已过期；403 表示未发送密钥、密钥无权访问该资源或操作，或请求来自其 IP
        列表之外的地址；在会话路由上返回 404 表示该会话不在该密钥允许的工作流或状态范围内。没有媒体访问权限的密钥获取到的图片、视频和 PDF
        URL 将为 null；没有会话写入权限的密钥获取到的会话链接和 token 将为 null。请参阅
        https://docs.didit.me/console/api-keys。

````

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