العودة إلى التوثيق
مرجع API

مرجع واجهة برمجة التطبيقات

مرجع شامل لجميع نقاط نهاية REST API مع أمثلة الطلب والاستجابة.

المصادقة

كل الطلبات تتطلب مصادقة

يتم تمرير المصادقة عبر رؤوس HTTP في كل طلب.

الرأسمطلوبالوصف
X-Api-Key
Required
مفتاح API الخاص بك
X-Tenant-Id
Required
معرف المستأجر الخاص بك
Content-Type
Conditional
مطلوب لطلبات POST/PUT
bash
curl -X GET https://api.qawaid.ai/api/v1/rules \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id"
Base URL
https://api.qawaid.ai

جميع مسارات API نسبية لعنوان URL الأساسي هذا. استخدم HTTPS دائمًا.

POST/api/v1/validation/validate

Validate a single payload against all published rules in the given context.

200Validation result returned400Invalid request body401Unauthorized

Request Body

json
{
  "context": "loan-application",
  "payload": {
    "applicant": { "age": 25, "income": 75000 },
    "loan": { "amount": 250000, "term": 30 }
  }
}

Response

json
{
  "isValid": false,
  "totalRulesEvaluated": 5,
  "failures": [
    {
      "ruleCode": "INCOME-RATIO-001",
      "ruleName": "Income to Loan Ratio",
      "severity": "Error",
      "message": "Loan amount exceeds 3x annual income",
      "errorCode": "INCOME_RATIO",
      "fieldPath": "loan.amount",
      "actualValue": 250000,
      "expectedValue": 225000
    }
  ],
  "executionTimeMs": 12
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "context": "loan-application",
    "payload": {
      "applicant": { "age": 25, "income": 75000 },
      "loan": { "amount": 250000, "term": 30 }
    }
  }'
POST/api/v1/validation/validate-batch

Validate multiple payloads in a single request. Ideal for bulk data processing scenarios.

200Batch results returned400Invalid request body401Unauthorized

Request Body

json
{
  "context": "order-validation",
  "items": [
    { "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
    { "id": "order-2", "payload": { "total": 25, "currency": "USD" } },
    { "id": "order-3", "payload": { "total": 500, "currency": "EUR" } }
  ]
}

Response

json
{
  "results": [
    { "id": "order-1", "isValid": true, "failures": [] },
    { "id": "order-2", "isValid": false, "failures": [{ "ruleCode": "MIN-ORDER-001", "message": "Order must be at least $50" }] },
    { "id": "order-3", "isValid": true, "failures": [] }
  ],
  "totalProcessed": 3,
  "totalFailed": 1,
  "executionTimeMs": 28
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-batch \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "context": "order-validation",
    "items": [
      { "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
      { "id": "order-2", "payload": { "total": 25, "currency": "USD" } }
    ]
  }'
POST/api/v1/validation/validate-transaction

Validate a complete transaction with multiple rule contexts evaluated atomically.

200Transaction result returned400Invalid request body401Unauthorized

Request Body

json
{
  "transactionId": "txn-20240115-001",
  "contexts": ["kyc-check", "aml-screening", "credit-assessment"],
  "payload": {
    "customer": { "name": "John Doe", "country": "US", "pep": false },
    "transaction": { "amount": 50000, "type": "wire-transfer" }
  }
}

Response

json
{
  "transactionId": "txn-20240115-001",
  "overallResult": "Rejected",
  "contextResults": [
    { "context": "kyc-check", "isValid": true, "failures": [] },
    { "context": "aml-screening", "isValid": true, "failures": [] },
    { "context": "credit-assessment", "isValid": false, "failures": [
      { "ruleCode": "CREDIT-LIMIT-001", "message": "Amount exceeds single transaction limit" }
    ]}
  ],
  "executionTimeMs": 45
}
bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-transaction \
  -H "X-Api-Key: qw_live_your_api_key" \
  -H "X-Tenant-Id: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "transactionId": "txn-20240115-001",
    "contexts": ["kyc-check", "aml-screening", "credit-assessment"],
    "payload": {
      "customer": { "name": "John Doe", "country": "US" },
      "transaction": { "amount": 50000, "type": "wire-transfer" }
    }
  }'

رموز حالة HTTP

الرمزالحالةالوصف
200OKRequest succeeded
201CreatedResource created successfully
204No ContentResource deleted successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid API key
402Payment RequiredPayment method required for plan change
404Not FoundResource does not exist
409ConflictResource state conflict (e.g., duplicate or wrong status)
429Too Many RequestsRate limit exceeded, retry after cooldown
500Server ErrorInternal server error, contact support

ابدأ الآن

قم بتحميل مجموعة Postman أو ابدأ مع دليل التكامل.

Qawaid — Business Rules Engine for Regulated Industries