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

# تحديث واجهة برمجة تطبيقات الشركة: كيان KYB للموردين

> تحديث حقول Didit Business (KYB) القابلة للتعديل: اسم العرض والبيانات الوصفية والوسوم. الحقول المستمدة من السجل التجاري غير قابلة للتغيير.



موجه تحديث الشركة
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Goal: Partial-update a Didit Business (KYB) entity by vendor_data.

Endpoint: PATCH https://verification.didit.me/v3/businesses/{vendor_data}/
Auth header: x-api-key: <DIDIT_API_KEY>
Content-Type: application/json

Path param:
\- vendor_data (string, REQUIRED) — free-form string, NOT a UUID. URL-encode.

Request body (PARTIAL — only included fields are touched; counters and session history are left alone):
\- display_name (string, nullable)
\- legal_name (string, nullable)
\- registration_number (string, nullable)
\- country_code (string, nullable) — ISO 3166-1 alpha-2.
\- region (string, nullable) — ISO 3166-2.
\- status (enum) — "ACTIVE" | "FLAGGED" | "BLOCKED" (VendorBusinessStatusChoices). Setting "BLOCKED" auto-adds vendor_data to the system blocklist.
\- metadata (object, nullable) — REPLACES existing metadata wholesale; merge client-side if you only want to add keys.
\- reason (string, optional, max 1000): why the status changed. Recorded on the status-change entry in the company's Activity in the Business Console, only when this update actually changes status. Webhooks do not carry it.

curl:
curl -X PATCH 'https://verification.didit.me/v3/businesses/company-123/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"display_name": "Acme", "metadata": {"tier": "enterprise"}}'

Response 200: full updated BusinessDetailItem (same shape as GET). See /reference/data-models.

Side effects:
\- Every edit is recorded in the company's activity (actor derived from the API key): a status change with reason, and a profile update when display_name, legal_name, registration_number, country_code or metadata change.
\- last_activity_at bumped to now().
\- Re-sending an unchanged body is safe.

Failure modes:
\- 400 — validation. Common: { "status": ["Invalid status. Valid options are: ACTIVE, FLAGGED, BLOCKED"] }, { "metadata": ["Metadata must be a JSON object."] }
\{ "reason": ["Ensure this field has no more than 1000 characters."] }
\- 401 — missing/invalid x-api-key.
\- 403: a scoped API key without businesses write. { "detail": "This API key has no write access to companies." }
\- 404 — vendor_data not found.
\- 429 — rate-limited.

Notes:
\- vendor_data in the URL cannot be changed via this endpoint.
\- For status-only flips, prefer the dedicated PATCH /v3/businesses/{vendor_data}/update-status/.
\- Overriding registry-derived fields is allowed but flagged in the audit log.

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). الحقول التي تُملأ من عمليات البحث في السجل (`legal_name`، و`registration_number`، و`country_code`) تصبح للقراءة فقط بعد أول جلسة التحقق من الشركات (KYB) مقبولة.## متى تستخدمه- **إعادة تسمية**: عيّن `display_name` باسم أفضل للعروض الداخلية.
- **تحديث البيانات الوصفية**: انقل شركة بين مستويات داخلية، وسجّل ملاحظة داخلية، وغيّر الوسوم.
- **تجاوز بيانات السجل** (مع الحذر): التجاوزات مقبولة لكنها تُوسم في [سجل التدقيق](https://docs.didit.me/ar/console/audit-logs.md).## ملاحظات- لا يمكن تغيير `vendor_data` في عنوان URL عبر نقطة النهاية هذه.
- يُرسل webhook باسم `business.data.updated` مع مصفوفة `changed_fields`.
- يُسجَّل كل تعديل في **النشاط** الخاص بالشركة في Business Console. يُسجَّل تغيير `status` مع `reason` الاختياري (حتى 1000 حرف)، ويُسجَّل تغيير `display_name` أو `legal_name` أو `registration_number` أو `country_code` أو `metadata` كتحديث للملف التعريفي.
  لا يحمل حدث webhook `business.status.updated` الحقل `reason`.## الأذوناتيمكن دائماً للسر الأساسي و[مفاتيح API](https://docs.didit.me/ar/console/api-keys.md) ذات الوصول الكامل استدعاء نقطة النهاية هذه.
يحتاج مفتاح ذو وصول مخصص إلى صلاحية الكتابة في **الشركات** (`businesses`).
لا يستطيع مفتاح مقصور على بعض سير العمل أو على الجلسات المقبولة الوصول إلى نقطة النهاية هذه.تحدد [الأدوار والأذونات](https://docs.didit.me/ar/console/roles-permissions.md) في Console ما يمكن لعضو الفريق فعله داخل Console. لا تُقيَّم هذه الأذونات لطلبات مفاتيح API.## ذات صلة- [عمليات الشركات](https://docs.didit.me/ar/entities/businesses/operations.md)
- [نموذج البيانات](https://docs.didit.me/ar/entities/businesses/data-model.md)
- [تحديث الحالة](https://docs.didit.me/ar/management-api/businesses/update-status.md)


## OpenAPI

````yaml ar/openapi-25.json PATCH /v3/businesses/{vendor_data}/
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/{vendor_data}/:
    patch:
      tags:
        - Businesses
      summary: تحديث الشركة
      description: >-
        تحديث جزئي لشركة: `display_name`، `legal_name`، `registration_number`،
        `country_code`، `status`، `metadata`. يتم استبدال `metadata` بالكامل.
        يؤدي ضبط `status` على `BLOCKED` إلى إضافة `vendor_data` إلى قائمة الحظر
        الخاصة بالنظام؛ وتؤدي إزالته من حالة `BLOCKED` إلى إزالة ذلك الإدخال.
        يتم تسجيل كل تعديل في سجل نشاط الشركة: تغيير الحالة مع `reason`
        الاختياري، وتغيير `display_name` أو `legal_name` أو
        `registration_number` أو `country_code` أو `metadata` كتحديث للملف
        التعريفي.
      operationId: update_business
      parameters:
        - name: vendor_data
          in: path
          required: true
          schema:
            type: string
          description: معرّفك الفريد للشركة (سلسلة نصية حرة، وليس UUID).
          example: company-123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: نص التحديث الجزئي. قدّم فقط الحقول التي تريد تغييرها.
              properties:
                display_name:
                  type: string
                  nullable: true
                  description: >-
                    اسم العرض المألوف الظاهر في لوحة التحكم (له الأولوية على
                    `legal_name` للعرض في واجهة المستخدم).
                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`).
                status:
                  type: string
                  enum:
                    - ACTIVE
                    - FLAGGED
                    - BLOCKED
                  description: >-
                    حالة دورة حياة الشركة. يؤدي التعيين إلى `BLOCKED` تلقائياً
                    إلى إضافة `vendor_data` إلى قائمة الحظر الخاصة بالنظام؛
                    بينما يؤدي التغيير من `BLOCKED` إلى إزالة هذا الإدخال من
                    قائمة الحظر.
                metadata:
                  type: object
                  nullable: true
                  description: >-
                    كائن JSON عشوائي ترفقه بالشركة. **يستبدل بالكامل** البيانات
                    الوصفية الحالية عند التحديث — قم بالدمج من جانب العميل إذا
                    كنت تريد إضافة مفاتيح فقط.
                reason:
                  type: string
                  nullable: true
                  maxLength: 1000
                  description: >-
                    سبب تغيير الحالة. يُسجّل في قيد تغيير الحالة ضمن
                    **Activity** الخاصة بالشركة في Business Console، فقط عندما
                    تتغير الحالة فعلياً. لا تتضمنه أحداث webhook.
            examples:
              Update name:
                summary: تحديث الاسم المعروض
                value:
                  display_name: Acme Corp
              Flag for review:
                summary: تبديل الحالة
                value:
                  status: FLAGGED
              Add metadata:
                summary: استبدال كائن JSON للبيانات الوصفية
                value:
                  metadata:
                    industry: fintech
                    risk_level: low
              Fix registry data:
                summary: الحقول المستخرجة الصحيحة
                value:
                  legal_name: Acme Trading International Ltd
                  registration_number: '12345678'
                  country_code: GB
              Flag with reason:
                summary: وضع علامة على الشركة وتسجيل السبب
                value:
                  status: FLAGGED
                  reason: Ownership structure under review
      responses:
        '200':
          description: تم تحديث الشركة. يتم إرجاع سجل الشركة المحدث بالكامل.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessDetailItem'
              examples:
                Updated:
                  value:
                    didit_internal_id: a1b2c3d4-e5f6-4890-abcd-ef1234567890
                    vendor_data: company-123
                    display_name: Acme Corp
                    legal_name: Acme Trading Ltd
                    registration_number: '12345678'
                    country_code: GB
                    effective_name: Acme Corp
                    status: FLAGGED
                    session_count: 2
                    approved_count: 1
                    declined_count: 0
                    in_review_count: 1
                    features:
                      KYB: Approved
                    features_list:
                      - feature: KYB
                        status: Approved
                    last_session_at: '2026-03-15T10:30:00Z'
                    last_activity_at: '2026-03-15T10:30:00Z'
                    first_session_at: '2026-01-10T08:00:00Z'
                    tags:
                      - uuid: 9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d
                        name: VIP
                        color: '#2567FF'
                    created_at: '2026-01-10T08:00:00Z'
                    metadata:
                      industry: fintech
                      risk_level: low
                    updated_at: '2026-03-15T10:30:00Z'
        '400':
          description: >-
            جسم الطلب غير صالح: عادةً ما يكون `status` غير معروفة، أو `metadata`
            بتنسيق غير صحيح، أو `reason` يتجاوز 1000 حرف.
          content:
            application/json:
              examples:
                Bad status:
                  value:
                    status:
                      - >-
                        Invalid status. Valid options are: ACTIVE, FLAGGED,
                        BLOCKED
                Bad metadata:
                  value:
                    metadata:
                      - Metadata must be a JSON object.
                Reason too long:
                  value:
                    reason:
                      - Ensure this field has no more than 1000 characters.
        '403':
          description: >-
            مفتاح API مفقود أو غير صالح أو ملغى، أو لا يمكن للمفتاح تحديث
            الشركات لهذا التطبيق. يعيد المفتاح المفقود `403`؛ بينما يعيد المفتاح
            الخاطئ أو الملغى أو منتهي الصلاحية `401`.
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            لا توجد شركة (غير محذوفة) ببيانات `vendor_data` المقدمة لهذا
            التطبيق.
          content:
            application/json:
              examples:
                Not found:
                  value:
                    detail: Not found.
        '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 PATCH
            'https://verification.didit.me/v3/businesses/company-123/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"display_name": "Acme Corp", "status": "FLAGGED"}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.businesses.update(
                "company-123",
                display_name="Acme Corp",
            )
            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.update("company-123", {
              display_name: "Acme Corp",
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Businesses.Update(ctx, \"company-123\", didit.BusinessesUpdateParams{\n\tDisplayName: didit.String(\"Acme Corp\"),\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.BusinessesUpdateParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result = client.businesses().update("company-123",
            BusinessesUpdateParams.builder()
                    .displayName("Acme Corp")
                    .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->update('company-123', [
                'display_name' => 'Acme Corp',
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.businesses.update(
              "company-123",
              display_name: "Acme Corp"
            )
            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.UpdateAsync("company-123", new
            BusinessesUpdateParams

            {
                DisplayName = "Acme Corp",
            });

            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.