كل الموارد

الأسطول

المركبات والسائقون والمجموعات والمناطق والمسارات ومهام التوزيع والركاب.

عنوان الأساسhttps://api.ping.nml.sa/v144 عملية

الانتقال إلى عملية

الأخطاء المشتركة

تُرجع عمليات هذه الصفحة هذه الأخطاء بصيغة واحدة، وتذكر كل عملية الأخطاء التي تُرجعها.

  • 400The request is invalid (code: invalid_request), with field errors.
  • 401The API key is missing, unknown, expired or revoked (code: unauthorized).
  • 403The API key lacks the scope this operation needs (code: forbidden).
  • 404No such resource in this account, or outside the key's data scope (code: not_found).
  • 409The resource is not in a state that allows this (code: conflict), or the idempotency key is in use.
  • 429The key's rate limit is reached (code: rate_limited). Retry after the Retry-After header's seconds.

جلسات توجيه السائقين

GET/v1/coaching-sessions

Coaching sessions held with the account's drivers, newest first; with driver, one driver's.

النطاقfleet:read

المعاملات

  • driverstring الاستعلام

    Only this driver's sessions

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • driver_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • coachstring

      Who held it (the caller)

      مثال:user:usr_4Kd9

    • focusstring

      أحد:harsh_brakingharsh_accelerationharsh_corneringoverspeed

    • notestring | null

      مثال:Reviewed the three braking events on the Dammam run

    • score_at_sessioninteger | null

      مثال:58

    • follow_up_onstring (date)

      مثال:2026-12-01

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/coaching-sessions" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "driver_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "at": "2026-11-17T08:30:00Z",
      "coach": "user:usr_4Kd9",
      "focus": "harsh_braking",
      "note": "Reviewed the three braking events on the Dammam run",
      "score_at_session": 58,
      "follow_up_on": "2026-12-01"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

تسجيل جلسة توجيه

POST/v1/coaching-sessions

Records a coaching session with a driver: what it focused on, the score then, a note and when to follow up. The coach is the caller.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • driver_idstring مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • focusstring مطلوب

    أحد:harsh_brakingharsh_accelerationharsh_corneringoverspeed

  • notestring | null

    مثال:Reviewed the three braking events on the Dammam run

  • score_at_sessioninteger | null

    مثال:58

  • follow_up_onstring (date) مطلوب

    مثال:2026-12-01

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • driver_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • coachstring

    Who held it (the caller)

    مثال:user:usr_4Kd9

  • focusstring

    أحد:harsh_brakingharsh_accelerationharsh_corneringoverspeed

  • notestring | null

    مثال:Reviewed the three braking events on the Dammam run

  • score_at_sessioninteger | null

    مثال:58

  • follow_up_onstring (date)

    مثال:2026-12-01

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/coaching-sessions" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"driver_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d", "focus": "harsh_braking", "note": "Reviewed the three braking events on the Dammam run", "score_at_session": 58, "follow_up_on": "2026-12-01"}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "driver_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "at": "2026-11-17T08:30:00Z",
  "coach": "user:usr_4Kd9",
  "focus": "harsh_braking",
  "note": "Reviewed the three braking events on the Dammam run",
  "score_at_session": 58,
  "follow_up_on": "2026-12-01"
}

عرض قائمة السائقين

GET/v1/drivers

Lists the account's drivers by name.

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

  • leftboolean الاستعلام

    true lists the drivers who have left instead.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      The name in Latin letters

      مثال:Faisal Al-Harbi

    • name_arstring | null

      The name in Arabic

      مثال:فيصل الحربي

    • department_idstring | null

      The account department the driver belongs to

    • phone_e164string | null

      Job links are sent here on WhatsApp

    • national_idstring | null

      A Saudi driver's national ID, the number their licence is issued on

    • iqama_numberstring | null

      A resident driver's Iqama, the number their licence is issued on

    • licence_classesstring[]

      The classes the driving licence holds

    • licence_expirystring | null (date)

      مثال:2028-05-14

    • ibutton_idstring | null

      The iButton key that identifies the driver in the vehicle (hex)

      مثال:01A2B3C4D5E6

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • updated_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • left_onstring | null (date)

      The day the driver left the account; null while employed

    • leave_reasonstring | null
  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/drivers" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "Faisal Al-Harbi",
      "name_ar": "فيصل الحربي",
      "department_id": "string",
      "phone_e164": "+966551234567",
      "national_id": "1012345678",
      "iqama_number": "2412345678",
      "licence_classes": [
        "private"
      ],
      "licence_expiry": "2028-05-14",
      "ibutton_id": "01A2B3C4D5E6",
      "created_at": "2026-11-17T08:30:00Z",
      "updated_at": "2026-11-17T08:30:00Z",
      "left_on": "string",
      "leave_reason": "resigned"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إضافة سائق

POST/v1/drivers

Registers a driver with a WhatsApp number for job links, the ID or Iqama their licence is issued on, the licence's classes and expiry, and an iButton key for identification (driver.changed).

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring مطلوب

    مثال:Faisal Al-Harbi

  • name_arstring | null

    مثال:فيصل الحربي

  • department_idstring | null
  • phone_e164string | null
  • national_idstring | null

    Not with iqama_number

  • iqama_numberstring | null

    Not with national_id

  • licence_classesstring[]
  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    مثال:01A2B3C4D5E6

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    The name in Latin letters

    مثال:Faisal Al-Harbi

  • name_arstring | null

    The name in Arabic

    مثال:فيصل الحربي

  • department_idstring | null

    The account department the driver belongs to

  • phone_e164string | null

    Job links are sent here on WhatsApp

  • national_idstring | null

    A Saudi driver's national ID, the number their licence is issued on

  • iqama_numberstring | null

    A resident driver's Iqama, the number their licence is issued on

  • licence_classesstring[]

    The classes the driving licence holds

  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    The iButton key that identifies the driver in the vehicle (hex)

    مثال:01A2B3C4D5E6

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • left_onstring | null (date)

    The day the driver left the account; null while employed

  • leave_reasonstring | null

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/drivers" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Faisal Al-Harbi", "name_ar": "فيصل الحربي", "licence_expiry": "2028-05-14", "ibutton_id": "01A2B3C4D5E6"}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Faisal Al-Harbi",
  "name_ar": "فيصل الحربي",
  "department_id": "string",
  "phone_e164": "+966551234567",
  "national_id": "1012345678",
  "iqama_number": "2412345678",
  "licence_classes": [
    "private"
  ],
  "licence_expiry": "2028-05-14",
  "ibutton_id": "01A2B3C4D5E6",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "left_on": "string",
  "leave_reason": "resigned"
}

عرض بيانات سائق

GET/v1/drivers/{driverId}

Returns one driver, in the account or having left it.

النطاقfleet:read

المعاملات

  • driverIdstring المسار مطلوب

    مثال:019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    The name in Latin letters

    مثال:Faisal Al-Harbi

  • name_arstring | null

    The name in Arabic

    مثال:فيصل الحربي

  • department_idstring | null

    The account department the driver belongs to

  • phone_e164string | null

    Job links are sent here on WhatsApp

  • national_idstring | null

    A Saudi driver's national ID, the number their licence is issued on

  • iqama_numberstring | null

    A resident driver's Iqama, the number their licence is issued on

  • licence_classesstring[]

    The classes the driving licence holds

  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    The iButton key that identifies the driver in the vehicle (hex)

    مثال:01A2B3C4D5E6

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • left_onstring | null (date)

    The day the driver left the account; null while employed

  • leave_reasonstring | null

الأخطاء

401403404429

  • 400Missing proof or the wrong code (error: otp, proof_photo, proof_signature, invalid, kind, no_file, too_large, not_image)
مثال الطلب
curl "https://api.ping.nml.sa/v1/drivers/019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Faisal Al-Harbi",
  "name_ar": "فيصل الحربي",
  "department_id": "string",
  "phone_e164": "+966551234567",
  "national_id": "1012345678",
  "iqama_number": "2412345678",
  "licence_classes": [
    "private"
  ],
  "licence_expiry": "2028-05-14",
  "ibutton_id": "01A2B3C4D5E6",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "left_on": "string",
  "leave_reason": "resigned"
}

تعديل بيانات سائق

PATCH/v1/drivers/{driverId}

Changes the fields sent; a field sent as null is cleared. The name cannot be cleared; licence_classes sent replaces the classes held.

النطاقfleet:write

المعاملات

  • driverIdstring المسار مطلوب

    مثال:019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f

محتوى الطلب

  • namestring

    مثال:Faisal Al-Harbi

  • name_arstring | null

    مثال:فيصل الحربي

  • department_idstring | null
  • phone_e164string | null
  • national_idstring | null
  • iqama_numberstring | null
  • licence_classesstring[]
  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    مثال:01A2B3C4D5E6

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    The name in Latin letters

    مثال:Faisal Al-Harbi

  • name_arstring | null

    The name in Arabic

    مثال:فيصل الحربي

  • department_idstring | null

    The account department the driver belongs to

  • phone_e164string | null

    Job links are sent here on WhatsApp

  • national_idstring | null

    A Saudi driver's national ID, the number their licence is issued on

  • iqama_numberstring | null

    A resident driver's Iqama, the number their licence is issued on

  • licence_classesstring[]

    The classes the driving licence holds

  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    The iButton key that identifies the driver in the vehicle (hex)

    مثال:01A2B3C4D5E6

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • left_onstring | null (date)

    The day the driver left the account; null while employed

  • leave_reasonstring | null

الأخطاء

400401403404429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/drivers/019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Faisal Al-Harbi", "name_ar": "فيصل الحربي", "licence_expiry": "2028-05-14", "ibutton_id": "01A2B3C4D5E6"}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Faisal Al-Harbi",
  "name_ar": "فيصل الحربي",
  "department_id": "string",
  "phone_e164": "+966551234567",
  "national_id": "1012345678",
  "iqama_number": "2412345678",
  "licence_classes": [
    "private"
  ],
  "licence_expiry": "2028-05-14",
  "ibutton_id": "01A2B3C4D5E6",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "left_on": "string",
  "leave_reason": "resigned"
}

تسجيل مغادرة سائق

POST/v1/drivers/{driverId}/leave

The driver leaves the account on the date given: their record and history stay, their open driver session ends, and they move to the former drivers.

النطاقfleet:write

المعاملات

  • driverIdstring المسار مطلوب

    مثال:019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f

محتوى الطلب

  • reasonstring مطلوب

    أحد:resigneddismissedcontract_endedother

  • onstring (date) مطلوب

    The last day in the account

    مثال:2026-11-30

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    The name in Latin letters

    مثال:Faisal Al-Harbi

  • name_arstring | null

    The name in Arabic

    مثال:فيصل الحربي

  • department_idstring | null

    The account department the driver belongs to

  • phone_e164string | null

    Job links are sent here on WhatsApp

  • national_idstring | null

    A Saudi driver's national ID, the number their licence is issued on

  • iqama_numberstring | null

    A resident driver's Iqama, the number their licence is issued on

  • licence_classesstring[]

    The classes the driving licence holds

  • licence_expirystring | null (date)

    مثال:2028-05-14

  • ibutton_idstring | null

    The iButton key that identifies the driver in the vehicle (hex)

    مثال:01A2B3C4D5E6

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • left_onstring | null (date)

    The day the driver left the account; null while employed

  • leave_reasonstring | null

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/drivers/019ac0c4-7a2b-7c3d-8e4f-5a6b7c8d9e0f/leave" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "resigned", "on": "2026-11-30"}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Faisal Al-Harbi",
  "name_ar": "فيصل الحربي",
  "department_id": "string",
  "phone_e164": "+966551234567",
  "national_id": "1012345678",
  "iqama_number": "2412345678",
  "licence_classes": [
    "private"
  ],
  "licence_expiry": "2028-05-14",
  "ibutton_id": "01A2B3C4D5E6",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "left_on": "string",
  "leave_reason": "resigned"
}

عرض المناطق الجغرافية

GET/v1/geofences

Lists the account's geofences by name, each as a GeoJSON polygon or a circle (a point with radius_m).

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:Main depot

    • kindstring

      depot: the account's own base; site: a place it works at; customer: a customer's premises; restricted: an area to keep out of; workshop: where vehicles are serviced; fuel: a fuel station

      أحد:depotsitecustomerrestrictedworkshopfuel

    • geometryPolygon | Point

      A Polygon, or a Point that is the centre of a circle of radius_m.

      مثال:{"type":"Point","coordinates":[46.6753,24.7136]}

    • radius_minteger | null

      The circle's radius in metres; null for a polygon

      مثال:500

    • speed_limit_kmhinteger | null

      Speed limit inside the geofence, km/h

      مثال:40

    • cargo_min_cnumber | null

      A customer site's cargo range: new jobs to it start with it (cold chain)

      مثال:2

    • cargo_max_cnumber | null

      مثال:8

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • updated_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/geofences" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "Main depot",
      "kind": "depot",
      "geometry": {
        "type": "Point",
        "coordinates": [
          46.6753,
          24.7136
        ]
      },
      "radius_m": 500,
      "speed_limit_kmh": 40,
      "cargo_min_c": 2,
      "cargo_max_c": 8,
      "created_at": "2026-11-17T08:30:00Z",
      "updated_at": "2026-11-17T08:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إنشاء منطقة جغرافية

POST/v1/geofences

Creates a circle (a GeoJSON Point and radius_m) or a GeoJSON Polygon, in WGS 84 longitude and latitude (geofence.changed).

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring مطلوب

    مثال:Main depot

  • kindstring

    depot: the account's own base; site: a place it works at; customer: a customer's premises; restricted: an area to keep out of; workshop: where vehicles are serviced; fuel: a fuel station

    أحد:depotsitecustomerrestrictedworkshopfuel

  • geometryPolygon | Point مطلوب

    A Polygon, or a Point that is the centre of a circle of radius_m.

    مثال:{"type":"Point","coordinates":[46.6753,24.7136]}

  • radius_minteger | null

    Required with a Point; not allowed with a Polygon

    مثال:500

  • speed_limit_kmhinteger | null

    مثال:40

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Main depot

  • kindstring

    depot: the account's own base; site: a place it works at; customer: a customer's premises; restricted: an area to keep out of; workshop: where vehicles are serviced; fuel: a fuel station

    أحد:depotsitecustomerrestrictedworkshopfuel

  • geometryPolygon | Point

    A Polygon, or a Point that is the centre of a circle of radius_m.

    مثال:{"type":"Point","coordinates":[46.6753,24.7136]}

  • radius_minteger | null

    The circle's radius in metres; null for a polygon

    مثال:500

  • speed_limit_kmhinteger | null

    Speed limit inside the geofence, km/h

    مثال:40

  • cargo_min_cnumber | null

    A customer site's cargo range: new jobs to it start with it (cold chain)

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/geofences" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Main depot", "kind": "depot", "geometry": {"type": "Point", "coordinates": [46.6753, 24.7136]}, "radius_m": 500, "speed_limit_kmh": 40, "cargo_min_c": 2, "cargo_max_c": 8}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Main depot",
  "kind": "depot",
  "geometry": {
    "type": "Point",
    "coordinates": [
      46.6753,
      24.7136
    ]
  },
  "radius_m": 500,
  "speed_limit_kmh": 40,
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z"
}

تعديل منطقة جغرافية

PATCH/v1/geofences/{geofenceId}

Changes the fields sent. A new geometry replaces the shape; radius_m alone resizes a circle; a cargo bound sent as null is cleared.

النطاقfleet:write

المعاملات

  • geofenceIdstring المسار مطلوب

    مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

محتوى الطلب

  • namestring

    مثال:Main depot

  • kindstring

    depot: the account's own base; site: a place it works at; customer: a customer's premises; restricted: an area to keep out of; workshop: where vehicles are serviced; fuel: a fuel station

    أحد:depotsitecustomerrestrictedworkshopfuel

  • geometryPolygon | Point

    A Polygon, or a Point that is the centre of a circle of radius_m.

    مثال:{"type":"Point","coordinates":[46.6753,24.7136]}

  • radius_minteger

    مثال:750

  • speed_limit_kmhinteger | null

    مثال:40

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Main depot

  • kindstring

    depot: the account's own base; site: a place it works at; customer: a customer's premises; restricted: an area to keep out of; workshop: where vehicles are serviced; fuel: a fuel station

    أحد:depotsitecustomerrestrictedworkshopfuel

  • geometryPolygon | Point

    A Polygon, or a Point that is the centre of a circle of radius_m.

    مثال:{"type":"Point","coordinates":[46.6753,24.7136]}

  • radius_minteger | null

    The circle's radius in metres; null for a polygon

    مثال:500

  • speed_limit_kmhinteger | null

    Speed limit inside the geofence, km/h

    مثال:40

  • cargo_min_cnumber | null

    A customer site's cargo range: new jobs to it start with it (cold chain)

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/geofences/019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Main depot", "kind": "depot", "geometry": {"type": "Point", "coordinates": [46.6753, 24.7136]}, "radius_m": 750, "speed_limit_kmh": 40, "cargo_min_c": 2, "cargo_max_c": 8}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Main depot",
  "kind": "depot",
  "geometry": {
    "type": "Point",
    "coordinates": [
      46.6753,
      24.7136
    ]
  },
  "radius_m": 500,
  "speed_limit_kmh": 40,
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z"
}

حذف منطقة جغرافية

DELETE/v1/geofences/{geofenceId}

Deletes the geofence permanently; stops picked from it keep their place and lose the link.

النطاقfleet:write

المعاملات

  • geofenceIdstring المسار مطلوب

    مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

الاستجابة 204

Deleted

الأخطاء

400401403404429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/geofences/019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a" \
  -H "Authorization: Bearer $PING_API_KEY"

عرض مجموعات المركبات

GET/v1/groups

Lists the account's vehicle groups by name with their vehicles. A department-scoped key sees only its vehicles in each group.

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:Riyadh deliveries

    • vehicle_idsstring[]
    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/groups" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "Riyadh deliveries",
      "vehicle_ids": [
        "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d"
      ],
      "created_at": "2026-11-17T08:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إنشاء مجموعة مركبات

POST/v1/groups

Creates a named group of the account's vehicles.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring مطلوب

    مثال:Riyadh deliveries

  • vehicle_idsstring[]

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Riyadh deliveries

  • vehicle_idsstring[]
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/groups" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Riyadh deliveries"}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Riyadh deliveries",
  "vehicle_ids": [
    "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d"
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

تعديل مجموعة مركبات

PATCH/v1/groups/{groupId}

Renames the group, and adds or removes vehicles (a vehicle both added and removed is refused). A department-scoped key changes only its own vehicles in it.

النطاقfleet:write

المعاملات

  • groupIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

محتوى الطلب

  • namestring

    مثال:Riyadh deliveries

  • add_vehicle_idsstring[]
  • remove_vehicle_idsstring[]

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Riyadh deliveries

  • vehicle_idsstring[]
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/groups/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Riyadh deliveries"}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Riyadh deliveries",
  "vehicle_ids": [
    "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d"
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

حذف مجموعة مركبات

DELETE/v1/groups/{groupId}

Deletes the group; its vehicles are not changed. A department-scoped key deletes only a group holding none but its own vehicles.

النطاقfleet:write

المعاملات

  • groupIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Riyadh deliveries

  • vehicle_idsstring[]
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404409429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/groups/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Riyadh deliveries",
  "vehicle_ids": [
    "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d"
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

عرض المهام

GET/v1/jobs

Lists jobs, latest scheduled first, filtered by status, vehicle and day (Asia/Riyadh). A department-scoped key sees jobs of its vehicles and jobs without a vehicle.

النطاقfleet:read

المعاملات

  • statusstring الاستعلام

    Only jobs in this status

    مثال:draft

  • vehiclestring الاستعلام

    Only jobs of this vehicle

  • daystring (date) الاستعلام

    Only jobs scheduled (or, unscheduled, created) on this day in Asia/Riyadh

  • coldboolean الاستعلام

    Only jobs that carry a cold-chain load (a cargo temperature range)

  • fromstring (date-time) الاستعلام

    Only jobs not finished (completed, failed or cancelled) before this time

  • tostring (date-time) الاستعلام

    Only jobs started (or, not started, scheduled or created) before this time

  • departmentstring الاستعلام

    Only jobs planned for this department, or on its vehicles

  • with_stopsboolean الاستعلام

    Include each job's stops

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • refstring

      مثال:J-2611-4821

    • statusstring

      أحد:draftdispatchedin_progresscompletedfailedcancelled

    • vehicle_idstring | null
    • plate_codestring | null

      The vehicle's plate

    • driver_idstring | null
    • driverstring | null

      The driver's name

      مثال:Faisal Al-Harbi

    • scheduled_atstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • started_atstring | null (date-time)

      The first arrival at a stop

    • completed_atstring | null (date-time)
    • cargo_min_cnumber | null

      مثال:2

    • cargo_max_cnumber | null

      مثال:8

    • cargostring | null

      مثال:Dairy, chilled

    • palletsinteger | null

      مثال:12

    • department_idstring | null
    • requires_kindstring | null
    • stopsobject[]

      The job's stops in order, with with_stops=true

      حقول stops
      • idstring

        مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

      • seqinteger

        Order in the job, from 1

        مثال:1

      • kindstring

        أحد:pickupdrop

      • namestring

        مثال:Al Olaya branch

      • latnumber

        مثال:24.6951

      • lonnumber

        مثال:46.6857

      • radius_minteger

        مثال:150

      • contact_phonestring | null
      • window_fromstring | null (date-time)

        مثال:2026-11-17T09:00:00Z

      • window_tostring | null (date-time)

        مثال:2026-11-17T11:00:00Z

      • statusstring

        أحد:pendingarriveddonefailedskipped

      • eta_atstring | null (date-time)

        Estimated arrival from the vehicle's position

      • arrived_atstring | null (date-time)
      • departed_atstring | null (date-time)
      • done_atstring | null (date-time)

        When the stop was done, failed or skipped

      • service_mininteger

        Minutes spent at the stop

        مثال:15

      • geofence_idstring | null

        The geofence (customer site) the stop was picked from

        مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

    • first_stopstring | null

      The first stop's name

      مثال:Sudair dairy plant

    • last_stopstring | null

      The last stop's name

      مثال:Al Olaya branch

    • dispositionstring | null
    • stop_countinteger

      مثال:4

    • stops_doneinteger

      مثال:1

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/jobs" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "ref": "J-2611-4821",
      "status": "draft",
      "vehicle_id": "string",
      "plate_code": "2070SKD",
      "driver_id": "string",
      "driver": "Faisal Al-Harbi",
      "scheduled_at": "2026-11-17T09:00:00Z",
      "created_at": "2026-11-17T08:30:00Z",
      "started_at": "string",
      "completed_at": "string",
      "cargo_min_c": 2,
      "cargo_max_c": 8,
      "cargo": "Dairy, chilled",
      "pallets": 12,
      "department_id": "string",
      "requires_kind": "truck",
      "stops": [
        {
          "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
          "seq": 1,
          "kind": "drop",
          "name": "Al Olaya branch",
          "lat": 24.6951,
          "lon": 46.6857,
          "radius_m": 150,
          "contact_phone": "+966551234567",
          "window_from": "2026-11-17T09:00:00Z",
          "window_to": "2026-11-17T11:00:00Z",
          "status": "pending",
          "eta_at": "string",
          "arrived_at": "string",
          "departed_at": "string",
          "done_at": "string",
          "service_min": 15,
          "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
        }
      ],
      "first_stop": "Sudair dairy plant",
      "last_stop": "Al Olaya branch",
      "disposition": "quarantined",
      "stop_count": 4,
      "stops_done": 1
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إنشاء مهمة

POST/v1/jobs

Creates a draft job with its stops in order, the proof each stop needs, and optionally its vehicle, driver and cargo temperature range.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • vehicle_idstring | null

    Needed to dispatch

  • driver_idstring | null

    Defaults at dispatch to the vehicle's current driver

  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    What the job carries

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for (its board), whether or not it has a vehicle

  • requires_kindstring | null

    The kind of vehicle the job needs

  • stopsobject[] مطلوب
    حقول stops
    • kindstring مطلوب

      أحد:pickupdrop

    • namestring مطلوب

      مثال:Al Olaya branch

    • latnumber مطلوب

      Latitude, within Saudi Arabia

      مثال:24.6951

    • lonnumber مطلوب

      Longitude, within Saudi Arabia

      مثال:46.6857

    • radius_minteger

      The vehicle has arrived within this distance

      مثال:150

    • contact_phonestring | null

      Receives the tracking link and, with proof otp, the code

    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      After window_from

      مثال:2026-11-17T11:00:00Z

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • refstring

    The reference shown to drivers and recipients

    مثال:J-2611-4821

  • statusstring

    أحد:draftdispatchedin_progresscompletedfailedcancelled

  • route_idstring | null

    The saved route the job was made from

  • vehicle_idstring | null
  • driver_idstring | null
  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for

  • requires_kindstring | null
  • dispositionobject | null

    What the receiver did with the load after a breach

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • dispatched_atstring | null (date-time)
  • started_atstring | null (date-time)

    The first arrival at a stop

  • completed_atstring | null (date-time)

    When the job completed or failed

  • cancelled_atstring | null (date-time)
  • stopsobject[]
    حقول stops
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • seqinteger

      Order in the job, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      مثال:2026-11-17T11:00:00Z

    • statusstring

      أحد:pendingarriveddonefailedskipped

    • eta_atstring | null (date-time)

      Estimated arrival from the vehicle's position

    • arrived_atstring | null (date-time)
    • departed_atstring | null (date-time)
    • done_atstring | null (date-time)

      When the stop was done, failed or skipped

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

  • eventsobject[]
    حقول events
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring | null
    • codestring

      أحد:createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelled

    • actorstring

      Who acted: user:, agent:, system: or driver:

      مثال:system:fleet

    • latnumber | null

      مثال:24.6951

    • lonnumber | null

      مثال:46.6857

    • notestring | null
    • atstring (date-time)

      مثال:2026-11-17T09:41:00Z

  • proofsobject[]
    حقول proofs
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      photo, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code

      أحد:photosignatureotpnote

    • received_bystring | null

      Who received the delivery, as the driver wrote it

      مثال:Store manager

    • atstring (date-time)

      مثال:2026-11-17T09:48:00Z

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/jobs" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scheduled_at": "2026-11-17T09:00:00Z", "proof": ["photo", "otp"], "cargo_min_c": 2, "cargo_max_c": 8, "notes": "Deliver to the loading bay.", "cargo": "Dairy, chilled", "pallets": 12, "stops": [{"kind": "drop", "name": "Al Olaya branch", "lat": 24.6951, "lon": 46.6857, "radius_m": 150, "contact_phone": "+966551234567", "window_from": "2026-11-17T09:00:00Z", "window_to": "2026-11-17T11:00:00Z", "service_min": 15, "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"}]}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "ref": "J-2611-4821",
  "status": "draft",
  "route_id": "string",
  "vehicle_id": "string",
  "driver_id": "string",
  "scheduled_at": "2026-11-17T09:00:00Z",
  "proof": [
    "photo",
    "otp"
  ],
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "notes": "Deliver to the loading bay.",
  "cargo": "Dairy, chilled",
  "pallets": 12,
  "department_id": "string",
  "requires_kind": "truck",
  "disposition": {
    "outcome": "quarantined",
    "reason": "string",
    "receiver_name": "Store manager",
    "recorded_by": "user:usr_Qm4rT8wZ1",
    "recorded_at": "2026-11-17T10:12:00Z"
  },
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "dispatched_at": "string",
  "started_at": "string",
  "completed_at": "string",
  "cancelled_at": "string",
  "stops": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "2026-11-17T09:00:00Z",
      "window_to": "2026-11-17T11:00:00Z",
      "status": "pending",
      "eta_at": "string",
      "arrived_at": "string",
      "departed_at": "string",
      "done_at": "string",
      "service_min": 15,
      "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
    }
  ],
  "events": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "string",
      "code": "arrived",
      "actor": "system:fleet",
      "lat": 24.6951,
      "lon": 46.6857,
      "note": "string",
      "at": "2026-11-17T09:41:00Z"
    }
  ],
  "proofs": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "otp",
      "received_by": "Store manager",
      "at": "2026-11-17T09:48:00Z"
    }
  ]
}

عرض تفاصيل مهمة

GET/v1/jobs/{jobId}

Returns a job with its stops, its event history and the proofs collected at each stop.

النطاقfleet:read

المعاملات

  • jobIdstring المسار مطلوب

    مثال:019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • refstring

    The reference shown to drivers and recipients

    مثال:J-2611-4821

  • statusstring

    أحد:draftdispatchedin_progresscompletedfailedcancelled

  • route_idstring | null

    The saved route the job was made from

  • vehicle_idstring | null
  • driver_idstring | null
  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for

  • requires_kindstring | null
  • dispositionobject | null

    What the receiver did with the load after a breach

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • dispatched_atstring | null (date-time)
  • started_atstring | null (date-time)

    The first arrival at a stop

  • completed_atstring | null (date-time)

    When the job completed or failed

  • cancelled_atstring | null (date-time)
  • stopsobject[]
    حقول stops
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • seqinteger

      Order in the job, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      مثال:2026-11-17T11:00:00Z

    • statusstring

      أحد:pendingarriveddonefailedskipped

    • eta_atstring | null (date-time)

      Estimated arrival from the vehicle's position

    • arrived_atstring | null (date-time)
    • departed_atstring | null (date-time)
    • done_atstring | null (date-time)

      When the stop was done, failed or skipped

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

  • eventsobject[]
    حقول events
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring | null
    • codestring

      أحد:createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelled

    • actorstring

      Who acted: user:, agent:, system: or driver:

      مثال:system:fleet

    • latnumber | null

      مثال:24.6951

    • lonnumber | null

      مثال:46.6857

    • notestring | null
    • atstring (date-time)

      مثال:2026-11-17T09:41:00Z

  • proofsobject[]
    حقول proofs
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      photo, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code

      أحد:photosignatureotpnote

    • received_bystring | null

      Who received the delivery, as the driver wrote it

      مثال:Store manager

    • atstring (date-time)

      مثال:2026-11-17T09:48:00Z

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "ref": "J-2611-4821",
  "status": "draft",
  "route_id": "string",
  "vehicle_id": "string",
  "driver_id": "string",
  "scheduled_at": "2026-11-17T09:00:00Z",
  "proof": [
    "photo",
    "otp"
  ],
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "notes": "Deliver to the loading bay.",
  "cargo": "Dairy, chilled",
  "pallets": 12,
  "department_id": "string",
  "requires_kind": "truck",
  "disposition": {
    "outcome": "quarantined",
    "reason": "string",
    "receiver_name": "Store manager",
    "recorded_by": "user:usr_Qm4rT8wZ1",
    "recorded_at": "2026-11-17T10:12:00Z"
  },
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "dispatched_at": "string",
  "started_at": "string",
  "completed_at": "string",
  "cancelled_at": "string",
  "stops": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "2026-11-17T09:00:00Z",
      "window_to": "2026-11-17T11:00:00Z",
      "status": "pending",
      "eta_at": "string",
      "arrived_at": "string",
      "departed_at": "string",
      "done_at": "string",
      "service_min": 15,
      "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
    }
  ],
  "events": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "string",
      "code": "arrived",
      "actor": "system:fleet",
      "lat": 24.6951,
      "lon": 46.6857,
      "note": "string",
      "at": "2026-11-17T09:41:00Z"
    }
  ],
  "proofs": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "otp",
      "received_by": "Store manager",
      "at": "2026-11-17T09:48:00Z"
    }
  ]
}

إلغاء مهمة

POST/v1/jobs/{jobId}/cancel

Cancels a job that has not finished and revokes its tracking links (job.cancelled).

النطاقfleet:write

المعاملات

  • jobIdstring المسار مطلوب

    مثال:019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • refstring

    The reference shown to drivers and recipients

    مثال:J-2611-4821

  • statusstring

    أحد:draftdispatchedin_progresscompletedfailedcancelled

  • route_idstring | null

    The saved route the job was made from

  • vehicle_idstring | null
  • driver_idstring | null
  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for

  • requires_kindstring | null
  • dispositionobject | null

    What the receiver did with the load after a breach

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • dispatched_atstring | null (date-time)
  • started_atstring | null (date-time)

    The first arrival at a stop

  • completed_atstring | null (date-time)

    When the job completed or failed

  • cancelled_atstring | null (date-time)
  • stopsobject[]
    حقول stops
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • seqinteger

      Order in the job, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      مثال:2026-11-17T11:00:00Z

    • statusstring

      أحد:pendingarriveddonefailedskipped

    • eta_atstring | null (date-time)

      Estimated arrival from the vehicle's position

    • arrived_atstring | null (date-time)
    • departed_atstring | null (date-time)
    • done_atstring | null (date-time)

      When the stop was done, failed or skipped

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

  • eventsobject[]
    حقول events
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring | null
    • codestring

      أحد:createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelled

    • actorstring

      Who acted: user:, agent:, system: or driver:

      مثال:system:fleet

    • latnumber | null

      مثال:24.6951

    • lonnumber | null

      مثال:46.6857

    • notestring | null
    • atstring (date-time)

      مثال:2026-11-17T09:41:00Z

  • proofsobject[]
    حقول proofs
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      photo, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code

      أحد:photosignatureotpnote

    • received_bystring | null

      Who received the delivery, as the driver wrote it

      مثال:Store manager

    • atstring (date-time)

      مثال:2026-11-17T09:48:00Z

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b/cancel" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "ref": "J-2611-4821",
  "status": "draft",
  "route_id": "string",
  "vehicle_id": "string",
  "driver_id": "string",
  "scheduled_at": "2026-11-17T09:00:00Z",
  "proof": [
    "photo",
    "otp"
  ],
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "notes": "Deliver to the loading bay.",
  "cargo": "Dairy, chilled",
  "pallets": 12,
  "department_id": "string",
  "requires_kind": "truck",
  "disposition": {
    "outcome": "quarantined",
    "reason": "string",
    "receiver_name": "Store manager",
    "recorded_by": "user:usr_Qm4rT8wZ1",
    "recorded_at": "2026-11-17T10:12:00Z"
  },
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "dispatched_at": "string",
  "started_at": "string",
  "completed_at": "string",
  "cancelled_at": "string",
  "stops": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "2026-11-17T09:00:00Z",
      "window_to": "2026-11-17T11:00:00Z",
      "status": "pending",
      "eta_at": "string",
      "arrived_at": "string",
      "departed_at": "string",
      "done_at": "string",
      "service_min": 15,
      "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
    }
  ],
  "events": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "string",
      "code": "arrived",
      "actor": "system:fleet",
      "lat": 24.6951,
      "lon": 46.6857,
      "note": "string",
      "at": "2026-11-17T09:41:00Z"
    }
  ],
  "proofs": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "otp",
      "received_by": "Store manager",
      "at": "2026-11-17T09:48:00Z"
    }
  ]
}

إرسال مهمة إلى السائق

POST/v1/jobs/{jobId}/dispatch

Sends a draft job to its driver by WhatsApp link and each stop's contact a tracking link (job.dispatched). The job needs a vehicle; the driver defaults to the vehicle's current driver.

النطاقfleet:write

المعاملات

  • jobIdstring المسار مطلوب

    مثال:019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • refstring

    The reference shown to drivers and recipients

    مثال:J-2611-4821

  • statusstring

    أحد:draftdispatchedin_progresscompletedfailedcancelled

  • route_idstring | null

    The saved route the job was made from

  • vehicle_idstring | null
  • driver_idstring | null
  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for

  • requires_kindstring | null
  • dispositionobject | null

    What the receiver did with the load after a breach

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • dispatched_atstring | null (date-time)
  • started_atstring | null (date-time)

    The first arrival at a stop

  • completed_atstring | null (date-time)

    When the job completed or failed

  • cancelled_atstring | null (date-time)
  • stopsobject[]
    حقول stops
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • seqinteger

      Order in the job, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      مثال:2026-11-17T11:00:00Z

    • statusstring

      أحد:pendingarriveddonefailedskipped

    • eta_atstring | null (date-time)

      Estimated arrival from the vehicle's position

    • arrived_atstring | null (date-time)
    • departed_atstring | null (date-time)
    • done_atstring | null (date-time)

      When the stop was done, failed or skipped

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

  • eventsobject[]
    حقول events
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring | null
    • codestring

      أحد:createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelled

    • actorstring

      Who acted: user:, agent:, system: or driver:

      مثال:system:fleet

    • latnumber | null

      مثال:24.6951

    • lonnumber | null

      مثال:46.6857

    • notestring | null
    • atstring (date-time)

      مثال:2026-11-17T09:41:00Z

  • proofsobject[]
    حقول proofs
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      photo, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code

      أحد:photosignatureotpnote

    • received_bystring | null

      Who received the delivery, as the driver wrote it

      مثال:Store manager

    • atstring (date-time)

      مثال:2026-11-17T09:48:00Z

  • driver_linkstring | null

    The driver's job link, also sent to the driver on WhatsApp; null when the job was not dispatched

    مثال:https://example.com/drive#019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d.q8XcT0vW

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b/dispatch" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "ref": "J-2611-4821",
  "status": "draft",
  "route_id": "string",
  "vehicle_id": "string",
  "driver_id": "string",
  "scheduled_at": "2026-11-17T09:00:00Z",
  "proof": [
    "photo",
    "otp"
  ],
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "notes": "Deliver to the loading bay.",
  "cargo": "Dairy, chilled",
  "pallets": 12,
  "department_id": "string",
  "requires_kind": "truck",
  "disposition": {
    "outcome": "quarantined",
    "reason": "string",
    "receiver_name": "Store manager",
    "recorded_by": "user:usr_Qm4rT8wZ1",
    "recorded_at": "2026-11-17T10:12:00Z"
  },
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "dispatched_at": "string",
  "started_at": "string",
  "completed_at": "string",
  "cancelled_at": "string",
  "stops": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "2026-11-17T09:00:00Z",
      "window_to": "2026-11-17T11:00:00Z",
      "status": "pending",
      "eta_at": "string",
      "arrived_at": "string",
      "departed_at": "string",
      "done_at": "string",
      "service_min": 15,
      "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
    }
  ],
  "events": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "string",
      "code": "arrived",
      "actor": "system:fleet",
      "lat": 24.6951,
      "lon": 46.6857,
      "note": "string",
      "at": "2026-11-17T09:41:00Z"
    }
  ],
  "proofs": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "otp",
      "received_by": "Store manager",
      "at": "2026-11-17T09:48:00Z"
    }
  ],
  "driver_link": "https://example.com/drive#019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d.q8XcT0vW"
}

عرض رحلات الركاب

GET/v1/rider-runs

Lists the vehicles' trips that had card taps, latest first, over one day or a range of days (Asia/Riyadh; at most [service.riders] max_days, 31, per call): the first and last tap, the cards nobody holds, and each rider with when they boarded and when they got off after their last board (null when the trip's taps end with them on board).

النطاقfleet:read

المعاملات

  • vehiclestring الاستعلام

    Only this vehicle's runs

  • daystring (date) الاستعلام

    Runs with taps on this day in Asia/Riyadh (or from and to)

  • fromstring (date) الاستعلام

    Runs with taps on or after this day in Asia/Riyadh

  • tostring (date) الاستعلام

    Runs with taps on or before this day in Asia/Riyadh (defaults to from)

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • vehicle_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • plate_codestring

      Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

      مثال:2070SKD

    • trip_keystring

      The vehicle trip (ignition on to off) the taps belong to

    • first_atstring (date-time)

      مثال:2026-11-17T06:42:10Z

    • last_atstring (date-time)

      مثال:2026-11-17T07:21:40Z

    • unknown_cardsstring[]

      Cards tapped that no active rider holds

      مثال:["04FF00AA"]

    • ridersobject[]
      حقول riders
      • rider_idstring

        مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

      • riderstring

        مثال:Sara Al-Qahtani

      • boarded_atstring (date-time)

        مثال:2026-11-17T06:42:10Z

      • alighted_atstring | null (date-time)

        The tap off after the rider's last board; null when they never tapped off

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/rider-runs" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "plate_code": "2070SKD",
      "trip_key": "string",
      "first_at": "2026-11-17T06:42:10Z",
      "last_at": "2026-11-17T07:21:40Z",
      "unknown_cards": [
        "04FF00AA"
      ],
      "riders": [
        {
          "rider_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
          "rider": "Sara Al-Qahtani",
          "boarded_at": "2026-11-17T06:42:10Z",
          "alighted_at": "string"
        }
      ]
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

عرض سجل صعود الركاب ونزولهم

GET/v1/rider-taps

Lists card taps on vehicles, latest first, filtered by vehicle, rider and one day or a range of days (Asia/Riyadh; at most [service.riders] max_days, 31, per call): who boarded, who alighted, and cards nobody holds.

النطاقfleet:read

المعاملات

  • vehiclestring الاستعلام

    Only taps on this vehicle

  • daystring (date) الاستعلام

    Only taps on this day in Asia/Riyadh (not with from and to)

  • riderstring الاستعلام

    Only this rider's taps

  • fromstring (date) الاستعلام

    Only taps on or after this day in Asia/Riyadh

  • tostring (date) الاستعلام

    Only taps on or before this day in Asia/Riyadh (defaults to from)

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • atstring (date-time)

      مثال:2026-11-17T06:42:10Z

    • kindstring

      unknown: a card no active rider holds

      أحد:boardalightunknown

    • vehicle_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • plate_codestring

      Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

      مثال:2070SKD

    • rider_idstring | null
    • riderstring | null

      The rider's name

      مثال:Sara Al-Qahtani

    • card_idstring

      مثال:04A1B2C3D4

    • trip_keystring

      The vehicle trip (ignition on to off) the tap belongs to

    • latnumber | null

      مثال:24.7136

    • lonnumber | null

      مثال:46.6753

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/rider-taps" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "at": "2026-11-17T06:42:10Z",
      "kind": "board",
      "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "plate_code": "2070SKD",
      "rider_id": "string",
      "rider": "Sara Al-Qahtani",
      "card_id": "04A1B2C3D4",
      "trip_key": "string",
      "lat": 24.7136,
      "lon": 46.6753
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

عرض قائمة الركاب

GET/v1/riders

Lists riders (students) by name with their cards and guardians.

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:Sara Al-Qahtani

    • card_idstring

      مثال:04A1B2C3D4

    • route_idstring | null
    • guardiansobject[]
      حقول guardians
      • namestring | null

        مثال:Noura Al-Qahtani

      • phone_e164string

        Saudi telephone number in E.164 (mobile, landline, VoIP, unified)

        مثال:+966551234567

      • notifyboolean

        مثال:true

    • activeboolean

      مثال:true

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/riders" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "Sara Al-Qahtani",
      "card_id": "04A1B2C3D4",
      "route_id": "string",
      "guardians": [
        {
          "name": "Noura Al-Qahtani",
          "phone_e164": "+966551234567",
          "notify": true
        }
      ],
      "active": true,
      "created_at": "2026-11-17T08:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إضافة راكب

POST/v1/riders

Adds a rider with the card they tap on the vehicle, their route and the guardians notified when they board and alight.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring مطلوب

    مثال:Sara Al-Qahtani

  • card_idstring مطلوب

    The card id as the reader reports it (hex), unique in the account

    مثال:04A1B2C3D4

  • route_idstring | null
  • guardiansobject[]
    حقول guardians
    • namestring | null

      مثال:Noura Al-Qahtani

    • phone_e164string مطلوب

      Saudi telephone number in E.164 (mobile, landline, VoIP, unified)

      مثال:+966551234567

    • notifyboolean

      Message this guardian when the rider boards and alights

      مثال:true

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Sara Al-Qahtani

  • card_idstring

    مثال:04A1B2C3D4

  • route_idstring | null
  • guardiansobject[]
    حقول guardians
    • namestring | null

      مثال:Noura Al-Qahtani

    • phone_e164string

      Saudi telephone number in E.164 (mobile, landline, VoIP, unified)

      مثال:+966551234567

    • notifyboolean

      مثال:true

  • activeboolean

    مثال:true

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/riders" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Sara Al-Qahtani", "card_id": "04A1B2C3D4"}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Sara Al-Qahtani",
  "card_id": "04A1B2C3D4",
  "route_id": "string",
  "guardians": [
    {
      "name": "Noura Al-Qahtani",
      "phone_e164": "+966551234567",
      "notify": true
    }
  ],
  "active": true,
  "created_at": "2026-11-17T08:30:00Z"
}

تعديل بيانات راكب

PATCH/v1/riders/{riderId}

Changes a rider's name, card (a replaced card), route, guardians (the list sent replaces the list held) or whether they still ride (active false: their card then taps as unknown).

النطاقfleet:write

المعاملات

  • riderIdstring المسار مطلوب

    مثال:019ac0c4-cf70-7182-d39e-0f1a2b3c4d5e

محتوى الطلب

  • namestring

    مثال:Sara Al-Qahtani

  • card_idstring

    A replaced card, as the reader reports it (hex), unique in the account

    مثال:04A1B2C3D5

  • route_idstring | null
  • guardiansobject[]
    حقول guardians
    • namestring | null

      مثال:Noura Al-Qahtani

    • phone_e164string مطلوب

      Saudi telephone number in E.164 (mobile, landline, VoIP, unified)

      مثال:+966551234567

    • notifyboolean

      Message this guardian when the rider boards and alights

      مثال:true

  • activeboolean

    false when the rider no longer rides

    مثال:false

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Sara Al-Qahtani

  • card_idstring

    مثال:04A1B2C3D4

  • route_idstring | null
  • guardiansobject[]
    حقول guardians
    • namestring | null

      مثال:Noura Al-Qahtani

    • phone_e164string

      Saudi telephone number in E.164 (mobile, landline, VoIP, unified)

      مثال:+966551234567

    • notifyboolean

      مثال:true

  • activeboolean

    مثال:true

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404409429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/riders/019ac0c4-cf70-7182-d39e-0f1a2b3c4d5e" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Sara Al-Qahtani", "card_id": "04A1B2C3D5", "active": false}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Sara Al-Qahtani",
  "card_id": "04A1B2C3D4",
  "route_id": "string",
  "guardians": [
    {
      "name": "Noura Al-Qahtani",
      "phone_e164": "+966551234567",
      "notify": true
    }
  ],
  "active": true,
  "created_at": "2026-11-17T08:30:00Z"
}

عرض المسارات المحفوظة

GET/v1/routes

Lists saved routes by name, such as a school run or a regular delivery round, with their stops. A department-scoped key sees routes of its vehicles and routes without a vehicle.

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:Morning school run

    • vehicle_idstring | null
    • driver_idstring | null
    • stopsobject[]
      حقول stops
      • seqinteger

        Order in the route, from 1

        مثال:1

      • kindstring

        أحد:pickupdrop

      • namestring

        مثال:Al Olaya branch

      • latnumber

        مثال:24.6951

      • lonnumber

        مثال:46.6857

      • radius_minteger

        مثال:150

      • contact_phonestring | null
      • window_fromstring | null (date-time)
      • window_tostring | null (date-time)
      • service_mininteger

        مثال:15

      • geofence_idstring | null
    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/routes" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "Morning school run",
      "vehicle_id": "string",
      "driver_id": "string",
      "stops": [
        {
          "seq": 1,
          "kind": "drop",
          "name": "Al Olaya branch",
          "lat": 24.6951,
          "lon": 46.6857,
          "radius_m": 150,
          "contact_phone": "+966551234567",
          "window_from": "string",
          "window_to": "string",
          "service_min": 15,
          "geofence_id": "string"
        }
      ],
      "created_at": "2026-11-17T08:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

حفظ مسار

POST/v1/routes

Saves a route's stops, and optionally its vehicle and driver, to run as a job on demand.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • namestring مطلوب

    مثال:Morning school run

  • vehicle_idstring | null
  • driver_idstring | null
  • stopsobject[] مطلوب
    حقول stops
    • kindstring مطلوب

      أحد:pickupdrop

    • namestring مطلوب

      مثال:Al Olaya branch

    • latnumber مطلوب

      Latitude, within Saudi Arabia

      مثال:24.6951

    • lonnumber مطلوب

      Longitude, within Saudi Arabia

      مثال:46.6857

    • radius_minteger

      The vehicle has arrived within this distance

      مثال:150

    • contact_phonestring | null

      Receives the tracking link and, with proof otp, the code

    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      After window_from

      مثال:2026-11-17T11:00:00Z

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Morning school run

  • vehicle_idstring | null
  • driver_idstring | null
  • stopsobject[]
    حقول stops
    • seqinteger

      Order in the route, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)
    • window_tostring | null (date-time)
    • service_mininteger

      مثال:15

    • geofence_idstring | null
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/routes" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Morning school run", "stops": [{"kind": "drop", "name": "Al Olaya branch", "lat": 24.6951, "lon": 46.6857, "radius_m": 150, "contact_phone": "+966551234567", "window_from": "2026-11-17T09:00:00Z", "window_to": "2026-11-17T11:00:00Z", "service_min": 15, "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"}]}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Morning school run",
  "vehicle_id": "string",
  "driver_id": "string",
  "stops": [
    {
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "string",
      "window_to": "string",
      "service_min": 15,
      "geofence_id": "string"
    }
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

تعديل مسار محفوظ

PATCH/v1/routes/{routeId}

Renames the route, sets or clears its vehicle and driver, or replaces its stops (in the order given). Jobs already made from it are not changed.

النطاقfleet:write

المعاملات

  • routeIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

محتوى الطلب

  • namestring

    مثال:Morning school run

  • vehicle_idstring | null
  • driver_idstring | null
  • stopsobject[]
    حقول stops
    • kindstring مطلوب

      أحد:pickupdrop

    • namestring مطلوب

      مثال:Al Olaya branch

    • latnumber مطلوب

      Latitude, within Saudi Arabia

      مثال:24.6951

    • lonnumber مطلوب

      Longitude, within Saudi Arabia

      مثال:46.6857

    • radius_minteger

      The vehicle has arrived within this distance

      مثال:150

    • contact_phonestring | null

      Receives the tracking link and, with proof otp, the code

    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      After window_from

      مثال:2026-11-17T11:00:00Z

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Morning school run

  • vehicle_idstring | null
  • driver_idstring | null
  • stopsobject[]
    حقول stops
    • seqinteger

      Order in the route, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)
    • window_tostring | null (date-time)
    • service_mininteger

      مثال:15

    • geofence_idstring | null
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/routes/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Morning school run"}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Morning school run",
  "vehicle_id": "string",
  "driver_id": "string",
  "stops": [
    {
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "string",
      "window_to": "string",
      "service_min": 15,
      "geofence_id": "string"
    }
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

حذف مسار محفوظ

DELETE/v1/routes/{routeId}

Only while no active rider rides it (409, code route_has_riders: move them or end their riding first). Jobs made from it and riders who left it keep their history without it.

النطاقfleet:write

المعاملات

  • routeIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • namestring

    مثال:Morning school run

  • vehicle_idstring | null
  • driver_idstring | null
  • stopsobject[]
    حقول stops
    • seqinteger

      Order in the route, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)
    • window_tostring | null (date-time)
    • service_mininteger

      مثال:15

    • geofence_idstring | null
  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404409429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/routes/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "name": "Morning school run",
  "vehicle_id": "string",
  "driver_id": "string",
  "stops": [
    {
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "string",
      "window_to": "string",
      "service_min": 15,
      "geofence_id": "string"
    }
  ],
  "created_at": "2026-11-17T08:30:00Z"
}

إنشاء مهمة من مسار محفوظ

POST/v1/routes/{routeId}/run

Creates a draft job from the route's stops, vehicle and driver, scheduled now or at scheduled_at, and dispatches it when dispatch is true.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • routeIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • scheduled_atstring | null (date-time)

    Defaults to unscheduled (now)

    مثال:2026-11-18T06:30:00Z

  • dispatchboolean

    Dispatch the job at once

    مثال:true

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • refstring

    The reference shown to drivers and recipients

    مثال:J-2611-4821

  • statusstring

    أحد:draftdispatchedin_progresscompletedfailedcancelled

  • route_idstring | null

    The saved route the job was made from

  • vehicle_idstring | null
  • driver_idstring | null
  • scheduled_atstring | null (date-time)

    مثال:2026-11-17T09:00:00Z

  • proofstring[]

    مثال:["photo","otp"]

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • notesstring | null

    مثال:Deliver to the loading bay.

  • cargostring | null

    مثال:Dairy, chilled

  • palletsinteger | null

    مثال:12

  • department_idstring | null

    The department the job is planned for

  • requires_kindstring | null
  • dispositionobject | null

    What the receiver did with the load after a breach

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • dispatched_atstring | null (date-time)
  • started_atstring | null (date-time)

    The first arrival at a stop

  • completed_atstring | null (date-time)

    When the job completed or failed

  • cancelled_atstring | null (date-time)
  • stopsobject[]
    حقول stops
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • seqinteger

      Order in the job, from 1

      مثال:1

    • kindstring

      أحد:pickupdrop

    • namestring

      مثال:Al Olaya branch

    • latnumber

      مثال:24.6951

    • lonnumber

      مثال:46.6857

    • radius_minteger

      مثال:150

    • contact_phonestring | null
    • window_fromstring | null (date-time)

      مثال:2026-11-17T09:00:00Z

    • window_tostring | null (date-time)

      مثال:2026-11-17T11:00:00Z

    • statusstring

      أحد:pendingarriveddonefailedskipped

    • eta_atstring | null (date-time)

      Estimated arrival from the vehicle's position

    • arrived_atstring | null (date-time)
    • departed_atstring | null (date-time)
    • done_atstring | null (date-time)

      When the stop was done, failed or skipped

    • service_mininteger

      Minutes spent at the stop

      مثال:15

    • geofence_idstring | null

      The geofence (customer site) the stop was picked from

      مثال:019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a

  • eventsobject[]
    حقول events
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring | null
    • codestring

      أحد:createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelled

    • actorstring

      Who acted: user:, agent:, system: or driver:

      مثال:system:fleet

    • latnumber | null

      مثال:24.6951

    • lonnumber | null

      مثال:46.6857

    • notestring | null
    • atstring (date-time)

      مثال:2026-11-17T09:41:00Z

  • proofsobject[]
    حقول proofs
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • stop_idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      photo, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code

      أحد:photosignatureotpnote

    • received_bystring | null

      Who received the delivery, as the driver wrote it

      مثال:Store manager

    • atstring (date-time)

      مثال:2026-11-17T09:48:00Z

  • driver_linkstring | null

    The driver's job link, also sent to the driver on WhatsApp; null when the job was not dispatched

    مثال:https://example.com/drive#019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d.q8XcT0vW

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/routes/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d/run" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scheduled_at": "2026-11-18T06:30:00Z", "dispatch": true}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "ref": "J-2611-4821",
  "status": "draft",
  "route_id": "string",
  "vehicle_id": "string",
  "driver_id": "string",
  "scheduled_at": "2026-11-17T09:00:00Z",
  "proof": [
    "photo",
    "otp"
  ],
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "notes": "Deliver to the loading bay.",
  "cargo": "Dairy, chilled",
  "pallets": 12,
  "department_id": "string",
  "requires_kind": "truck",
  "disposition": {
    "outcome": "quarantined",
    "reason": "string",
    "receiver_name": "Store manager",
    "recorded_by": "user:usr_Qm4rT8wZ1",
    "recorded_at": "2026-11-17T10:12:00Z"
  },
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "dispatched_at": "string",
  "started_at": "string",
  "completed_at": "string",
  "cancelled_at": "string",
  "stops": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "seq": 1,
      "kind": "drop",
      "name": "Al Olaya branch",
      "lat": 24.6951,
      "lon": 46.6857,
      "radius_m": 150,
      "contact_phone": "+966551234567",
      "window_from": "2026-11-17T09:00:00Z",
      "window_to": "2026-11-17T11:00:00Z",
      "status": "pending",
      "eta_at": "string",
      "arrived_at": "string",
      "departed_at": "string",
      "done_at": "string",
      "service_min": 15,
      "geofence_id": "019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a"
    }
  ],
  "events": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "string",
      "code": "arrived",
      "actor": "system:fleet",
      "lat": 24.6951,
      "lon": 46.6857,
      "note": "string",
      "at": "2026-11-17T09:41:00Z"
    }
  ],
  "proofs": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "stop_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "otp",
      "received_by": "Store manager",
      "at": "2026-11-17T09:48:00Z"
    }
  ],
  "driver_link": "https://example.com/drive#019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d.q8XcT0vW"
}

عرض طلبات المركبات

GET/v1/vehicle-requests

Newest first; with vehicle_id one vehicle's, with state only those in it. A department-scoped key sees its own vehicles' requests and the additions into its departments.

النطاقfleet:read

المعاملات

  • vehicle_idstring الاستعلام

    One vehicle's requests.

  • statestring الاستعلام

    Only requests in this state.

    مثال:pending

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • kindstring

      change: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).

      أحد:changeadd

    • statestring

      أحد:pendingapprovedrejectedwithdrawn

    • vehicle_idstring | null

      A change's vehicle; an addition's once approved

    • department_idstring | null

      The department an addition goes into

    • plate_codestring

      Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

      مثال:2070SKD

    • fieldsstring[]

      The fields asked

    • askedobject

      A vehicle's registered fields (null: not recorded, or not asked when read beside the fields asked).

      حقول asked
      • plateprivate_car | private_light_transport | private_heavy_transport | private_small_bus | private_large_bus | public_light_transport | public_heavy_transport | public_small_bus | public_large_bus | taxi | diplomatic | temporary | public_works | export | motorcycle | trailer | historic | null
      • plate_codestring | null
      • vinstring | null
      • kindstring | null
      • usestring | null
      • makestring | null

        مثال:Toyota

      • modelstring | null

        مثال:Hilux

      • yearinteger | null

        مثال:2024

    • wasobject | null

      A change's values of the fields asked when asked (null for an addition)

    • justificationstring
    • filesobject[]
      حقول files
      • idstring

        مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

      • namestring

        مثال:istimara.pdf

      • content_typestring

        أحد:application/pdfimage/jpegimage/png

      • bytesinteger
    • asked_bystring

      Who asked (user:<id>, ...)

      مثال:user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • asked_atstring (date-time)
    • decided_bystring | null

      Who approved or rejected it (PING's staff), or withdrew it

    • decided_atstring | null (date-time)
    • reasonstring | null

      Why it was rejected

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicle-requests" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "kind": "change",
      "state": "pending",
      "vehicle_id": "string",
      "department_id": "string",
      "plate_code": "2070SKD",
      "fields": [
        "vin"
      ],
      "asked": {
        "plate": {
          "number": "1",
          "letters": "SKD",
          "type": "private_car"
        },
        "plate_code": "2070SKD",
        "vin": "1G4AH59H5G1183441",
        "kind": "truck",
        "use": "light_own_goods",
        "make": "Toyota",
        "model": "Hilux",
        "year": 2024
      },
      "was": {
        "plate": {},
        "plate_code": "2070SKD",
        "vin": "1G4AH59H5G1183441",
        "kind": "truck",
        "use": "light_own_goods",
        "make": "Toyota",
        "model": "Hilux",
        "year": 2024
      },
      "justification": "string",
      "files": [
        {
          "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
          "name": "istimara.pdf",
          "content_type": "application/pdf",
          "bytes": 0
        }
      ],
      "asked_by": "user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "asked_at": "string",
      "decided_by": "string",
      "decided_at": "string",
      "reason": "string"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

طلب تعديل بيانات تسجيل مركبة أو إضافة مركبة

POST/v1/vehicle-requests

A vehicle's registered fields (plate, VIN, kind, use, make, model, year) are PING's (ADR 32). kind change asks for the fields given in fields (only those, each kept with its value now; null clears one but the plate and use); kind add asks for a vehicle with no unit (papers only), every registered field given. A justification is required; 0 to 3 supporting files (PDF, JPEG or PNG, base64, limits in fleet's unit.toml [service.requests]). One request waits per vehicle (409). PING's staff approve it, applying every field at once, or reject it with a reason; the asker and the owners are told (vehicle_request.decided). A department-scoped caller asks only for its departments' vehicles, and adds one only into one of its departments.

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • kindstring مطلوب

    change: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).

    أحد:changeadd

  • vehicle_idstring

    The vehicle a change is for (a change only)

  • department_idstring | null

    The department an added vehicle goes into (an addition only; a department-scoped caller gives one of theirs)

  • fieldsobject مطلوب

    The registered fields asked. A change gives only those it asks for (null clears one; plate and use cannot be cleared); an addition gives every one.

    حقول fields
    • plateobject

      A Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.

      حقول plate
      • numberstring مطلوب

        Saudi plate number (the digits)

        مثال:1

      • lettersstring مطلوب

        Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

        مثال:SKD

      • typestring مطلوب

        Saudi vehicle plate type

        أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

    • vinstring | null
    • kindstring | null
    • usestring

      What the vehicle is used for, as the Kingdom's transport regulations tell uses apart. Each fits some kinds of vehicle.

      أحد:company_carcar_rentalpersonallight_noncommercialexempt_heavypublic_worksheavy_for_hireheavy_own_goodsheavy_noncommerciallight_for_hirelight_own_goodsgoods_vehicle_rentalvehicle_carrying_towingeducationalstaff_buscity_buscharter_busintercity_businternational_busbus_rentaltaximotorcycle_deliverymotorcycle_rentalother

    • makestring | null

      مثال:Toyota

    • modelstring | null

      مثال:Hilux

    • yearinteger | null

      مثال:2024

  • justificationstring مطلوب

    Why: what the papers say

    مثال:The Istimara renewed on 2026-11-20 carries the new plate.

  • filesobject[]

    Supporting files (the Istimara, a letter), 0 to 3

    حقول files
    • namestring مطلوب

      مثال:istimara.pdf

    • content_typestring مطلوب

      أحد:application/pdfimage/jpegimage/png

    • datastring مطلوب

      The file, base64 (at most [service.requests] max_file_bytes decoded; the request at most max_request_bytes)

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    change: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).

    أحد:changeadd

  • statestring

    أحد:pendingapprovedrejectedwithdrawn

  • vehicle_idstring | null

    A change's vehicle; an addition's once approved

  • department_idstring | null

    The department an addition goes into

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fieldsstring[]

    The fields asked

  • askedobject

    A vehicle's registered fields (null: not recorded, or not asked when read beside the fields asked).

    حقول asked
    • plateprivate_car | private_light_transport | private_heavy_transport | private_small_bus | private_large_bus | public_light_transport | public_heavy_transport | public_small_bus | public_large_bus | taxi | diplomatic | temporary | public_works | export | motorcycle | trailer | historic | null
    • plate_codestring | null
    • vinstring | null
    • kindstring | null
    • usestring | null
    • makestring | null

      مثال:Toyota

    • modelstring | null

      مثال:Hilux

    • yearinteger | null

      مثال:2024

  • wasobject | null

    A change's values of the fields asked when asked (null for an addition)

  • justificationstring
  • filesobject[]
    حقول files
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:istimara.pdf

    • content_typestring

      أحد:application/pdfimage/jpegimage/png

    • bytesinteger
  • asked_bystring

    Who asked (user:<id>, ...)

    مثال:user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • asked_atstring (date-time)
  • decided_bystring | null

    Who approved or rejected it (PING's staff), or withdrew it

  • decided_atstring | null (date-time)
  • reasonstring | null

    Why it was rejected

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/vehicle-requests" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "change", "fields": {"plate": {"number": "1", "letters": "SKD", "type": "private_car"}, "vin": "1G4AH59H5G1183441", "kind": "truck", "use": "light_own_goods", "make": "Toyota", "model": "Hilux", "year": 2024}, "justification": "The Istimara renewed on 2026-11-20 carries the new plate."}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "change",
  "state": "pending",
  "vehicle_id": "string",
  "department_id": "string",
  "plate_code": "2070SKD",
  "fields": [
    "vin"
  ],
  "asked": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "was": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "justification": "string",
  "files": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "istimara.pdf",
      "content_type": "application/pdf",
      "bytes": 0
    }
  ],
  "asked_by": "user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "asked_at": "string",
  "decided_by": "string",
  "decided_at": "string",
  "reason": "string"
}

عرض طلب مركبة

GET/v1/vehicle-requests/{requestId}

The fields asked with their values when asked, the justification, the files sent (named, not read back) and the decision.

النطاقfleet:read

المعاملات

  • requestIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    change: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).

    أحد:changeadd

  • statestring

    أحد:pendingapprovedrejectedwithdrawn

  • vehicle_idstring | null

    A change's vehicle; an addition's once approved

  • department_idstring | null

    The department an addition goes into

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fieldsstring[]

    The fields asked

  • askedobject

    A vehicle's registered fields (null: not recorded, or not asked when read beside the fields asked).

    حقول asked
    • plateprivate_car | private_light_transport | private_heavy_transport | private_small_bus | private_large_bus | public_light_transport | public_heavy_transport | public_small_bus | public_large_bus | taxi | diplomatic | temporary | public_works | export | motorcycle | trailer | historic | null
    • plate_codestring | null
    • vinstring | null
    • kindstring | null
    • usestring | null
    • makestring | null

      مثال:Toyota

    • modelstring | null

      مثال:Hilux

    • yearinteger | null

      مثال:2024

  • wasobject | null

    A change's values of the fields asked when asked (null for an addition)

  • justificationstring
  • filesobject[]
    حقول files
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:istimara.pdf

    • content_typestring

      أحد:application/pdfimage/jpegimage/png

    • bytesinteger
  • asked_bystring

    Who asked (user:<id>, ...)

    مثال:user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • asked_atstring (date-time)
  • decided_bystring | null

    Who approved or rejected it (PING's staff), or withdrew it

  • decided_atstring | null (date-time)
  • reasonstring | null

    Why it was rejected

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicle-requests/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "change",
  "state": "pending",
  "vehicle_id": "string",
  "department_id": "string",
  "plate_code": "2070SKD",
  "fields": [
    "vin"
  ],
  "asked": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "was": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "justification": "string",
  "files": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "istimara.pdf",
      "content_type": "application/pdf",
      "bytes": 0
    }
  ],
  "asked_by": "user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "asked_at": "string",
  "decided_by": "string",
  "decided_at": "string",
  "reason": "string"
}

سحب طلب مركبة

POST/v1/vehicle-requests/{requestId}/withdraw

Only while pending (409 otherwise).

النطاقfleet:write

المعاملات

  • requestIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • kindstring

    change: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).

    أحد:changeadd

  • statestring

    أحد:pendingapprovedrejectedwithdrawn

  • vehicle_idstring | null

    A change's vehicle; an addition's once approved

  • department_idstring | null

    The department an addition goes into

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fieldsstring[]

    The fields asked

  • askedobject

    A vehicle's registered fields (null: not recorded, or not asked when read beside the fields asked).

    حقول asked
    • plateprivate_car | private_light_transport | private_heavy_transport | private_small_bus | private_large_bus | public_light_transport | public_heavy_transport | public_small_bus | public_large_bus | taxi | diplomatic | temporary | public_works | export | motorcycle | trailer | historic | null
    • plate_codestring | null
    • vinstring | null
    • kindstring | null
    • usestring | null
    • makestring | null

      مثال:Toyota

    • modelstring | null

      مثال:Hilux

    • yearinteger | null

      مثال:2024

  • wasobject | null

    A change's values of the fields asked when asked (null for an addition)

  • justificationstring
  • filesobject[]
    حقول files
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • namestring

      مثال:istimara.pdf

    • content_typestring

      أحد:application/pdfimage/jpegimage/png

    • bytesinteger
  • asked_bystring

    Who asked (user:<id>, ...)

    مثال:user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • asked_atstring (date-time)
  • decided_bystring | null

    Who approved or rejected it (PING's staff), or withdrew it

  • decided_atstring | null (date-time)
  • reasonstring | null

    Why it was rejected

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/vehicle-requests/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e/withdraw" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "kind": "change",
  "state": "pending",
  "vehicle_id": "string",
  "department_id": "string",
  "plate_code": "2070SKD",
  "fields": [
    "vin"
  ],
  "asked": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "was": {
    "plate": {
      "number": "1",
      "letters": "SKD",
      "type": "private_car"
    },
    "plate_code": "2070SKD",
    "vin": "1G4AH59H5G1183441",
    "kind": "truck",
    "use": "light_own_goods",
    "make": "Toyota",
    "model": "Hilux",
    "year": 2024
  },
  "justification": "string",
  "files": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "name": "istimara.pdf",
      "content_type": "application/pdf",
      "bytes": 0
    }
  ],
  "asked_by": "user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "asked_at": "string",
  "decided_by": "string",
  "decided_at": "string",
  "reason": "string"
}

عرض قائمة المركبات

GET/v1/vehicles

Lists the account's vehicles by plate: those in service, or with retired=true those taken out of service; plate_code and vin narrow it to those vehicles. A department-scoped key sees only its departments' vehicles.

النطاقfleet:read

المعاملات

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

  • retiredboolean الاستعلام

    true lists the vehicles taken out of service instead.

  • plate_codestring[] الاستعلام

    Only the vehicles with these plates (up to 200; indexed).

  • vinstring الاستعلام

    Only the vehicle with this VIN (indexed).

    مثال:1G4AH59H5G1183441

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • plateobject

      A Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.

      حقول plate
      • numberstring

        Saudi plate number (the digits)

        مثال:1

      • lettersstring

        Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

        مثال:SKD

      • typestring

        Saudi vehicle plate type

        أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

    • plate_codestring

      Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

      مثال:2070SKD

    • fleet_numberstring | null

      The account's own number for the vehicle (door or fleet code), unique in the account when set

      مثال:TRK-089

    • kindstring | null
    • vinstring | null
    • makestring | null

      مثال:Toyota

    • modelstring | null

      مثال:Hilux

    • yearinteger | null

      Model year

      مثال:2024

    • department_idstring | null

      The account department the vehicle belongs to

    • speed_limit_kmhinteger | null

      The vehicle's own speed limit for speeding alerts, km/h

      مثال:120

    • cargo_min_cnumber | null

      Lowest allowed cargo temperature, °C (cold chain)

      مثال:2

    • cargo_max_cnumber | null

      Highest allowed cargo temperature, °C (cold chain)

      مثال:8

    • tank_linteger | null

      Fuel tank size, litres

      مثال:400

    • capacity_palletsinteger | null

      How many pallets the vehicle carries (dispatch load)

      مثال:12

    • fuel_typestring | null
    • usestring

      unset: registered before uses were recorded; set it with updateVehicle.

      أحد:company_carcar_rentalpersonallight_noncommercialexempt_heavypublic_worksheavy_for_hireheavy_own_goodsheavy_noncommerciallight_for_hirelight_own_goodsgoods_vehicle_rentalvehicle_carrying_towingeducationalstaff_buscity_buscharter_busintercity_businternational_busbus_rentaltaximotorcycle_deliverymotorcycle_rentalotherunset

    • driver_idstring | null

      The driver of the vehicle's current driver session

    • created_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • updated_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • retired_atstring | null (date-time)

      When it was taken out of service; null while in service

    • retire_reasonstring | null
  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicles" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "plate": {
        "number": "1",
        "letters": "SKD",
        "type": "private_car"
      },
      "plate_code": "2070SKD",
      "fleet_number": "TRK-089",
      "kind": "truck",
      "vin": "1G4AH59H5G1183441",
      "make": "Toyota",
      "model": "Hilux",
      "year": 2024,
      "department_id": "string",
      "speed_limit_kmh": 120,
      "cargo_min_c": 2,
      "cargo_max_c": 8,
      "tank_l": 400,
      "capacity_pallets": 12,
      "fuel_type": "diesel",
      "use": "light_own_goods",
      "driver_id": "string",
      "created_at": "2026-11-17T08:30:00Z",
      "updated_at": "2026-11-17T08:30:00Z",
      "retired_at": "string",
      "retire_reason": "sold"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

عرض بيانات مركبة

GET/v1/vehicles/{vehicleId}

Returns one vehicle with its current driver.

النطاقfleet:read

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • plateobject

    A Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.

    حقول plate
    • numberstring

      Saudi plate number (the digits)

      مثال:1

    • lettersstring

      Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

      مثال:SKD

    • typestring

      Saudi vehicle plate type

      أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fleet_numberstring | null

    The account's own number for the vehicle (door or fleet code), unique in the account when set

    مثال:TRK-089

  • kindstring | null
  • vinstring | null
  • makestring | null

    مثال:Toyota

  • modelstring | null

    مثال:Hilux

  • yearinteger | null

    Model year

    مثال:2024

  • department_idstring | null

    The account department the vehicle belongs to

  • speed_limit_kmhinteger | null

    The vehicle's own speed limit for speeding alerts, km/h

    مثال:120

  • cargo_min_cnumber | null

    Lowest allowed cargo temperature, °C (cold chain)

    مثال:2

  • cargo_max_cnumber | null

    Highest allowed cargo temperature, °C (cold chain)

    مثال:8

  • tank_linteger | null

    Fuel tank size, litres

    مثال:400

  • capacity_palletsinteger | null

    How many pallets the vehicle carries (dispatch load)

    مثال:12

  • fuel_typestring | null
  • usestring

    unset: registered before uses were recorded; set it with updateVehicle.

    أحد:company_carcar_rentalpersonallight_noncommercialexempt_heavypublic_worksheavy_for_hireheavy_own_goodsheavy_noncommerciallight_for_hirelight_own_goodsgoods_vehicle_rentalvehicle_carrying_towingeducationalstaff_buscity_buscharter_busintercity_businternational_busbus_rentaltaximotorcycle_deliverymotorcycle_rentalotherunset

  • driver_idstring | null

    The driver of the vehicle's current driver session

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • retired_atstring | null (date-time)

    When it was taken out of service; null while in service

  • retire_reasonstring | null

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "plate": {
    "number": "1",
    "letters": "SKD",
    "type": "private_car"
  },
  "plate_code": "2070SKD",
  "fleet_number": "TRK-089",
  "kind": "truck",
  "vin": "1G4AH59H5G1183441",
  "make": "Toyota",
  "model": "Hilux",
  "year": 2024,
  "department_id": "string",
  "speed_limit_kmh": 120,
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "tank_l": 400,
  "capacity_pallets": 12,
  "fuel_type": "diesel",
  "use": "light_own_goods",
  "driver_id": "string",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "retired_at": "string",
  "retire_reason": "sold"
}

تعديل بيانات مركبة

PATCH/v1/vehicles/{vehicleId}

Changes the operational fields sent (fleet number, department, speed limit, cargo range, tank, pallets, fuel type); a field sent as null is cleared. Each changed field is a history entry (a department move its own kind). The registered fields (plate, VIN, kind, use, make, model, year) are PING's: one in the body answers 400 naming requestVehicleChange, which asks PING to change them.

النطاقfleet:write

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

محتوى الطلب

  • fleet_numberstring | null

    مثال:TRK-089

  • department_idstring | null
  • speed_limit_kmhinteger | null

    مثال:100

  • cargo_min_cnumber | null

    مثال:2

  • cargo_max_cnumber | null

    مثال:8

  • tank_linteger | null

    مثال:400

  • capacity_palletsinteger | null

    مثال:12

  • fuel_typestring | null
  • plateobject

    Registered: refused (400); ask with requestVehicleChange

    حقول plate
    • numberstring مطلوب

      Saudi plate number (the digits)

      مثال:1

    • lettersstring مطلوب

      Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

      مثال:SKD

    • typestring مطلوب

      Saudi vehicle plate type

      أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

  • kindstring | null

    Registered: refused (400); ask with requestVehicleChange

  • vinstring | null

    Registered: refused (400); ask with requestVehicleChange

  • makestring | null

    Registered: refused (400); ask with requestVehicleChange

  • modelstring | null

    Registered: refused (400); ask with requestVehicleChange

  • yearinteger | null

    Registered: refused (400); ask with requestVehicleChange

  • useobject

    Registered: refused (400); ask with requestVehicleChange

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • plateobject

    A Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.

    حقول plate
    • numberstring

      Saudi plate number (the digits)

      مثال:1

    • lettersstring

      Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

      مثال:SKD

    • typestring

      Saudi vehicle plate type

      أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fleet_numberstring | null

    The account's own number for the vehicle (door or fleet code), unique in the account when set

    مثال:TRK-089

  • kindstring | null
  • vinstring | null
  • makestring | null

    مثال:Toyota

  • modelstring | null

    مثال:Hilux

  • yearinteger | null

    Model year

    مثال:2024

  • department_idstring | null

    The account department the vehicle belongs to

  • speed_limit_kmhinteger | null

    The vehicle's own speed limit for speeding alerts, km/h

    مثال:120

  • cargo_min_cnumber | null

    Lowest allowed cargo temperature, °C (cold chain)

    مثال:2

  • cargo_max_cnumber | null

    Highest allowed cargo temperature, °C (cold chain)

    مثال:8

  • tank_linteger | null

    Fuel tank size, litres

    مثال:400

  • capacity_palletsinteger | null

    How many pallets the vehicle carries (dispatch load)

    مثال:12

  • fuel_typestring | null
  • usestring

    unset: registered before uses were recorded; set it with updateVehicle.

    أحد:company_carcar_rentalpersonallight_noncommercialexempt_heavypublic_worksheavy_for_hireheavy_own_goodsheavy_noncommerciallight_for_hirelight_own_goodsgoods_vehicle_rentalvehicle_carrying_towingeducationalstaff_buscity_buscharter_busintercity_businternational_busbus_rentaltaximotorcycle_deliverymotorcycle_rentalotherunset

  • driver_idstring | null

    The driver of the vehicle's current driver session

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • retired_atstring | null (date-time)

    When it was taken out of service; null while in service

  • retire_reasonstring | null

الأخطاء

400401403404409429

  • 503A service it needs (accounts, for the departments) cannot be reached; retry shortly (code: unavailable)
مثال الطلب
curl -X PATCH "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fleet_number": "TRK-089", "speed_limit_kmh": 100, "cargo_min_c": 2, "cargo_max_c": 8, "tank_l": 400, "capacity_pallets": 12}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "plate": {
    "number": "1",
    "letters": "SKD",
    "type": "private_car"
  },
  "plate_code": "2070SKD",
  "fleet_number": "TRK-089",
  "kind": "truck",
  "vin": "1G4AH59H5G1183441",
  "make": "Toyota",
  "model": "Hilux",
  "year": 2024,
  "department_id": "string",
  "speed_limit_kmh": 120,
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "tank_l": 400,
  "capacity_pallets": 12,
  "fuel_type": "diesel",
  "use": "light_own_goods",
  "driver_id": "string",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "retired_at": "string",
  "retire_reason": "sold"
}

وثائق المركبة

GET/v1/vehicles/{vehicleId}/documents

The vehicle's papers: Istimara, operating card, insurance and periodic inspection (FAHAS), each with its number and dates. A paper not recorded yet is left out.

النطاقfleet:read

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

الاستجابة 200

  • dataobject[]
    حقول data
    • typestring

      istimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.

      أحد:istimaraoperating_cardinsuranceperiodic_inspection

    • numberstring | null

      مثال:OC-2291847

    • issued_onstring | null (date)

      مثال:2026-01-12

    • expires_onstring | null (date)

      مثال:2027-01-11

    • updated_atstring (date-time)

      مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/documents" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "type": "operating_card",
      "number": "OC-2291847",
      "issued_on": "2026-01-12",
      "expires_on": "2027-01-11",
      "updated_at": "2026-11-17T08:30:00Z"
    }
  ]
}

تسجيل وثيقة مركبة

PUT/v1/vehicles/{vehicleId}/documents/{type}

Records or replaces one paper by its type (the operating card's number is TGA's). Recorded in the vehicle's history.

النطاقfleet:write

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • typestring المسار مطلوب

    مثال:operating_card

محتوى الطلب

  • numberstring | null

    مثال:OC-2291847

  • issued_onstring | null (date)

    مثال:2026-01-12

  • expires_onstring | null (date)

    مثال:2027-01-11

الاستجابة 200

  • typestring

    istimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.

    أحد:istimaraoperating_cardinsuranceperiodic_inspection

  • numberstring | null

    مثال:OC-2291847

  • issued_onstring | null (date)

    مثال:2026-01-12

  • expires_onstring | null (date)

    مثال:2027-01-11

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X PUT "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/documents/operating_card" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number": "OC-2291847", "issued_on": "2026-01-12", "expires_on": "2027-01-11"}'
مثال الاستجابة · 200
{
  "type": "operating_card",
  "number": "OC-2291847",
  "issued_on": "2026-01-12",
  "expires_on": "2027-01-11",
  "updated_at": "2026-11-17T08:30:00Z"
}

حذف وثيقة مركبة سُجّلت خطأً

DELETE/v1/vehicles/{vehicleId}/documents/{type}

Removes the paper of this type; the vehicle's history keeps it (kind document_deleted: its type, number and expiry, and the reason given).

النطاقfleet:write

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d

  • typestring المسار مطلوب

    مثال:operating_card

  • reasonstring الاستعلام

    Why it is deleted (kept in the history)

الاستجابة 200

  • typestring

    istimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.

    أحد:istimaraoperating_cardinsuranceperiodic_inspection

  • numberstring | null

    مثال:OC-2291847

  • issued_onstring | null (date)

    مثال:2026-01-12

  • expires_onstring | null (date)

    مثال:2027-01-11

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

الأخطاء

400401403404429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/vehicles/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d/documents/operating_card" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "type": "operating_card",
  "number": "OC-2291847",
  "issued_on": "2026-01-12",
  "expires_on": "2027-01-11",
  "updated_at": "2026-11-17T08:30:00Z"
}

تعيين سائق لمركبة

POST/v1/vehicles/{vehicleId}/driver

Starts a manual driver session on the vehicle. It ends the vehicle's open session and the driver's open session on any other vehicle (driver.session_changed for each).

النطاقfleet:write يقبل Idempotency-Key

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • Idempotency-Keystring الترويسة

    A unique key per create request. A retry with the same key within 24 hours returns the first result instead of creating again.

محتوى الطلب

  • driver_idstring مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

الاستجابة 201

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • vehicle_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • driver_idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • sourcestring

    manual: assigned through the API or console; ibutton: identified in the vehicle

    أحد:manualibutton

  • started_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • ended_atstring | null (date-time)

    Null while the session is open

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/driver" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"driver_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d"}'
مثال الاستجابة · 201
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "vehicle_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "driver_id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "source": "manual",
  "started_at": "2026-11-17T08:30:00Z",
  "ended_at": "string"
}

إنهاء تعيين سائق المركبة

DELETE/v1/vehicles/{vehicleId}/driver

Ends the vehicle's open driver session, so no driver is assigned to it. A vehicle with no driver answers 204 as well.

النطاقfleet:write

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

الاستجابة 204

No driver is assigned to the vehicle.

الأخطاء

400401403404429

مثال الطلب
curl -X DELETE "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/driver" \
  -H "Authorization: Bearer $PING_API_KEY"

سجل المركبة

GET/v1/vehicles/{vehicleId}/history

What happened to the vehicle in the account, newest first: registered, a field changed, department changed, driver assigned, a document recorded, retired. Append-only.

النطاقfleet:read

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • limitinteger الاستعلام

    Items per page, 1 to 200 (default 50).

  • cursorstring الاستعلام

    The next_cursor of the previous page.

الاستجابة 200

  • dataobject[]
    حقول data
    • idstring

      مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

    • atstring (date-time)

      مثال:2026-11-17T08:30:00Z

    • kindstring

      أحد:registeredupdateddepartment_changeddriver_assigneddocument_recordeddocument_deletedretired

    • actorstring

      Who did it (user:<id>, agent:<name>, system:<service>)

      مثال:user:usr_4Kd9

    • plate_codestring | null
    • fieldstring | null
    • fromstring | null

      مثال:100

    • tostring | null

      مثال:120

    • from_department_idstring | null
    • to_department_idstring | null
    • driver_idstring | null
    • document_typestring | null
    • expires_onstring | null (date)
    • reasonstring | null
    • notestring | null
    • request_idstring | null

      The vehicle request it applied (registered and updated by an approved request)

  • next_cursorstring | null

    مثال:eyJpZCI6InZlaF83S3EyIn0

الأخطاء

400401403404429

مثال الطلب
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/history" \
  -H "Authorization: Bearer $PING_API_KEY"
مثال الاستجابة · 200
{
  "data": [
    {
      "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
      "at": "2026-11-17T08:30:00Z",
      "kind": "department_changed",
      "actor": "user:usr_4Kd9",
      "plate_code": "2070SKD",
      "field": "plate",
      "from": "100",
      "to": "120",
      "from_department_id": "string",
      "to_department_id": "string",
      "driver_id": "string",
      "document_type": "operating_card",
      "expires_on": "string",
      "reason": "sold",
      "note": "string",
      "request_id": "string"
    }
  ],
  "next_cursor": "eyJpZCI6InZlaF83S3EyIn0"
}

إخراج مركبة من الخدمة

POST/v1/vehicles/{vehicleId}/retire

Retires the vehicle with a reason: it leaves the register and the live map, keeps its history and data, and ends its open driver session.

النطاقfleet:write

المعاملات

  • vehicleIdstring المسار مطلوب

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

محتوى الطلب

  • reasonstring مطلوب

    أحد:soldscrappedwritten_offreturnedother

  • notestring | null

    مثال:Sold to the dealer with 412,000 km

الاستجابة 200

  • idstring

    مثال:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d

  • plateobject

    A Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.

    حقول plate
    • numberstring

      Saudi plate number (the digits)

      مثال:1

    • lettersstring

      Saudi plate letters in their Latin form, read left to right: 3 on vehicles, 2 on motorcycles (the plate's type decides, held by the table that stores a plate)

      مثال:SKD

    • typestring

      Saudi vehicle plate type

      أحد:private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric

  • plate_codestring

    Saudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)

    مثال:2070SKD

  • fleet_numberstring | null

    The account's own number for the vehicle (door or fleet code), unique in the account when set

    مثال:TRK-089

  • kindstring | null
  • vinstring | null
  • makestring | null

    مثال:Toyota

  • modelstring | null

    مثال:Hilux

  • yearinteger | null

    Model year

    مثال:2024

  • department_idstring | null

    The account department the vehicle belongs to

  • speed_limit_kmhinteger | null

    The vehicle's own speed limit for speeding alerts, km/h

    مثال:120

  • cargo_min_cnumber | null

    Lowest allowed cargo temperature, °C (cold chain)

    مثال:2

  • cargo_max_cnumber | null

    Highest allowed cargo temperature, °C (cold chain)

    مثال:8

  • tank_linteger | null

    Fuel tank size, litres

    مثال:400

  • capacity_palletsinteger | null

    How many pallets the vehicle carries (dispatch load)

    مثال:12

  • fuel_typestring | null
  • usestring

    unset: registered before uses were recorded; set it with updateVehicle.

    أحد:company_carcar_rentalpersonallight_noncommercialexempt_heavypublic_worksheavy_for_hireheavy_own_goodsheavy_noncommerciallight_for_hirelight_own_goodsgoods_vehicle_rentalvehicle_carrying_towingeducationalstaff_buscity_buscharter_busintercity_businternational_busbus_rentaltaximotorcycle_deliverymotorcycle_rentalotherunset

  • driver_idstring | null

    The driver of the vehicle's current driver session

  • created_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • updated_atstring (date-time)

    مثال:2026-11-17T08:30:00Z

  • retired_atstring | null (date-time)

    When it was taken out of service; null while in service

  • retire_reasonstring | null

الأخطاء

400401403404409429

مثال الطلب
curl -X POST "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/retire" \
  -H "Authorization: Bearer $PING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "sold", "note": "Sold to the dealer with 412,000 km"}'
مثال الاستجابة · 200
{
  "id": "019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d",
  "plate": {
    "number": "1",
    "letters": "SKD",
    "type": "private_car"
  },
  "plate_code": "2070SKD",
  "fleet_number": "TRK-089",
  "kind": "truck",
  "vin": "1G4AH59H5G1183441",
  "make": "Toyota",
  "model": "Hilux",
  "year": 2024,
  "department_id": "string",
  "speed_limit_kmh": 120,
  "cargo_min_c": 2,
  "cargo_max_c": 8,
  "tank_l": 400,
  "capacity_pallets": 12,
  "fuel_type": "diesel",
  "use": "light_own_goods",
  "driver_id": "string",
  "created_at": "2026-11-17T08:30:00Z",
  "updated_at": "2026-11-17T08:30:00Z",
  "retired_at": "string",
  "retire_reason": "sold"
}