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

# تخطيط فحص الاحتيال

> التحقق من المدخلات وتقدير رسوم فحص الاحتيال المحددة في Didit قبل تشغيل الطلب.

أرسل نفس محتوى الطلب الذي تنوي استخدامه مع [فحص الاحتيال](https://docs.didit.me/ar/standalone-apis/fraud-check.md).
لا ينشئ التخطيط أي فحص أو جلسة، ولا يستدعي أي مزود إثراء، ولا يقرأ أي سجل شبكة، ولا يتم تحصيل أي رسوم.

تفصل كل وحدة بين `available` و`will_run`.
يوضح `availability_reason` ما إذا كانت المدخلات المقدمة تتيح تشغيلها، بينما يوضح `selection_reason` سبب اختيارها أو عدم اختيارها.
أبقِ المفاتيح غير المتاحة ظاهرة واعرض متطلبات المدخلات الخاصة بها.

يتطلب `networks_cross_org` خطة Enterprise وضبط وضع المشاركة في مؤسستك على `global`.
من دونهما، أو عندما لا تكون Networks مفعّلة لمؤسستك، يبلغ التخطيط عن ذلك بـ `available: false` و`availability_reason: "entitlement_required"`.
يتخطاها أي فحص يحددها بالسبب نفسه.
لا تخضع تطبيقات البيئة التجريبية لقيود الخطة أو وضع المشاركة: عند وجود معرّف مدعوم، تعمل الوحدة وتعيد نتيجة عينة فارغة.

`estimated_price` سلسلة عشرية مقوّمة بالعملة المحددة في `currency`.
السعر null يعني غير متاح أو غير مسعّر، وليس مجانياً.
يجمع التقدير على المستوى الأعلى الوحدات القابلة للتشغيل المحددة، ويتحقق `can_afford` أيضاً من ترتيب الفوترة المعمول به.
أعد التخطيط بعد تغيير المعرّفات أو السياق أو التحديدات.
يعيد التنفيذ التحقق من الأهلية والتسعير، لذا فالتخطيط ليس حجزاً، ولا يضمن أن يستجيب المصدر الخارجي.


## OpenAPI

````yaml ar/openapi-25.json POST /v3/fraud/checks/plan/
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/fraud/checks/plan/:
    post:
      tags:
        - Fraud Check
      summary: خطة فحص الاحتيال
      description: >-
        التحقق من صحة الفحوصات المحددة وتقدير سعرها دون تنفيذ، أو إنشاء جلسة، أو
        فوترة.
      operationId: plan_create
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/FraudCheckRequestRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/FraudCheckRequestRequest'
            example:
              client_reference: review-attempt-001
              subject:
                identifiers:
                  - type: email
                    value: applicant@example.com
                attributes:
                  first_name: Alex
                  last_name: Example
              checks:
                include:
                  - networks_same_org
                  - networks_cross_org
                  - email_risk
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FraudCheckRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FraudCheckPlan'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FraudBadRequestErrorMessage'
          description: ''
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      x-codeSamples:
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.fraud_checks.plan(
                client_reference="review-attempt-001",
                subject={
                    "identifiers": [{
                        "type": "email",
                        "value": "applicant@example.com",
                    }],
                    "attributes": {
                        "first_name": "Alex",
                        "last_name": "Example",
                    },
                },
                checks={
                    "include": ["networks_same_org", "networks_cross_org", "email_risk"],
                },
            )
            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.fraudChecks.plan({
              client_reference: "review-attempt-001",
              subject: {
                identifiers: [{
                  type: "email",
                  value: "applicant@example.com",
                }],
                attributes: {
                  first_name: "Alex",
                  last_name: "Example",
                },
              },
              checks: {
                include: ["networks_same_org", "networks_cross_org", "email_risk"],
              },
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.FraudChecks.Plan(ctx, didit.FraudCheckRequestRequest{\n\tClientReference: didit.String(\"review-attempt-001\"),\n\tSubject: didit.FraudCheckSubjectRequest{\n\t\tIdentifiers: []didit.FraudCheckIdentifierRequest{{\n\t\t\tType:  didit.FraudTypeEnum(\"email\"),\n\t\t\tValue: \"applicant@example.com\",\n\t\t}},\n\t\tAttributes: didit.Some(didit.FraudCheckAttributesRequest{\n\t\t\tFirstName: didit.String(\"Alex\"),\n\t\t\tLastName:  didit.String(\"Example\"),\n\t\t}),\n\t},\n\tChecks: didit.Some(didit.FraudCheckModuleSelectionRequest{\n\t\tInclude: didit.Some([]didit.FraudExcludeEnum{didit.FraudExcludeEnum(\"networks_same_org\"), didit.FraudExcludeEnum(\"networks_cross_org\"), didit.FraudExcludeEnum(\"email_risk\")}),\n\t}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.List;

            import me.didit.Didit;

            import me.didit.types.FraudCheckAttributesRequest;

            import me.didit.types.FraudCheckIdentifierRequest;

            import me.didit.types.FraudCheckModuleSelectionRequest;

            import me.didit.types.FraudCheckRequestRequest;

            import me.didit.types.FraudCheckSubjectRequest;

            import me.didit.types.FraudExcludeEnum;

            import me.didit.types.FraudTypeEnum;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.fraudChecks().plan(FraudCheckRequestRequest.builder()
                    .clientReference("review-attempt-001")
                    .subject(FraudCheckSubjectRequest.builder()
                            .identifiers(List.of(FraudCheckIdentifierRequest.builder()
                                    .type(FraudTypeEnum.of("email"))
                                    .value("applicant@example.com")
                                    .build()))
                            .attributes(FraudCheckAttributesRequest.builder()
                                    .firstName("Alex")
                                    .lastName("Example")
                                    .build())
                            .build())
                    .checks(FraudCheckModuleSelectionRequest.builder()
                            .include(List.of(FraudExcludeEnum.of("networks_same_org"), FraudExcludeEnum.of("networks_cross_org"), FraudExcludeEnum.of("email_risk")))
                            .build())
                    .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->fraudChecks->plan([
                'client_reference' => 'review-attempt-001',
                'subject' => [
                    'identifiers' => [[
                        'type' => 'email',
                        'value' => 'applicant@example.com',
                    ]],
                    'attributes' => [
                        'first_name' => 'Alex',
                        'last_name' => 'Example',
                    ],
                ],
                'checks' => [
                    'include' => ['networks_same_org', 'networks_cross_org', 'email_risk'],
                ],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

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

            result = didit.fraud_checks.plan(
              client_reference: "review-attempt-001",
              subject: {
                identifiers: [{
                  type: "email",
                  value: "applicant@example.com",
                }],
                attributes: {
                  first_name: "Alex",
                  last_name: "Example",
                },
              },
              checks: {
                include: ["networks_same_org", "networks_cross_org", "email_risk"],
              }
            )
            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.FraudChecks.PlanAsync(new
            FraudCheckRequestRequest

            {
                ClientReference = "review-attempt-001",
                Subject = new()
                {
                    Identifiers = new FraudCheckIdentifierRequest[]
                    {
                        new()
                        {
                            Type = "email",
                            Value = "applicant@example.com",
                        },
                    },
                    Attributes = new FraudCheckAttributesRequest
                    {
                        FirstName = "Alex",
                        LastName = "Example",
                    },
                },
                Checks = new FraudCheckModuleSelectionRequest
                {
                    Include = new FraudExcludeEnum[] { "networks_same_org", "networks_cross_org", "email_risk" },
                },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    FraudCheckRequestRequest:
      type: object
      properties:
        client_reference:
          type: string
          minLength: 1
          description: >-
            المرجع الخاص بك لعملية الفحص هذه. يعمل أيضاً كمفتاح idempotency:
            إعادة استخدامه مع نفس الطلب يعيد الفحص الأصلي دون تشغيل الوحدات أو
            فوترتها مرة أخرى؛ وإعادة استخدامه مع طلب مختلف يعيد 409.
          maxLength: 255
        profile:
          type: string
          minLength: 1
          default: standard
          description: معرّف ملف التنسيق. يتم تعيينه افتراضياً على ملف Didit `standard`.
          maxLength: 64
        profile_version:
          type: string
          minLength: 1
          description: >-
            تثبيت نسخة مجمدة من الملف التعريفي. القيمة الافتراضية هي النسخة
            الحالية للملف التعريفي.
          maxLength: 32
        subject:
          $ref: '#/components/schemas/FraudCheckSubjectRequest'
        context:
          $ref: '#/components/schemas/FraudCheckContextRequest'
        checks:
          $ref: '#/components/schemas/FraudCheckModuleSelectionRequest'
        vendor_data:
          type: string
          maxLength: 1000
        metadata: {}
      required:
        - subject
    FraudCheckPlan:
      type: object
      properties:
        profile_id:
          type: string
        profile_version:
          type: string
        modules:
          type: array
          items:
            $ref: '#/components/schemas/FraudCheckPlannedModule'
        estimated_price:
          type: string
          nullable: true
        currency:
          type: string
          nullable: true
        is_sandbox:
          type: boolean
        can_afford:
          type: boolean
      required:
        - can_afford
        - currency
        - estimated_price
        - is_sandbox
        - modules
        - profile_id
        - profile_version
    FraudBadRequestErrorMessage:
      type: object
      properties:
        detail:
          type: string
          default: Bad Request - Invalid request data
    FraudCheckSubjectRequest:
      type: object
      properties:
        selfie:
          type: string
          minLength: 1
          description: >-
            صورة سيلفي بتنسيق JPEG أو PNG أو WebP بترميز Base64، حتى 6 MB. بدون
            صورة مرجعية أو عنوان URL.
          maxLength: 8388672
        identifiers:
          type: array
          items:
            $ref: '#/components/schemas/FraudCheckIdentifierRequest'
          description: معرّف واحد أو أكثر بنوع محدد. معرّف واحد يكفي.
          maxItems: 10
          minItems: 1
        attributes:
          $ref: '#/components/schemas/FraudCheckAttributesRequest'
      required:
        - identifiers
    FraudCheckContextRequest:
      type: object
      properties:
        ip_address:
          type: string
          minLength: 1
        user_agent:
          type: string
          maxLength: 512
        country:
          type: string
          description: >-
            الدولة التي يدّعي الشخص وجوده فيها. للسياق فقط - لا تعد أبدًا دليلاً
            على إثبات ملكية الهوية.
          maxLength: 3
        purpose:
          type: string
          maxLength: 128
        consent_obtained:
          type: boolean
    FraudCheckModuleSelectionRequest:
      type: object
      properties:
        include:
          type: array
          items:
            $ref: '#/components/schemas/FraudExcludeEnum'
        exclude:
          type: array
          items:
            $ref: '#/components/schemas/FraudExcludeEnum'
    FraudCheckPlannedModule:
      type: object
      properties:
        module:
          $ref: '#/components/schemas/FraudExcludeEnum'
        available:
          type: boolean
        availability_reason:
          type: string
          nullable: true
        will_run:
          type: boolean
        selection_reason:
          type: string
          nullable: true
        estimated_price:
          type: string
          nullable: true
      required:
        - availability_reason
        - available
        - estimated_price
        - module
        - selection_reason
        - will_run
    FraudCheckIdentifierRequest:
      type: object
      properties:
        type:
          allOf:
            - $ref: '#/components/schemas/FraudTypeEnum'
          description: |-
            نوع المعرّف. يحدد حقول مساحة الاسم المطلوبة.

            * `email` - البريد الإلكتروني
            * `phone` - الهاتف
            * `national_id` - الهوية الوطنية
            * `tax_number` - الرقم الضريبي
            * `passport_number` - رقم جواز السفر
            * `driving_licence_number` - رقم رخصة القيادة
            * `residence_permit_number` - رقم تصريح الإقامة
            * `voter_id` - معرّف الناخب
            * `external_id` - المعرّف الخارجي
        value:
          type: string
          minLength: 1
          description: قيمة المعرّف، بأي تنسيق معتاد.
          maxLength: 255
        country:
          type: string
          description: >-
            دولة الإصدار بتنسيق ISO-3166 alpha-2 أو alpha-3. مطلوب لأنواع
            المعرّفات الحكومية: تشير الأرقام المتطابقة إلى أشخاص مختلفين في
            بلدان مختلفة.
          maxLength: 3
        issuer:
          type: string
          description: >-
            جهة إصدار اختيارية أو جهة إصدار دون وطنية، عندما لا تكون الدولة
            وحدها مميزة بشكل فريد.
          maxLength: 128
      required:
        - type
        - value
    FraudCheckAttributesRequest:
      type: object
      description: سمات مؤيدة. جميعها اختيارية؛ وهي تزيد من نطاق تغطية الوحدة.
      properties:
        first_name:
          type: string
          maxLength: 128
        last_name:
          type: string
          maxLength: 128
        full_name:
          type: string
          maxLength: 256
        date_of_birth:
          type: string
          format: date
        nationality:
          type: string
          maxLength: 3
        gender:
          type: string
          maxLength: 16
        address:
          type: string
          maxLength: 512
        city:
          type: string
          maxLength: 128
        state:
          type: string
          maxLength: 128
        postal_code:
          type: string
          maxLength: 32
    FraudExcludeEnum:
      enum:
        - normalization
        - email_risk
        - email_social
        - phone_social
        - phone_risk
        - ip_risk
        - database_validation
        - networks_same_org
        - networks_cross_org
        - biometric_identity
      type: string
      description: |-
        * `normalization` - التطبيع
        * `email_risk` - مخاطر البريد الإلكتروني
        * `email_social` - الحسابات الاجتماعية للبريد الإلكتروني
        * `phone_social` - الحسابات الاجتماعية لرقم الهاتف
        * `phone_risk` - مخاطر رقم الهاتف
        * `ip_risk` - مخاطر عنوان IP
        * `database_validation` - التحقق من قواعد البيانات
        * `networks_same_org` - شبكات المؤسسة نفسها
        * `networks_cross_org` - شبكات عبر المؤسسات
        * `biometric_identity` - الهوية البيومترية
    FraudTypeEnum:
      enum:
        - email
        - phone
        - national_id
        - tax_number
        - passport_number
        - driving_licence_number
        - residence_permit_number
        - voter_id
        - external_id
      type: string
      description: |-
        * `email` - البريد الإلكتروني
        * `phone` - الهاتف
        * `national_id` - الهوية الوطنية
        * `tax_number` - الرقم الضريبي
        * `passport_number` - رقم جواز السفر
        * `driving_licence_number` - رقم رخصة القيادة
        * `residence_permit_number` - رقم تصريح الإقامة
        * `voter_id` - معرّف الناخب
        * `external_id` - المعرّف الخارجي
  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.
    BearerAuth:
      type: http
      scheme: bearer
      description: token الوصول الخاص باعتماد العميل للتطبيق.

````

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