Developer APIعام ومتاح

كل ما تحتاجه لربط تطبيقك مع GymDesk — واضح، عملي، ومنظم.

ابدأ من Quick Start، افهم شكل المصادقة والصلاحيات، ثم انزل إلى كل Endpoint مع أمثلة Request وResponse كاملة. لا يوجد هنا محتوى محشور أو Scroll داخلي يضيعك.

Starter

starter
100 SAR
شهريًا100,000
معدل الطلبات120 req/min
عدد المفاتيح2 keys

Growth

growth
200 SAR
شهريًا500,000
معدل الطلبات300 req/min
عدد المفاتيح5 keys

Pro

pro
350 SAR
شهريًا1,500,000
معدل الطلبات600 req/min
عدد المفاتيح10 keys

Enterprise

enterprise
Custom
شهريًاCustom
معدل الطلباتCustom
عدد المفاتيحCustom
ابدأ من هناTutorial فعلي

كيف تعمل المنظومة؟

الفكرة بسيطة: تنشئ API Key من Dashboard الجيم، تعطيها الـScopes والفروع المناسبة، ثم يستخدمها تطبيقك أو Backend وسيط للاتصال بـGymDesk API. كل طلب يُعزل تلقائيًا داخل نفس الجيم.

تطبيقك
API Key
GymDesk API
بيانات الجيم
01

أنشئ API Key من Dashboard الجيم

ادخل API & Integrations، اضغط إنشاء API Key، ثم اختر الاسم المناسب، الـScopes، والفروع المسموح بها لهذا التكامل.

02

خزّن المفتاح بشكل آمن

المفتاح يُعرض مرة واحدة فقط. خزّنه في Backend، أو Environment Variable، ولا تضعه داخل APK عام أو داخل Git repository.

03

ابدأ دائمًا بـ GET /me

هذا الطلب يؤكد أن الاتصال صحيح، ويُرجع لك بيانات الجيم، والباقة، والصلاحيات، وتقييد الفروع للمفتاح.

First requestCURL
curl 'https://api.gymdesk-system.com/api/v1/external/v1/me' \
  -H 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  -H 'Accept: application/json'
النتيجة المتوقعة200 OK
{
  "success": true,
  "data": {
    "tenant": {
      "name": "Power House Gym",
      "slug": "power-house-gym"
    },
    "apiKey": {
      "name": "Mobile App Production",
      "planCode": "starter",
      "scopes": [
        "members:read",
        "attendance:read"
      ]
    }
  }
}

Base URL

https://api.gymdesk-system.com/api/v1/external/v1

أضف المسار بعد هذا العنوان، مثل /me أو /members أو /attendance.

Authentication

كل Request لازم يحمل الـAPI Key. الأسهل والأوضح هو Authorization header. كل مفتاح مربوط تلقائيًا بجيم واحد فقط، لذلك لا يستطيع الوصول إلى بيانات Tenant آخر حتى لو حاول.

Authorization: Bearer gym_live_YOUR_API_KEY
لو التطبيق Public على Google Play أو App Store: لا تضع gym_live_ داخل التطبيق نفسه. استخدم Backend وسيط أو آلية Token قصيرة العمر.

Scopes

أفضل ممارسة: أنشئ API Key منفصل لكل Integration، وأعطه أقل صلاحيات ممكنة. بهذه الطريقة لو ألغيت التكامل أو حدثت مشكلة، يمكنك إيقافه وحده.

branches:read
staff:read
coaches:read
members:read
members:write
subscriptions:read
payments:read
attendance:read
attendance:write
classes:read
private_coaching:read
sales:read
finance:read
equipment:read
devices:read
daily_sessions:read
dashboard:read
reports:read
payroll:read

Pagination

كل المسارات التي ترجع قوائم تستخدم page وlimit. في الـExternal API الحد الأقصى هو 200 عنصر في الطلب الواحد.

ExampleHTTP
GET https://api.gymdesk-system.com/api/v1/external/v1/members?page=1&limit=50
Response meta
{
  "success": true,
  "data": [
    "..."
  ],
  "meta": {
    "page": 1,
    "limit": 50
  }
}

حدود الاستخدام

كل جيم له حد شهري مشترك على مستوى الباقة، وحد لكل دقيقة. كل المفاتيح داخل نفس الجيم تشترك في نفس الحد الشهري.

X-RateLimit-Limit

الحد المسموح في الدقيقة

X-RateLimit-Remaining

المتبقي من حد الدقيقة الحالية

X-Monthly-Limit

الحد الشهري للجيم

X-Monthly-Remaining

المتبقي من الحد الشهري

Retry-After

عدد الثواني المقترح انتظارها بعد 429

الأخطاء

اعتمد على code البرمجي داخل الاستجابة، وليس النص المعروض فقط. هذا يسهل عليك بناء منطق واضح داخل التطبيق الخارجي.

HTTPCodeMeaning
401API_KEY_REQUIREDAPI Key غير موجود أو تم إرساله بشكل خاطئ.
401API_KEY_INVALIDالمفتاح غير صالح أو مُلغى أو منتهي الصلاحية.
403API_SCOPE_REQUIREDالمفتاح لا يملك الـScope المطلوب لهذا المسار.
403API_BRANCH_FORBIDDENالمفتاح يحاول الوصول لفرع غير مسموح له.
403API_FEATURE_NOT_ACTIVEDeveloper API غير مفعّلة لهذا الجيم.
422VALIDATION_ERRORBody أو Query Parameters لا تطابق المتطلبات.
409MEMBER_CONFLICTبيانات العضو تتعارض مع سجل موجود.
429API_RATE_LIMIT_EXCEEDEDتم تجاوز عدد الطلبات في الدقيقة.
429API_MONTHLY_QUOTA_EXCEEDEDتم استهلاك الحد الشهري للباقة.

الحساب

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/me' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "tenant": {
      "id": "tenant_uuid",
      "name": "Power House Gym",
      "slug": "power-house-gym",
      "countryCode": "SA",
      "status": "active"
    },
    "apiKey": {
      "name": "Mobile App Production",
      "planCode": "starter",
      "scopes": [
        "members:read",
        "attendance:read"
      ],
      "branchIds": null,
      "monthlyRequestLimit": 100000,
      "requestsPerMinute": 120
    }
  }
}
GET/me

تحقق من الاتصال

أول طلب لازم تجربه. يرجع بيانات الجيم كاملة بشكل آمن، اسم المفتاح، الباقة، الـScopes، تقييد الفروع وحدود الاستخدام.

الفروع

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/branches' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "branch_uuid",
      "name": "Riyadh Main Branch",
      "code": "R01",
      "phone": "011...",
      "whatsapp": "966...",
      "city": "Riyadh",
      "status": "active",
      "timezone": "Asia/Riyadh",
      "currency": "SAR",
      "logoUrl": null
    }
  ]
}
GET/branches

عرض كل الفروع

يعرض كل بيانات الفروع المسموح بها للمفتاح، بما فيها الاتصال والعنوان والمنطقة الزمنية والعملة والشعار والإعدادات العامة.

الصلاحية المطلوبةbranches:read
GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/branches/branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "branch_uuid",
    "name": "Riyadh Main Branch",
    "code": "R01",
    "city": "Riyadh",
    "status": "active",
    "timezone": "Asia/Riyadh",
    "currency": "SAR",
    "settings": {}
  }
}
GET/branches/:id

تفاصيل فرع

يعيد فرع واحد بكل بياناته العامة وإعداداته المسموحة للـAPI.

الصلاحية المطلوبةbranches:read

Parameters

idrequired
UUID · path

معرف الفرع.

الموظفون

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/staff?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "user_uuid",
      "branchId": "branch_uuid",
      "name": "Omar Hassan",
      "email": "[email protected]",
      "phone": "05...",
      "role": "reception",
      "status": "active",
      "branchName": "Main Branch"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "returned": 1,
    "hasMore": false
  }
}
GET/staff

قائمة الموظفين

يعرض بيانات الموظفين الآمنة فقط: الاسم، الهاتف، البريد، الدور، الحالة والفرع. لا يعيد Password hash أو Permissions الداخلية.

الصلاحية المطلوبةstaff:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

فلترة حسب الحالة.

search
string

بحث بالاسم أو البريد أو الهاتف.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/staff/user_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "user_uuid",
    "name": "Omar Hassan",
    "role": "reception",
    "status": "active",
    "branchName": "Main Branch",
    "lastLoginAt": "2026-09-30T12:00:00Z"
  }
}
GET/staff/:id

بيانات موظف

يعرض موظفًا واحدًا ببياناته الآمنة بدون أي Credentials أو Secrets.

الصلاحية المطلوبةstaff:read

Parameters

idrequired
UUID · path

معرف الموظف.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/staff/shifts?branchId=branch_uuid&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "shift_uuid",
      "name": "Morning",
      "startTime": "08:00:00",
      "endTime": "16:00:00",
      "graceMinutes": 10,
      "isActive": true,
      "branchName": "Main Branch"
    }
  ]
}
GET/staff/shifts

ورديات الموظفين

يعرض الورديات وأوقات البداية والنهاية وفترة السماح وحالتها.

الصلاحية المطلوبةstaff:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
active | inactive

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/staff/attendance?page=1&limit=50&branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "employee_attendance_uuid",
      "staffName": "Omar Hassan",
      "role": "reception",
      "shiftName": "Morning",
      "workDate": "2026-09-30",
      "checkIn": "2026-09-30T08:05:00Z",
      "checkOut": "2026-09-30T16:02:00Z",
      "lateMinutes": 0,
      "overtimeMinutes": 2,
      "status": "present"
    }
  ]
}
GET/staff/attendance

حضور الموظفين

يعرض حضور الموظفين، وقت الدخول والخروج، التأخير، الوقت الإضافي والحالة.

الصلاحية المطلوبةstaff:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

حالة اليوم.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

المدربون

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/coaches?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "coach_uuid",
      "name": "Coach Ahmed",
      "phone": "05...",
      "commissionType": "percentage",
      "commissionValue": "20.00",
      "status": "active",
      "branchName": "Main Branch"
    }
  ]
}
GET/coaches

قائمة المدربين

يعرض المدربين مع الفرع والحالة ونوع وقيمة العمولة.

الصلاحية المطلوبةcoaches:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

حالة المدرب.

search
string

بحث بالاسم أو الهاتف.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/coaches/coach_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "coach_uuid",
    "name": "Coach Ahmed",
    "status": "active",
    "commissionType": "percentage",
    "commissionValue": "20.00"
  }
}
GET/coaches/:id

بيانات مدرب

يعرض بيانات مدرب واحد بعد التحقق من الجيم والفرع.

الصلاحية المطلوبةcoaches:read

Parameters

idrequired
UUID · path

معرف المدرب.

الأعضاء

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members?page=1&limit=50&status=active&search=Ahmed' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "member_uuid",
      "branchId": "branch_uuid",
      "branchName": "Main Branch",
      "code": "1007",
      "fullName": "Ahmed Ali",
      "email": "[email protected]",
      "phone": "0501234567",
      "whatsapp": "0501234567",
      "gender": "male",
      "birthDate": "1998-02-10",
      "status": "active",
      "mainCoachId": "coach_uuid",
      "mainCoachName": "Coach Ahmed"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 50,
    "returned": 1,
    "hasMore": false
  }
}
GET/members

قائمة الأعضاء

قائمة غنية للأعضاء تشمل كل البيانات الأساسية والفرع والمدرب الأساسي. بيانات الاشتراكات تظل خلف subscriptions:read ولا تتسرب عبر members:read.

الصلاحية المطلوبةmembers:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

search
string

بحث بالاسم أو الهاتف أو واتساب أو الكود أو البريد.

status
string

active / frozen / inactive / banned

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "member_uuid",
    "branchId": "branch_uuid",
    "branchName": "Main Branch",
    "branchCode": "R01",
    "code": "1007",
    "fullName": "Ahmed Ali",
    "email": "[email protected]",
    "phone": "0501234567",
    "whatsapp": "0501234567",
    "gender": "male",
    "birthDate": "1998-02-10",
    "emergencyContactName": "Mohamed Ali",
    "emergencyContactPhone": "0500000000",
    "nationalId": "...",
    "passportNumber": null,
    "status": "active",
    "mainCoachId": "coach_uuid",
    "mainCoachName": "Coach Ahmed",
    "notes": null,
    "cards": [
      {
        "cardUid": "GD1007",
        "cardType": "barcode",
        "status": "active"
      }
    ],
    "activeSubscription": {
      "id": "subscription_uuid",
      "planName": "Monthly",
      "endDate": "2026-10-30",
      "status": "active"
    },
    "attendanceSummary": {
      "totalAllowedVisits": 34,
      "visitsThisMonth": 9,
      "lastVisitAt": "2026-09-30T18:00:00Z"
    },
    "paymentSummary": {
      "totalPaid": "1250.00",
      "paymentsCount": 5,
      "lastPaymentAt": "2026-09-20T10:00:00Z"
    },
    "privateCoachingSummary": {
      "enrollmentsCount": 1,
      "activeEnrollments": 1
    }
  }
}
GET/members/:id

الملف الكامل للعضو

يرجع كل حقول العضو الموجودة في GymDesk: الفرع، الكود، البريد، الهاتف، واتساب، النوع، الميلاد، بيانات الطوارئ، الرقم القومي أو الجواز، الحالة، المدرب، الملاحظات والكروت. ولو المفتاح يملك Scopes إضافية يضيف أحدث اشتراك وملخص الحضور والمدفوعات والحصص الخاصة.

الصلاحية المطلوبةmembers:read

Parameters

idrequired
UUID · path

معرف العضو.

POST
Example requestCURL
curl --request POST 'https://api.gymdesk-system.com/api/v1/external/v1/members' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "branchId": "branch_uuid",
  "fullName": "Ahmed Ali",
  "phone": "0501234567",
  "email": "[email protected]",
  "whatsapp": "0501234567",
  "gender": "male",
  "birthDate": "1998-02-10",
  "emergencyContactName": "Mohamed Ali",
  "emergencyContactPhone": "0500000000",
  "mainCoachId": "coach_uuid",
  "status": "active"
}'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "member_uuid",
    "code": "1008",
    "fullName": "Ahmed Ali",
    "status": "active"
  }
}
POST/members

إضافة عضو

ينشئ عضوًا جديدًا مع كل حقول الملف الأساسية. الكود يمكن تركه فارغًا ليتم توليده تلقائيًا.

الصلاحية المطلوبةmembers:write

Request body

branchIdrequired
UUID

الفرع.

fullNamerequired
string

الاسم الكامل.

phonerequired
string

الهاتف.

email
email

البريد.

whatsapp
string

واتساب.

gender
male | female

النوع.

birthDate
date

تاريخ الميلاد.

emergencyContactName
string

اسم جهة الطوارئ.

emergencyContactPhone
string

هاتف الطوارئ.

nationalId
string

الرقم القومي عند الحاجة.

passportNumber
string

رقم الجواز عند الحاجة.

mainCoachId
UUID

المدرب الأساسي.

status
string

حالة العضو.

notes
string

ملاحظات.

PATCH
Example requestCURL
curl --request PATCH 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "fullName": "Ahmed Ali Updated",
  "status": "active"
}'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "member_uuid",
    "fullName": "Ahmed Ali Updated",
    "status": "active"
  }
}
PATCH/members/:id

تعديل عضو

يعدل أي جزء من الملف الأساسي للعضو مع نفس التحقق من الجيم والفروع والمدرب.

الصلاحية المطلوبةmembers:write

Request body

fullName
string

الاسم.

phone
string

الهاتف.

whatsapp
string

واتساب.

email
email

البريد.

status
string

الحالة.

mainCoachId
UUID

المدرب الأساسي.

notes
string

الملاحظات.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid/cards' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "card_uuid",
      "cardUid": "GD1007",
      "cardType": "barcode",
      "status": "active",
      "assignedAt": "2026-09-01T09:00:00Z"
    }
  ]
}
GET/members/:id/cards

كروت العضو

يعرض كل الكروت والباركود المرتبطة بعضو واحد وحالتها.

الصلاحية المطلوبةmembers:read
GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/member-cards?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "card_uuid",
      "memberId": "member_uuid",
      "memberName": "Ahmed Ali",
      "cardUid": "GD1007",
      "cardType": "barcode",
      "status": "active"
    }
  ]
}
GET/member-cards

قائمة الكروت

يعرض كروت الأعضاء على مستوى الجيم مع التصفية بالفرع والعضو والحالة.

الصلاحية المطلوبةmembers:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

status
string

حالة الكارت.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid/subscriptions?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "subscription_uuid",
      "planName": "Monthly",
      "startDate": "2026-09-01",
      "endDate": "2026-09-30",
      "paidAmount": "250.00",
      "remainingAmount": "0.00",
      "status": "active"
    }
  ]
}
GET/members/:id/subscriptions

اشتراكات عضو

تاريخ اشتراكات عضو محدد بالكامل بشكل Paginated.

الصلاحية المطلوبةsubscriptions:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid/payments?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "payment_uuid",
      "amount": "250.00",
      "paymentMethod": "cash",
      "paymentType": "subscription",
      "paidAt": "2026-09-01T10:00:00Z"
    }
  ]
}
GET/members/:id/payments

مدفوعات عضو

تاريخ مدفوعات عضو محدد مع طريقة الدفع والمراجع ومصدر الحركة.

الصلاحية المطلوبةpayments:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid/attendance?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "attendance_uuid",
      "branchName": "Main Branch",
      "deviceName": "Gate 1",
      "direction": "in",
      "result": "allowed",
      "checkedAt": "2026-09-30T18:00:00Z"
    }
  ]
}
GET/members/:id/attendance

حضور عضو

كل سجلات دخول وخروج عضو محدد مع الجهاز والفرع والنتيجة وسبب الرفض إن وجد.

الصلاحية المطلوبةattendance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/members/member_uuid/private-coaching' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "enrollment_uuid",
      "coachName": "Coach Ahmed",
      "planName": "PT 12",
      "status": "active",
      "totalPrice": "1200.00",
      "remainingAmount": "0.00",
      "progressSummary": "Improving"
    }
  ]
}
GET/members/:id/private-coaching

الحصص الخاصة للعضو

يعرض كل Enrollments الخاصة بعضو مع المدرب والخطة والسعر والتقدم.

الصلاحية المطلوبةprivate_coaching:read

الاشتراكات

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/membership-plans?branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "plan_uuid",
      "name": "Monthly",
      "durationDays": 30,
      "price": "250.00",
      "allowedVisits": null,
      "includesPrivateSessions": 0,
      "freezeAllowedDays": 3,
      "isActive": true
    }
  ]
}
GET/membership-plans

خطط العضوية

يعرض كل تفاصيل خطط العضوية: المدة، السعر، الزيارات، الحصص الخاصة وأيام التجميد.

الصلاحية المطلوبةsubscriptions:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
active | inactive

اختياري لتصفية الخطط.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/membership-plans/plan_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "plan_uuid",
    "name": "Monthly",
    "durationDays": 30,
    "price": "250.00",
    "freezeAllowedDays": 3,
    "isActive": true
  }
}
GET/membership-plans/:id

تفاصيل خطة عضوية

يعرض خطة عضوية واحدة بكامل بياناتها.

الصلاحية المطلوبةsubscriptions:read

Parameters

idrequired
UUID · path

معرف الخطة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/subscriptions?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "subscription_uuid",
      "memberName": "Ahmed Ali",
      "memberCode": "1007",
      "planName": "Monthly",
      "startDate": "2026-09-01",
      "endDate": "2026-09-30",
      "price": "250.00",
      "paidAmount": "250.00",
      "remainingAmount": "0.00",
      "status": "active"
    }
  ]
}
GET/subscriptions

كل الاشتراكات

يعرض الاشتراكات مع العضو والخطة والسعر والخصم والمدفوع والمتبقي والحالة.

الصلاحية المطلوبةsubscriptions:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

status
string

حالة الاشتراك.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/subscriptions/subscription_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "subscription_uuid",
    "memberName": "Ahmed Ali",
    "planName": "Monthly",
    "status": "active",
    "freezes": [
      {
        "startDate": "2026-09-10",
        "endDate": "2026-09-12",
        "daysCount": 3,
        "status": "completed"
      }
    ]
  }
}
GET/subscriptions/:id

تفاصيل اشتراك

يرجع الاشتراك كاملًا ومعه Freeze history الخاصة به.

الصلاحية المطلوبةsubscriptions:read

المدفوعات والفواتير

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/payments?page=1&limit=50&memberId=member_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "payment_uuid",
      "memberName": "Ahmed Ali",
      "amount": "250.00",
      "paymentMethod": "card",
      "paymentType": "subscription",
      "paymentReference": "REF123",
      "settlementStatus": "immediate",
      "paidAt": "2026-09-01T10:00:00Z"
    }
  ]
}
GET/payments

كل المدفوعات

يعرض المدفوعات بكل حقول الربط المهمة: العضو، الاشتراك، الفاتورة، الحساب البنكي، الطريقة، النوع، المراجع، العمولة وحالة التسوية.

الصلاحية المطلوبةpayments:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

subscriptionId
UUID

فلترة باشتراك.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/payments/payment_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "payment_uuid",
    "memberId": "member_uuid",
    "amount": "250.00",
    "paymentMethod": "cash",
    "sourceType": "subscription_initial",
    "settlementStatus": "immediate"
  }
}
GET/payments/:id

تفاصيل دفعة

يرجع حركة دفع واحدة بكل بياناتها التشغيلية الآمنة.

الصلاحية المطلوبةpayments:read
GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/invoices?page=1&limit=50&status=issued' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "invoice_uuid",
      "invoiceNumber": "INV-10023",
      "countryCode": "SA",
      "currency": "SAR",
      "totalAmount": "287.50",
      "status": "issued",
      "issueDate": "2026-09-01T10:00:00Z"
    }
  ]
}
GET/invoices

الفواتير المالية

يعرض الفواتير الضريبية/المالية مع المبالغ والعملة وSnapshot العميل وQR الآمن، بدون Raw provider secrets.

الصلاحية المطلوبةpayments:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

status
issued | void | draft

حالة الفاتورة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/invoices/invoice_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "invoice_uuid",
    "invoiceNumber": "INV-10023",
    "sellerSnapshot": {},
    "customerSnapshot": {},
    "itemsSnapshot": [],
    "taxSettingsSnapshot": {},
    "totalAmount": "287.50",
    "status": "issued"
  }
}
GET/invoices/:id

تفاصيل فاتورة

يرجع Snapshot كامل للفاتورة: البائع، العميل، العناصر، إعدادات الضريبة، المصدر والـQR المتاح.

الصلاحية المطلوبةpayments:read

الحضور

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/attendance?branchId=branch_uuid&page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "attendance_uuid",
      "memberId": "member_uuid",
      "direction": "in",
      "result": "allowed",
      "checkedAt": "2026-09-30T18:00:00Z"
    }
  ]
}
GET/attendance

سجلات الحضور

يعرض حضور فرع محدد مع التاريخ والنتيجة والعضو والاتجاه. branchId مطلوب لهذا المسار.

الصلاحية المطلوبةattendance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchIdrequired
UUID

فلترة حسب فرع مسموح للمفتاح.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

POST
Example requestCURL
curl --request POST 'https://api.gymdesk-system.com/api/v1/external/v1/attendance' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "branchId": "branch_uuid",
  "memberId": "member_uuid",
  "direction": "in"
}'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "attendance_uuid",
    "memberId": "member_uuid",
    "source": "external_api",
    "result": "allowed"
  }
}
POST/attendance

تسجيل حضور

يسجل حضورًا عبر Attendance Service الأصلية، لذلك يطبق التحقق من العضو والفرع والاشتراك والـduplicate attendance.

الصلاحية المطلوبةattendance:write

Request body

branchIdrequired
UUID

الفرع.

memberId
UUID

معرف العضو.

memberSearch
string

بديل memberId: كود/هاتف/بحث عضو.

direction
in | out | check_in | check_out

اتجاه الحركة.

checkedAt
ISO datetime

وقت مخصص اختياري.

الكلاسات

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/classes/types?branchId=branch_uuid&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "class_type_uuid",
      "name": "Boxing",
      "nameAr": "ملاكمة",
      "category": "combat",
      "defaultCapacity": 20,
      "durationMinutes": 60,
      "isActive": true
    }
  ]
}
GET/classes/types

أنواع الكلاسات

أنواع الكلاسات: الاسم العربي/الإنجليزي، التصنيف، السعة، المدة والحالة.

الصلاحية المطلوبةclasses:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
active | inactive

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/classes/instructors?branchId=branch_uuid&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "instructor_uuid",
      "source": "gym_coach",
      "coachId": "coach_uuid",
      "name": "Coach Ahmed",
      "status": "active"
    }
  ]
}
GET/classes/instructors

مدربو الكلاسات

يعرض مدربي الكلاسات سواء Coach داخلي أو Instructor خارجي.

الصلاحية المطلوبةclasses:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/classes/contracts?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "contract_uuid",
      "instructorName": "Coach Ahmed",
      "agreedSessions": 12,
      "agreementAmount": "3000.00",
      "status": "active"
    }
  ]
}
GET/classes/contracts

عقود الكلاسات

يعرض عقود المدربين وعدد الجلسات والقيمة والعمولة وحالة العقد.

الصلاحية المطلوبةclasses:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

حالة العقد.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/classes/sessions?page=1&limit=50&branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "session_uuid",
      "instructorName": "Coach Ahmed",
      "classTypeName": "Boxing",
      "sessionDate": "2026-09-30T19:00:00Z",
      "durationMinutes": 60,
      "attendeesCount": 14
    }
  ]
}
GET/classes/sessions

جلسات الكلاسات

يعرض الجلسات الفعلية: النوع، المدرب، التاريخ، المدة وعدد الحضور.

الصلاحية المطلوبةclasses:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

الحصص الخاصة

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/private-coaching/plans?branchId=branch_uuid&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "pt_plan_uuid",
      "coachName": "Coach Ahmed",
      "name": "PT 12",
      "sessionsCount": 12,
      "durationDays": 30,
      "price": "1200.00",
      "isActive": true
    }
  ]
}
GET/private-coaching/plans

خطط الحصص الخاصة

خطط الـPT مع المدرب وعدد الحصص والمدة والسعر وإعداد العمولة.

الصلاحية المطلوبةprivate_coaching:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

coachId
UUID

المدرب.

status
active | inactive

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/private-coaching/enrollments?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "enrollment_uuid",
      "memberName": "Ahmed Ali",
      "coachName": "Coach Ahmed",
      "planName": "PT 12",
      "totalPrice": "1200.00",
      "paidAmount": "1200.00",
      "remainingAmount": "0.00",
      "status": "active",
      "coachPayoutStatus": "eligible"
    }
  ]
}
GET/private-coaching/enrollments

اشتراكات الحصص الخاصة

يعرض العضو والمدرب والخطة والتواريخ والسعر والمدفوع والمتبقي وحالة عمولة المدرب والتقدم.

الصلاحية المطلوبةprivate_coaching:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

coachId
UUID

المدرب.

status
string

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/private-coaching/sessions?page=1&limit=50&memberId=member_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "pt_session_uuid",
      "memberName": "Ahmed Ali",
      "coachName": "Coach Ahmed",
      "sessionDate": "2026-09-30T17:00:00Z",
      "status": "completed",
      "durationMinutes": 60,
      "performanceScore": 8
    }
  ]
}
GET/private-coaching/sessions

جلسات الحصص الخاصة

يعرض جلسات PT مع الأداء والمدة والحالة والملاحظات.

الصلاحية المطلوبةprivate_coaching:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

coachId
UUID

المدرب.

status
string

الحالة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/private-coaching/progress?page=1&limit=50&memberId=member_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "progress_uuid",
      "memberName": "Ahmed Ali",
      "progressDate": "2026-09-30",
      "weightKg": "82.40",
      "bodyFatPercentage": "18.20",
      "measurements": {
        "waist": 86
      },
      "progressRating": 8
    }
  ]
}
GET/private-coaching/progress

تقدم الحصص الخاصة

يعرض قياسات وتقدم العضو: الوزن، نسبة الدهون، measurements، القوة والتقييم.

الصلاحية المطلوبةprivate_coaching:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

coachId
UUID

المدرب.

المبيعات والمخزون

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/sales/products?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "product_uuid",
      "name": "Protein Shake",
      "sku": "PS01",
      "barcode": "123456",
      "purchasePrice": "50.00",
      "salePrice": "85.00",
      "stockQuantity": 42,
      "minStockQuantity": 5,
      "isActive": true
    }
  ]
}
GET/sales/products

منتجات المبيعات

يعرض المنتج، SKU، الباركود، الصورة، سعر الشراء والبيع والمخزون والحد الأدنى.

الصلاحية المطلوبةsales:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

search
string

بحث بالاسم/SKU/باركود.

category
string

التصنيف.

status
active | inactive

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/sales/products/product_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "product_uuid",
    "name": "Protein Shake",
    "stockQuantity": 42,
    "salePrice": "85.00"
  }
}
GET/sales/products/:id

تفاصيل منتج

تفاصيل منتج واحد وحالة مخزونه.

الصلاحية المطلوبةsales:read
GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/sales/invoices?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "sales_invoice_uuid",
      "invoiceNo": "S-1002",
      "memberName": "Ahmed Ali",
      "totalAmount": "170.00",
      "grossProfit": "70.00",
      "paymentMethod": "cash",
      "status": "completed",
      "soldAt": "2026-09-30T14:00:00Z"
    }
  ]
}
GET/sales/invoices

فواتير المبيعات

يعرض فواتير الـPOS مع العميل والإجماليات والتكلفة والربح والدفع والحالة.

الصلاحية المطلوبةsales:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

memberId
UUID

فلترة حسب عضو محدد.

status
string

الحالة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/sales/invoices/sales_invoice_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "sales_invoice_uuid",
    "invoiceNo": "S-1002",
    "totalAmount": "170.00",
    "items": [
      {
        "productName": "Protein Shake",
        "quantity": 2,
        "unitPrice": "85.00",
        "lineProfit": "70.00"
      }
    ]
  }
}
GET/sales/invoices/:id

تفاصيل فاتورة مبيعات

يرجع الفاتورة ومعها كل البنود والكميات والأسعار والتكلفة والربح لكل بند.

الصلاحية المطلوبةsales:read
GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/sales/inventory-movements?page=1&limit=50&productId=product_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "movement_uuid",
      "productName": "Protein Shake",
      "movementType": "sale",
      "quantityChange": -2,
      "stockAfter": 42,
      "referenceType": "sales_invoice",
      "referenceId": "sales_invoice_uuid"
    }
  ]
}
GET/sales/inventory-movements

حركات المخزون

يعرض حركة المخزون قبل/بعد البيع أو التعديل مع المرجع والملاحظات.

الصلاحية المطلوبةsales:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

productId
UUID

المنتج.

المالية

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/expenses?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "expense_uuid",
      "category": "maintenance",
      "title": "Treadmill service",
      "amount": "450.00",
      "expenseDate": "2026-09-30",
      "paidByName": "Owner"
    }
  ]
}
GET/expenses

المصروفات

يعرض المصروفات الأساسية مع الفئة والعنوان والمبلغ والتاريخ ومن قام بالدفع.

الصلاحية المطلوبةfinance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

category
string

الفئة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/finance/summary?branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "monthIncome": "82000.00",
    "monthExpenses": "24000.00",
    "monthNet": 58000,
    "todayIncome": "4200.00",
    "todayExpenses": "500.00",
    "paymentsCount": 181,
    "expensesCount": 38
  }
}
GET/finance/summary

ملخص المالية

ملخص سريع لإيرادات ومصروفات الشهر واليوم وصافي الشهر داخل الفروع المسموحة.

الصلاحية المطلوبةfinance:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/finance/bank-accounts?status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "bank_uuid",
      "name": "Main Bank",
      "accountName": "Power House Gym",
      "accountNumber": "...",
      "iban": "SA...",
      "currency": "SAR",
      "currentBalance": "50000.00",
      "isDefault": true,
      "status": "active"
    }
  ]
}
GET/finance/bank-accounts

الحسابات البنكية

يعرض الحسابات البنكية المسجلة للجيم مع الرصيد والعملة والعمولة وIBAN. استخدم هذا الـScope فقط للتكاملات المالية الموثوقة.

الصلاحية المطلوبةfinance:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/finance/bank-transactions?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "bank_tx_uuid",
      "bankAccountName": "Main Bank",
      "sourceType": "payment",
      "direction": "credit",
      "amount": "250.00",
      "reference": "REF123",
      "transactionAt": "2026-09-30T12:00:00Z"
    }
  ]
}
GET/finance/bank-transactions

حركات البنك

يعرض حركات الخصم والإضافة المرتبطة بالحسابات البنكية ومصدر كل حركة.

الصلاحية المطلوبةfinance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/finance/cash-shifts?page=1&limit=50&status=open' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "cash_shift_uuid",
      "openedByName": "Omar",
      "openingCash": "1000.00",
      "expectedCash": "4800.00",
      "actualCash": "4790.00",
      "difference": "-10.00",
      "status": "closed"
    }
  ]
}
GET/finance/cash-shifts

ورديات الكاشير

يعرض فتح وإغلاق ورديات الكاشير والرصيد المتوقع والفعلي والفرق.

الصلاحية المطلوبةfinance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
open | closed

الحالة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/finance/refunds?page=1&limit=50&status=pending' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "refund_uuid",
      "paymentId": "payment_uuid",
      "amount": "100.00",
      "reason": "Customer request",
      "status": "pending",
      "requestedByName": "Owner",
      "payoutMethod": null
    }
  ]
}
GET/finance/refunds

طلبات الاسترجاع

يعرض طلبات الاسترجاع، الدفعة الأصلية، المبلغ، السبب، المراجعة وطريقة رد الأموال.

الصلاحية المطلوبةfinance:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
pending | approved | rejected

الحالة.

الأجهزة الرياضية

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/equipment?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "equipment_uuid",
      "name": "Treadmill 1",
      "code": "TM01",
      "brand": "Matrix",
      "status": "active",
      "nextMaintenanceAt": "2026-10-10",
      "maintenanceCost": "0.00"
    }
  ]
}
GET/equipment

الأجهزة الرياضية

كل أجهزة الجيم مع الأكواد والسيريال والموقع والضمان والحالة والصيانة القادمة.

الصلاحية المطلوبةequipment:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

search
string

بحث بالاسم أو الكود أو السيريال.

category
string

التصنيف.

status
string

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/equipment/equipment_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "id": "equipment_uuid",
    "name": "Treadmill 1",
    "status": "under_maintenance",
    "issueDescription": "Belt noise",
    "maintenanceLogs": [
      {
        "action": "inspection",
        "cost": "100.00",
        "performedAt": "2026-09-29T10:00:00Z"
      }
    ]
  }
}
GET/equipment/:id

تفاصيل جهاز رياضي

يرجع كل تفاصيل الجهاز ومعها Maintenance logs كاملة.

الصلاحية المطلوبةequipment:read

أجهزة الدخول

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/devices?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "device_uuid",
      "name": "Gate 1",
      "deviceCode": "FK-01",
      "deviceType": "gate",
      "connectionMode": "tcp",
      "status": "active",
      "lastSeenAt": "2026-09-30T17:30:00Z"
    }
  ]
}
GET/devices

أجهزة الحضور والبوابات

يعرض أجهزة الدخول المسجلة: النوع، طريقة الاتصال، الحالة، آخر ظهور وFirmware.

الصلاحية المطلوبةdevices:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

الحالة.

الزيارات اليومية

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/daily-sessions?page=1&limit=50' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "daily_uuid",
      "playerName": "Visitor Name",
      "phone": "05...",
      "price": "80.00",
      "paidAmount": "80.00",
      "paymentMethod": "cash",
      "visitedAt": "2026-09-30T14:00:00Z",
      "status": "completed"
    }
  ]
}
GET/daily-sessions

زيارات اليوم الواحد

يعرض زوار اليوم الواحد غير المشتركين مع السعر والمدفوع وطريقة الدفع ووقت الزيارة والحالة.

الصلاحية المطلوبةdaily_sessions:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

search
string

بحث بالاسم أو الهاتف.

status
string

الحالة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

الرواتب

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/payroll/profiles?page=1&limit=50&status=active' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "profile_uuid",
      "employeeName": "Omar Hassan",
      "employeeType": "staff",
      "jobTitle": "Reception",
      "baseSalary": "5000.00",
      "currency": "SAR",
      "status": "active"
    }
  ]
}
GET/payroll/profiles

ملفات الرواتب

يعرض ملف التوظيف والراتب الأساسي والمسمى الوظيفي والدرجة والعملة والحالة للموظف أو المدرب.

الصلاحية المطلوبةpayroll:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
string

الحالة.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/payroll/runs?page=1&limit=50&status=paid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": [
    {
      "id": "run_uuid",
      "employeeName": "Omar Hassan",
      "payrollMonth": "2026-09-01",
      "baseSalarySnapshot": "5000.00",
      "bonusesTotal": "300.00",
      "deductionsTotal": "100.00",
      "netSalary": "5200.00",
      "status": "paid",
      "paidAt": "2026-09-28T12:00:00Z"
    }
  ]
}
GET/payroll/runs

تشغيلات الرواتب

يعرض راتب الشهر، الأساس، المكافآت، الخصومات، الصافي، الحالة وتاريخ الدفع.

الصلاحية المطلوبةpayroll:read

Parameters

page
integer

رقم الصفحة، يبدأ من 1.

limit
integer

من 1 إلى 200، الافتراضي 50.

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

status
draft | approved | paid

الحالة.

startDate
ISO date/datetime

بداية الفترة.

endDate
ISO date/datetime

نهاية الفترة.

الداشبورد والتقارير

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/dashboard/summary?branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "members": {
      "total": 520,
      "active": 470
    },
    "subscriptions": {
      "total": 610,
      "active": 455
    },
    "attendanceToday": 132,
    "paymentsThisMonth": {
      "total": "82000.00",
      "count": 181
    },
    "expensesThisMonth": {
      "total": "24000.00",
      "count": 38
    },
    "salesThisMonth": {
      "total": "12500.00",
      "count": 82
    },
    "coaches": {
      "active": 8
    },
    "equipment": {
      "total": 46,
      "maintenance": 3
    }
  }
}
GET/dashboard/summary

ملخص الداشبورد

KPIs جاهزة للموبايل أو لوحة خارجية: الأعضاء، الاشتراكات، حضور اليوم، الإيرادات والمصروفات والمبيعات والمدربين والأجهزة.

الصلاحية المطلوبةdashboard:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.

GET
Example requestCURL
curl --request GET 'https://api.gymdesk-system.com/api/v1/external/v1/reports/overview?branchId=branch_uuid' \
  --header 'Authorization: Bearer gym_live_YOUR_API_KEY' \
  --header 'Accept: application/json'
Example response200 OK
{
  "success": true,
  "data": {
    "memberStatus": [
      {
        "status": "active",
        "count": 470
      }
    ],
    "subscriptionStatus": [
      {
        "status": "active",
        "count": 455
      }
    ],
    "paymentMethods": [
      {
        "paymentMethod": "cash",
        "amount": "42000.00",
        "count": 96
      }
    ],
    "attendanceLast30Days": [
      {
        "day": "2026-09-30",
        "visits": 132
      }
    ]
  }
}
GET/reports/overview

تقرير تشغيلي مجمع

Aggregates جاهزة للرسم والتحليل: توزيع حالات الأعضاء والاشتراكات، طرق الدفع، وحضور آخر 30 يوم.

الصلاحية المطلوبةreports:read

Parameters

branchId
UUID

فلترة حسب فرع مسموح للمفتاح.