API Documentation

توثيق واجهة برمجة التطبيقات (API) للمنصة. للمبرمجين والمطورين — لا يتطلب تسجيل دخول.

Base URL

الرابط الأساسي للـ API (استبدل النطاق بنطاق المتجر عند الاستخدام):

https://deebmart.com/api

Authentication

مطلوب توثيق في جميع طلبات الـ API. يمكن إرسال التوكن بأحد الطرق التالية:

Authorization: Bearer YOUR_API_TOKEN

الملف الشخصي

GET /api/profile

جلب رصيد العميل ومعلومات البروفايل.

Response Example

{
  "id": 1,
  "name": "اسم العميل",
  "email": "user@example.com",
  "balance": "100.50000000000000000000"
}

المنتجات

GET /api/products

جلب قائمة المنتجات المتاحة مع السعر وحقول الطلب المطلوبة.

Response Example

[
  {
    "id": 1,
    "name": "اسم المنتج",
    "product_price": "10.50",
    "order_fields": [
      {
        "id": 1,
        "field_label": "معرف اللاعب",
        "field_type": "text"
      }
    ]
  }
]

الطلب

Create Order

POST /api/orders

إنشاء طلب جديد.

Parameterنوع المتجرمطلوبالوصف
product_idintegerنعممعرف المنتج
quantityintegerنعمالكمية (1 أو أكثر)
player_idstringلامعرف اللاعب أو قيمة حقل
order_fieldsobjectلاقيم حقول الطلب: { field_id: "value" }
unit_price_usdnumberلاسعر الوحدة بالدولار

Request Example

{
  "product_id": 1,
  "quantity": 1,
  "player_id": "player123",
  "order_fields": {
    "1": "قيمة الحقل 1"
  }
}

Response Example

{
  "id": 123,
  "status": "automatic processing",
  "product_name": "اسم المنتج",
  "quantity": 1,
  "total_amount": "10.50000000000000000000",
  "created_at": "2025-01-28T12:00:00.000000Z"
}

Get Order

GET /api/orders/{id}

جلب تفاصيل طلب بواسطة معرف الطلب.

Error Codes

HTTPالوصف
401Unauthenticated - توكن مطلوب أو غير صالح
403Account suspended - الحساب موقوف
404Store / Order / Profile not found
400Validation error or business error