رويــــــالوحة المطور

RUYA / توثيق المطورين

المصادقة

أمثلة هذه الصفحة تستخدم Sandbox ولا تنقل أموالاً. واجهة Live منفصلة وتتطلب اعتماد الحساب وطريقة الاستلام واشتراكاً سارياً.

دليل التكامل

يرسل تكامل الخادم Authorization: Bearer ruya_test_… . تستخدم اللوحة ملف ارتباط HttpOnly وSameSite=Strict بعد الدخول. إجراءات المالك لا تقبل مفاتيح API. طول كلمة المرور ١٢–١٢٨ حرفاً والجلسة ثماني ساعات؛ الخروج واستعادة الحساب يلغيان الجلسات. لا تضع الأسرار في HTML أو تخزين المتصفح أو الروابط أو المتغيرات العامة.

المسارات المنفّذة

POST /api/auth/login

المصادقة / الصلاحيات: Public · HTTP 201

Example request / مثال الطلب
{
  "email": "merchant@example.test",
  "password": "YOUR_ACCOUNT_PASSWORD"
}
cURL
curl -X POST 'https://ruya.site/api/auth/login'
  -H 'Content-Type: application/json'
  --data '{"email":"merchant@example.test","password":"YOUR_ACCOUNT_PASSWORD"}'
Node.js backend
const response = await fetch("https://ruya.site/api/auth/login", {
  method: 'POST',
  headers: {  'Content-Type': 'application/json' },
  body: JSON.stringify({
  "email": "merchant@example.test",
  "password": "YOUR_ACCOUNT_PASSWORD"
})
});
if (!response.ok) throw new Error('RUYA HTTP ' + response.status);
const result = await response.json();
مخططات الطلب والرد الناجح
Generated contract / العقد المولّد
{
  "request": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "email": {
        "type": "string",
        "maxLength": 254,
        "format": "email",
        "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
      },
      "password": {
        "type": "string",
        "minLength": 12,
        "maxLength": 128
      }
    },
    "required": [
      "email",
      "password"
    ]
  },
  "response": {
    "type": "object",
    "properties": {
      "workspaceUrl": {
        "type": "string"
      },
      "user": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "merchantId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "verified",
          "merchantId"
        ]
      }
    },
    "required": [
      "workspaceUrl",
      "user"
    ]
  }
}

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

جرّب في Sandbox

GET /api/v1/me

المصادقة / الصلاحيات: Authenticated merchant; API access varies by operation · HTTP 200

cURL
curl -X GET 'https://ruya.site/api/v1/me'
  -H 'Cookie: ruya_session=YOUR_SERVER_SESSION'
Node.js backend
const response = await fetch("https://ruya.site/api/v1/me", {
  method: 'GET',
  headers: { Cookie: 'ruya_session=' + process.env.RUYA_SESSION, }
});
if (!response.ok) throw new Error('RUYA HTTP ' + response.status);
const result = await response.json();
مخططات الطلب والرد الناجح
Generated contract / العقد المولّد
{
  "request": null,
  "response": {
    "type": "object",
    "properties": {
      "merchant": {
        "$ref": "#/schemas/Merchant"
      },
      "subscription": {
        "$ref": "#/schemas/Subscription"
      },
      "payments": {
        "type": "array",
        "items": {
          "$ref": "#/schemas/Payment"
        }
      },
      "metrics": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "succeeded": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "volume": {
            "type": "integer"
          }
        },
        "required": [
          "total",
          "succeeded",
          "pending",
          "volume"
        ]
      },
      "scope": {
        "type": "string"
      }
    },
    "required": [
      "merchant",
      "subscription",
      "payments",
      "metrics",
      "scope"
    ]
  }
}

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

جرّب في Sandbox

آخر تحديث: ٥ ديسمبر ٢٠٢٦. مرجع المسارات مولّد من المتحكمات ومخططات التحقق الحالية.