> ## 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 للموردين

> أنشئ كيانات الشركات في Didit (KYB) مسبقاً قبل بدء جلسات 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>



      
      

الصق في

## نظرة عامةينشئ صراحةً [كيان الشركة](https://docs.didit.me/ar/entities/businesses/overview.md) قبل تشغيل أي جلسة التحقق من الشركات (KYB).## متى تستخدمه- **تهيئة البيانات الوصفية مسبقاً** (الشريك، والمستوى، والمعرّفات الداخلية) قبل أول جلسة التحقق من الشركات (KYB).
- **الترحيل** من مزوّد KYB آخر مع قائمة شركات موجودة.
- **التسجيل للمعاملات فقط**: أرسل المعاملات لشركة تحقّقت منها عبر عملية تتم دون اتصال.## ملاحظات- الحقل `vendor_data` مطلوب وفريد لكل تطبيق. تُرجع التكرارات خطأ تعارض، وللتحديث استخدم [`PATCH /v3/businesses/{vendor_data}/`](https://docs.didit.me/ar/management-api/businesses/update).
- يمكن تهيئة الحقول المستمدة من السجل (`legal_name` و`registration_number` و`country_code`)، لكنها **ستُستبدل** ببيانات السجل من أول جلسة التحقق من الشركات (KYB) المقبولة.
- إذا تطابق `country_code` مع قائمة [الدول الخطرة](https://docs.didit.me/ar/entities/businesses/blocklist.md#الدول-الخطرة) في تطبيقك، تُنشأ الشركة بحالة `BLOCKED`.
- يُصدر `business.data.updated`.## الأذوناتيجب أن يمنح الدور الإذن `create:businesses`.## ذات صلة- [نموذج بيانات الشركة](https://docs.didit.me/ar/entities/businesses/data-model.md)
- [ربط بيانات المورّد](https://docs.didit.me/ar/entities/vendor-data-linking.md)
- [عمليات الشركات](https://docs.didit.me/ar/entities/businesses/operations.md)


## OpenAPI

````yaml ar/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). لا تتسم
        بخاصية idempotency.
      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: معرّف UUID الداخلي الثابت من Didit لهذه الشركة.
        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 الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ 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.