واجهة API والتكامل
واجهة JSON تحت /api/v1/…. المسارات الحالية في OpenAPI على نشرك. في الأمثلة استبدل YOUR_HOST بالمضيف لديك.
التوثيق
- تفاعلي: /docs (عند التفعيل).
- المخطط:
GET /api/v1/openapi.json. - الحالة:
GET /health،GET /readiness،GET /api/v1/status.
الاتفاقيات
- HTTPS في الإنتاج.
Content-Type: application/json(باستثناء رفع ملفات النزاع).- بعد
POST /api/v1/auth/login— ملف تعريف ارتباط و/أوAuthorization: Bearer …. - التحديث:
POST /api/v1/auth/refresh. - قد تستخدم العمليات الحساسة
Idempotency-Key— انظر OpenAPI.
المجموعات الرئيسية
- المصادقة والجلسات: register، login، refresh، logout، MFA.
- الملف الشخصي والمحفظة:
/api/v1/me،/api/v1/wallet/balances،/api/v1/wallet/activity. - الضمان (Escrow): create، list، fund، release، dispute.
- Helpdesk: تذاكر.
- القائمة الكاملة — في OpenAPI.
دعم التكامل
أسئلة حول الوصول والسيناريوهات: المساعدة أو support@evopay.biz. يمكن للعملاء المسجّلين إنشاء تذاكر عبر POST /api/v1/helpdesk/tickets.
أمثلة
json · جسم الطلب
{
"email": "user@example.com",
"password": "YourStrongPassw0rd!",
"display_name": "Demo User"
}
bash · التسجيل
curl -sS -X POST "https://YOUR_HOST/api/v1/auth/register" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "YourStrongPassw0rd!",
"display_name": "Demo User"
}'
bash · تسجيل الدخول
curl -sS -X POST "https://YOUR_HOST/api/v1/auth/login" \
-H "Content-Type: application/json" \
-c cookies.txt \
-d '{
"email": "user@example.com",
"password": "YourStrongPassw0rd!"
}'
bash · الملف الشخصي والمحفظة
curl -sS "https://YOUR_HOST/api/v1/me" -b cookies.txt
curl -sS "https://YOUR_HOST/api/v1/wallet/balances" -b cookies.txt
curl -sS "https://YOUR_HOST/api/v1/wallet/activity?limit=20" -b cookies.txt
bash · إنشاء ضمان
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow" \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{
"title": "تسليم المعدات",
"description": "معدات خادم وفق المواصفات",
"amount": "8000.00",
"currency": "USD"
}'
ثم استبدل ESCROW_ID:
bash · دورة حياة الضمان
curl -sS "https://YOUR_HOST/api/v1/escrow/contracts/ESCROW_ID" -b cookies.txt
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow/ESCROW_ID/fund" \
-H "Content-Type: application/json" -b cookies.txt -d '{}'
curl -sS -X POST "https://YOUR_HOST/api/v1/escrow/ESCROW_ID/release" \
-H "Content-Type: application/json" -b cookies.txt -d '{}'
bash · الحالة
curl -sS "https://YOUR_HOST/api/v1/status"
curl -sS "https://YOUR_HOST/readiness"