التوثيق

ابدأ مع قواعد

من الصفر إلى أول عملية تحقق في أقل من ٥ دقائق. اتبع دليل البدء السريع لدمج قواعد في تطبيقك.

البدء السريع

تحقق من أول معاملة في ٥ دقائق

1

Sign Up & Get Your API Key

Create your free account and copy your API key from the Settings page.

bash
# Your API key is available at:
# app.qawaid.ai → Settings → API Configuration

API_KEY="qw_live_your_api_key_here"
TENANT="your-org"
2

Create Your First Rule

Navigate to Rules → New Rule and create a simple validation rule, or use the API:

bash
curl -X POST https://api.qawaid.ai/api/v1/rules \
  -H "Authorization: Bearer $API_KEY" \
  -H "X-Tenant-Slug: $TENANT" \
  -H "Content-Type: application/json" \
  -d '{
    "ruleId": "MIN-ORDER-001",
    "name": "Minimum Order Amount",
    "category": "Eligibility",
    "severity": "Error",
    "engineType": "Simple",
    "expression": {
      "fieldPath": "order.total",
      "operator": "GreaterThanOrEquals",
      "comparisonValue": "50"
    },
    "errorMessages": [{
      "locale": "en",
      "message": "Order must be at least $50",
      "errorCode": "MIN_ORDER"
    }]
  }'
3

Validate Data Against Your Rule

Send a validation request to test your rule:

bash
curl -X POST https://api.qawaid.ai/api/v1/validations/order \
  -H "Authorization: Bearer $API_KEY" \
  -H "X-Tenant-Slug: $TENANT" \
  -H "Content-Type: application/json" \
  -d '{"order": {"total": 25, "currency": "USD"}}'
4

See the Result

The API returns a structured validation response:

json
{
  "isValid": false,
  "totalRulesEvaluated": 1,
  "failures": [
    {
      "ruleCode": "MIN-ORDER-001",
      "ruleName": "Minimum Order Amount",
      "severity": "Error",
      "message": "Order must be at least $50",
      "errorCode": "MIN_ORDER",
      "fieldPath": "order.total",
      "actualValue": 25,
      "expectedValue": 50,
      "explanation": {
        "reason": "Value 25 is less than threshold 50",
        "suggestion": "Increase order total to at least $50"
      }
    }
  ]
}

.NET SDK

ادمج مع تطبيق .NET الخاص بك

عميل REST

استخدم عميل REST للتكاملات القياسية. يدعم async/await وإعادة المحاولة التلقائية وتخزين الاستجابات مؤقتاً.

csharp
// Install the .NET SDK
dotnet add package Qawaid.Sdk

// Quick Start
using Qawaid.Sdk;

var client = new QawaidClient(new QawaidOptions
{
    BaseUrl = "https://api.qawaid.ai",
    ApiKey = "qw_live_your_api_key_here",
    TenantSlug = "your-org"
});

// Validate data
var result = await client.Validation.ValidateAsync(
    "loan-application",
    new {
        applicant = new { age = 25, income = 75000 },
        loan = new { amount = 250000, term = 30 }
    });

if (!result.IsValid)
{
    foreach (var failure in result.Failures)
        Console.WriteLine($"[{failure.Severity}] {failure.Message}");
}

عميل gRPC (أداء عالي)

لسيناريوهات الإنتاجية العالية (١٠ آلاف+ تقييم/ثانية)، استخدم عميل gRPC لاستجابات أسرع حتى ٣ مرات.

csharp
// For high-performance scenarios, use gRPC
dotnet add package Qawaid.Sdk.Grpc

var grpcClient = new QawaidGrpcClient(new GrpcOptions
{
    Endpoint = "https://grpc.qawaid.ai:5001",
    ApiKey = "qw_live_your_api_key_here"
});

var result = await grpcClient.ValidateAsync(new ValidationRequest
{
    Context = "loan-application",
    Payload = JsonSerializer.Serialize(loanData)
});

الأدلة

تعمق في ميزات وتكاملات محددة

هل تحتاج مساعدة؟

فريقنا هنا لمساعدتك في الاستفادة القصوى من قواعد. تواصل معنا عبر الدعم أو انضم إلى مجتمعنا.

Qawaid — Business Rules Engine for Regulated Industries