الأسطول
المركبات والسائقون والمجموعات والمناطق والمسارات ومهام التوزيع والركاب.
عنوان الأساس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-4e5f6a7b8c9ddriver_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9datstring (date-time)مثال:
2026-11-17T08:30:00ZcoachstringWho held it (the caller)
مثال:
user:usr_4Kd9focusstringأحد:
harsh_brakingharsh_accelerationharsh_corneringoverspeednotestring | nullمثال:
Reviewed the three braking events on the Dammam runscore_at_sessioninteger | nullمثال:
58follow_up_onstring (date)مثال:
2026-12-01
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/coaching-sessions" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dfocusstringمطلوبأحد:
harsh_brakingharsh_accelerationharsh_corneringoverspeednotestring | nullمثال:
Reviewed the three braking events on the Dammam runscore_at_sessioninteger | nullمثال:
58follow_up_onstring (date)مطلوبمثال:
2026-12-01
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9ddriver_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9datstring (date-time)مثال:
2026-11-17T08:30:00ZcoachstringWho held it (the caller)
مثال:
user:usr_4Kd9focusstringأحد:
harsh_brakingharsh_accelerationharsh_corneringoverspeednotestring | nullمثال:
Reviewed the three braking events on the Dammam runscore_at_sessioninteger | nullمثال:
58follow_up_onstring (date)مثال:
2026-12-01
الأخطاء
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"}'{
"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-4e5f6a7b8c9dnamestringThe name in Latin letters
مثال:
Faisal Al-Harbiname_arstring | nullThe name in Arabic
مثال:
فيصل الحربيdepartment_idstring | nullThe account department the driver belongs to
phone_e164string | nullJob links are sent here on WhatsApp
national_idstring | nullA Saudi driver's national ID, the number their licence is issued on
iqama_numberstring | nullA 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-14ibutton_idstring | nullThe iButton key that identifies the driver in the vehicle (hex)
مثال:
01A2B3C4D5E6created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zleft_onstring | null (date)The day the driver left the account; null while employed
leave_reasonstring | null
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/drivers" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-Harbiname_arstring | nullمثال:
فيصل الحربيdepartment_idstring | nullphone_e164string | nullnational_idstring | nullNot with iqama_number
iqama_numberstring | nullNot with national_id
licence_classesstring[]licence_expirystring | null (date)مثال:
2028-05-14ibutton_idstring | nullمثال:
01A2B3C4D5E6
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringThe name in Latin letters
مثال:
Faisal Al-Harbiname_arstring | nullThe name in Arabic
مثال:
فيصل الحربيdepartment_idstring | nullThe account department the driver belongs to
phone_e164string | nullJob links are sent here on WhatsApp
national_idstring | nullA Saudi driver's national ID, the number their licence is issued on
iqama_numberstring | nullA 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-14ibutton_idstring | nullThe iButton key that identifies the driver in the vehicle (hex)
مثال:
01A2B3C4D5E6created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zleft_onstring | null (date)The day the driver left the account; null while employed
leave_reasonstring | null
الأخطاء
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"}'{
"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-4e5f6a7b8c9dnamestringThe name in Latin letters
مثال:
Faisal Al-Harbiname_arstring | nullThe name in Arabic
مثال:
فيصل الحربيdepartment_idstring | nullThe account department the driver belongs to
phone_e164string | nullJob links are sent here on WhatsApp
national_idstring | nullA Saudi driver's national ID, the number their licence is issued on
iqama_numberstring | nullA 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-14ibutton_idstring | nullThe iButton key that identifies the driver in the vehicle (hex)
مثال:
01A2B3C4D5E6created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zleft_onstring | null (date)The day the driver left the account; null while employed
leave_reasonstring | null
الأخطاء
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"{
"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-Harbiname_arstring | nullمثال:
فيصل الحربيdepartment_idstring | nullphone_e164string | nullnational_idstring | nulliqama_numberstring | nulllicence_classesstring[]licence_expirystring | null (date)مثال:
2028-05-14ibutton_idstring | nullمثال:
01A2B3C4D5E6
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringThe name in Latin letters
مثال:
Faisal Al-Harbiname_arstring | nullThe name in Arabic
مثال:
فيصل الحربيdepartment_idstring | nullThe account department the driver belongs to
phone_e164string | nullJob links are sent here on WhatsApp
national_idstring | nullA Saudi driver's national ID, the number their licence is issued on
iqama_numberstring | nullA 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-14ibutton_idstring | nullThe iButton key that identifies the driver in the vehicle (hex)
مثال:
01A2B3C4D5E6created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zleft_onstring | null (date)The day the driver left the account; null while employed
leave_reasonstring | null
الأخطاء
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"}'{
"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_endedotheronstring (date)مطلوبThe last day in the account
مثال:
2026-11-30
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringThe name in Latin letters
مثال:
Faisal Al-Harbiname_arstring | nullThe name in Arabic
مثال:
فيصل الحربيdepartment_idstring | nullThe account department the driver belongs to
phone_e164string | nullJob links are sent here on WhatsApp
national_idstring | nullA Saudi driver's national ID, the number their licence is issued on
iqama_numberstring | nullA 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-14ibutton_idstring | nullThe iButton key that identifies the driver in the vehicle (hex)
مثال:
01A2B3C4D5E6created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zleft_onstring | null (date)The day the driver left the account; null while employed
leave_reasonstring | null
الأخطاء
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"}'{
"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-4e5f6a7b8c9dnamestringمثال:
Main depotkindstringdepot: 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
أحد:
depotsitecustomerrestrictedworkshopfuelgeometryPolygon | PointA Polygon, or a Point that is the centre of a circle of radius_m.
مثال:
{"type":"Point","coordinates":[46.6753,24.7136]}radius_minteger | nullThe circle's radius in metres; null for a polygon
مثال:
500speed_limit_kmhinteger | nullSpeed limit inside the geofence, km/h
مثال:
40cargo_min_cnumber | nullA customer site's cargo range: new jobs to it start with it (cold chain)
مثال:
2cargo_max_cnumber | nullمثال:
8created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/geofences" \
-H "Authorization: Bearer $PING_API_KEY"{
"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 depotkindstringdepot: 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
أحد:
depotsitecustomerrestrictedworkshopfuelgeometryPolygon | 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 | nullRequired with a Point; not allowed with a Polygon
مثال:
500speed_limit_kmhinteger | nullمثال:
40cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Main depotkindstringdepot: 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
أحد:
depotsitecustomerrestrictedworkshopfuelgeometryPolygon | PointA Polygon, or a Point that is the centre of a circle of radius_m.
مثال:
{"type":"Point","coordinates":[46.6753,24.7136]}radius_minteger | nullThe circle's radius in metres; null for a polygon
مثال:
500speed_limit_kmhinteger | nullSpeed limit inside the geofence, km/h
مثال:
40cargo_min_cnumber | nullA customer site's cargo range: new jobs to it start with it (cold chain)
مثال:
2cargo_max_cnumber | nullمثال:
8created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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}'{
"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 depotkindstringdepot: 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
أحد:
depotsitecustomerrestrictedworkshopfuelgeometryPolygon | PointA Polygon, or a Point that is the centre of a circle of radius_m.
مثال:
{"type":"Point","coordinates":[46.6753,24.7136]}radius_mintegerمثال:
750speed_limit_kmhinteger | nullمثال:
40cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Main depotkindstringdepot: 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
أحد:
depotsitecustomerrestrictedworkshopfuelgeometryPolygon | PointA Polygon, or a Point that is the centre of a circle of radius_m.
مثال:
{"type":"Point","coordinates":[46.6753,24.7136]}radius_minteger | nullThe circle's radius in metres; null for a polygon
مثال:
500speed_limit_kmhinteger | nullSpeed limit inside the geofence, km/h
مثال:
40cargo_min_cnumber | nullA customer site's cargo range: new jobs to it start with it (cold chain)
مثال:
2cargo_max_cnumber | nullمثال:
8created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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}'{
"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
الأخطاء
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-4e5f6a7b8c9dnamestringمثال:
Riyadh deliveriesvehicle_idsstring[]created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/groups" \
-H "Authorization: Bearer $PING_API_KEY"{
"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 deliveriesvehicle_idsstring[]
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Riyadh deliveriesvehicle_idsstring[]created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}'{
"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 deliveriesadd_vehicle_idsstring[]remove_vehicle_idsstring[]
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Riyadh deliveriesvehicle_idsstring[]created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}'{
"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-4e5f6a7b8c9dnamestringمثال:
Riyadh deliveriesvehicle_idsstring[]created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
curl -X DELETE "https://api.ping.nml.sa/v1/groups/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
-H "Authorization: Bearer $PING_API_KEY"{
"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
مثال:
draftvehiclestringالاستعلام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-4e5f6a7b8c9drefstringمثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledvehicle_idstring | nullplate_codestring | nullThe vehicle's plate
driver_idstring | nulldriverstring | nullThe driver's name
مثال:
Faisal Al-Harbischeduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zcreated_atstring (date-time)مثال:
2026-11-17T08:30:00Zstarted_atstring | null (date-time)The first arrival at a stop
completed_atstring | null (date-time)cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullrequires_kindstring | nullstopsobject[]The job's stops in order, with with_stops=true
حقول stops
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
first_stopstring | nullThe first stop's name
مثال:
Sudair dairy plantlast_stopstring | nullThe last stop's name
مثال:
Al Olaya branchdispositionstring | nullstop_countintegerمثال:
4stops_doneintegerمثال:
1
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/jobs" \
-H "Authorization: Bearer $PING_API_KEY"{
"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 | nullNeeded to dispatch
driver_idstring | nullDefaults at dispatch to the vehicle's current driver
scheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullWhat the job carries
مثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for (its board), whether or not it has a vehicle
requires_kindstring | nullThe kind of vehicle the job needs
stopsobject[]مطلوبحقول stops
kindstringمطلوبأحد:
pickupdropnamestringمطلوبمثال:
Al Olaya branchlatnumberمطلوبLatitude, within Saudi Arabia
مثال:
24.6951lonnumberمطلوبLongitude, within Saudi Arabia
مثال:
46.6857radius_mintegerThe vehicle has arrived within this distance
مثال:
150contact_phonestring | nullReceives the tracking link and, with proof otp, the code
window_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)After window_from
مثال:
2026-11-17T11:00:00Zservice_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9drefstringThe reference shown to drivers and recipients
مثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledroute_idstring | nullThe saved route the job was made from
vehicle_idstring | nulldriver_idstring | nullscheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for
requires_kindstring | nulldispositionobject | nullWhat the receiver did with the load after a breach
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zdispatched_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-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
eventsobject[]حقول events
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstring | nullcodestringأحد:
createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelledactorstringWho acted: user:, agent:, system: or driver:
مثال:
system:fleetlatnumber | nullمثال:
24.6951lonnumber | nullمثال:
46.6857notestring | nullatstring (date-time)مثال:
2026-11-17T09:41:00Z
proofsobject[]حقول proofs
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringphoto, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code
أحد:
photosignatureotpnotereceived_bystring | nullWho received the delivery, as the driver wrote it
مثال:
Store manageratstring (date-time)مثال:
2026-11-17T09:48:00Z
الأخطاء
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"}]}'{
"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-4e5f6a7b8c9drefstringThe reference shown to drivers and recipients
مثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledroute_idstring | nullThe saved route the job was made from
vehicle_idstring | nulldriver_idstring | nullscheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for
requires_kindstring | nulldispositionobject | nullWhat the receiver did with the load after a breach
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zdispatched_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-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
eventsobject[]حقول events
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstring | nullcodestringأحد:
createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelledactorstringWho acted: user:, agent:, system: or driver:
مثال:
system:fleetlatnumber | nullمثال:
24.6951lonnumber | nullمثال:
46.6857notestring | nullatstring (date-time)مثال:
2026-11-17T09:41:00Z
proofsobject[]حقول proofs
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringphoto, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code
أحد:
photosignatureotpnotereceived_bystring | nullWho received the delivery, as the driver wrote it
مثال:
Store manageratstring (date-time)مثال:
2026-11-17T09:48:00Z
الأخطاء
curl "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9drefstringThe reference shown to drivers and recipients
مثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledroute_idstring | nullThe saved route the job was made from
vehicle_idstring | nulldriver_idstring | nullscheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for
requires_kindstring | nulldispositionobject | nullWhat the receiver did with the load after a breach
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zdispatched_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-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
eventsobject[]حقول events
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstring | nullcodestringأحد:
createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelledactorstringWho acted: user:, agent:, system: or driver:
مثال:
system:fleetlatnumber | nullمثال:
24.6951lonnumber | nullمثال:
46.6857notestring | nullatstring (date-time)مثال:
2026-11-17T09:41:00Z
proofsobject[]حقول proofs
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringphoto, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code
أحد:
photosignatureotpnotereceived_bystring | nullWho received the delivery, as the driver wrote it
مثال:
Store manageratstring (date-time)مثال:
2026-11-17T09:48:00Z
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b/cancel" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9drefstringThe reference shown to drivers and recipients
مثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledroute_idstring | nullThe saved route the job was made from
vehicle_idstring | nulldriver_idstring | nullscheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for
requires_kindstring | nulldispositionobject | nullWhat the receiver did with the load after a breach
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zdispatched_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-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
eventsobject[]حقول events
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstring | nullcodestringأحد:
createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelledactorstringWho acted: user:, agent:, system: or driver:
مثال:
system:fleetlatnumber | nullمثال:
24.6951lonnumber | nullمثال:
46.6857notestring | nullatstring (date-time)مثال:
2026-11-17T09:41:00Z
proofsobject[]حقول proofs
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringphoto, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code
أحد:
photosignatureotpnotereceived_bystring | nullWho received the delivery, as the driver wrote it
مثال:
Store manageratstring (date-time)مثال:
2026-11-17T09:48:00Z
driver_linkstring | nullThe 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
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/jobs/019ac0c4-9c4d-7e5f-a06b-7c8d9e0f1a2b/dispatch" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dplate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDtrip_keystringThe vehicle trip (ignition on to off) the taps belong to
first_atstring (date-time)مثال:
2026-11-17T06:42:10Zlast_atstring (date-time)مثال:
2026-11-17T07:21:40Zunknown_cardsstring[]Cards tapped that no active rider holds
مثال:
["04FF00AA"]ridersobject[]حقول riders
rider_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9driderstringمثال:
Sara Al-Qahtaniboarded_atstring (date-time)مثال:
2026-11-17T06:42:10Zalighted_atstring | null (date-time)The tap off after the rider's last board; null when they never tapped off
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/rider-runs" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9datstring (date-time)مثال:
2026-11-17T06:42:10Zkindstringunknown: a card no active rider holds
أحد:
boardalightunknownvehicle_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dplate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDrider_idstring | nullriderstring | nullThe rider's name
مثال:
Sara Al-Qahtanicard_idstringمثال:
04A1B2C3D4trip_keystringThe vehicle trip (ignition on to off) the tap belongs to
latnumber | nullمثال:
24.7136lonnumber | nullمثال:
46.6753
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/rider-taps" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dnamestringمثال:
Sara Al-Qahtanicard_idstringمثال:
04A1B2C3D4route_idstring | nullguardiansobject[]حقول guardians
namestring | nullمثال:
Noura Al-Qahtaniphone_e164stringSaudi telephone number in E.164 (mobile, landline, VoIP, unified)
مثال:
+966551234567notifybooleanمثال:
true
activebooleanمثال:
truecreated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/riders" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-Qahtanicard_idstringمطلوبThe card id as the reader reports it (hex), unique in the account
مثال:
04A1B2C3D4route_idstring | nullguardiansobject[]حقول guardians
namestring | nullمثال:
Noura Al-Qahtaniphone_e164stringمطلوبSaudi telephone number in E.164 (mobile, landline, VoIP, unified)
مثال:
+966551234567notifybooleanMessage this guardian when the rider boards and alights
مثال:
true
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Sara Al-Qahtanicard_idstringمثال:
04A1B2C3D4route_idstring | nullguardiansobject[]حقول guardians
namestring | nullمثال:
Noura Al-Qahtaniphone_e164stringSaudi telephone number in E.164 (mobile, landline, VoIP, unified)
مثال:
+966551234567notifybooleanمثال:
true
activebooleanمثال:
truecreated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}'{
"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-Qahtanicard_idstringA replaced card, as the reader reports it (hex), unique in the account
مثال:
04A1B2C3D5route_idstring | nullguardiansobject[]حقول guardians
namestring | nullمثال:
Noura Al-Qahtaniphone_e164stringمطلوبSaudi telephone number in E.164 (mobile, landline, VoIP, unified)
مثال:
+966551234567notifybooleanMessage this guardian when the rider boards and alights
مثال:
true
activebooleanfalse when the rider no longer rides
مثال:
false
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Sara Al-Qahtanicard_idstringمثال:
04A1B2C3D4route_idstring | nullguardiansobject[]حقول guardians
namestring | nullمثال:
Noura Al-Qahtaniphone_e164stringSaudi telephone number in E.164 (mobile, landline, VoIP, unified)
مثال:
+966551234567notifybooleanمثال:
true
activebooleanمثال:
truecreated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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}'{
"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-4e5f6a7b8c9dnamestringمثال:
Morning school runvehicle_idstring | nulldriver_idstring | nullstopsobject[]حقول stops
seqintegerOrder in the route, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)window_tostring | null (date-time)service_minintegerمثال:
15geofence_idstring | null
created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/routes" \
-H "Authorization: Bearer $PING_API_KEY"{
"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 runvehicle_idstring | nulldriver_idstring | nullstopsobject[]مطلوبحقول stops
kindstringمطلوبأحد:
pickupdropnamestringمطلوبمثال:
Al Olaya branchlatnumberمطلوبLatitude, within Saudi Arabia
مثال:
24.6951lonnumberمطلوبLongitude, within Saudi Arabia
مثال:
46.6857radius_mintegerThe vehicle has arrived within this distance
مثال:
150contact_phonestring | nullReceives the tracking link and, with proof otp, the code
window_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)After window_from
مثال:
2026-11-17T11:00:00Zservice_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Morning school runvehicle_idstring | nulldriver_idstring | nullstopsobject[]حقول stops
seqintegerOrder in the route, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)window_tostring | null (date-time)service_minintegerمثال:
15geofence_idstring | null
created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}]}'{
"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 runvehicle_idstring | nulldriver_idstring | nullstopsobject[]حقول stops
kindstringمطلوبأحد:
pickupdropnamestringمطلوبمثال:
Al Olaya branchlatnumberمطلوبLatitude, within Saudi Arabia
مثال:
24.6951lonnumberمطلوبLongitude, within Saudi Arabia
مثال:
46.6857radius_mintegerThe vehicle has arrived within this distance
مثال:
150contact_phonestring | nullReceives the tracking link and, with proof otp, the code
window_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)After window_from
مثال:
2026-11-17T11:00:00Zservice_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
Morning school runvehicle_idstring | nulldriver_idstring | nullstopsobject[]حقول stops
seqintegerOrder in the route, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)window_tostring | null (date-time)service_minintegerمثال:
15geofence_idstring | null
created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}'{
"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-4e5f6a7b8c9dnamestringمثال:
Morning school runvehicle_idstring | nulldriver_idstring | nullstopsobject[]حقول stops
seqintegerOrder in the route, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)window_tostring | null (date-time)service_minintegerمثال:
15geofence_idstring | null
created_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
curl -X DELETE "https://api.ping.nml.sa/v1/routes/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-9e0f1a2b3c4dIdempotency-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:00ZdispatchbooleanDispatch the job at once
مثال:
true
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9drefstringThe reference shown to drivers and recipients
مثال:
J-2611-4821statusstringأحد:
draftdispatchedin_progresscompletedfailedcancelledroute_idstring | nullThe saved route the job was made from
vehicle_idstring | nulldriver_idstring | nullscheduled_atstring | null (date-time)مثال:
2026-11-17T09:00:00Zproofstring[]مثال:
["photo","otp"]cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8notesstring | nullمثال:
Deliver to the loading bay.cargostring | nullمثال:
Dairy, chilledpalletsinteger | nullمثال:
12department_idstring | nullThe department the job is planned for
requires_kindstring | nulldispositionobject | nullWhat the receiver did with the load after a breach
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zdispatched_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-4e5f6a7b8c9dseqintegerOrder in the job, from 1
مثال:
1kindstringأحد:
pickupdropnamestringمثال:
Al Olaya branchlatnumberمثال:
24.6951lonnumberمثال:
46.6857radius_mintegerمثال:
150contact_phonestring | nullwindow_fromstring | null (date-time)مثال:
2026-11-17T09:00:00Zwindow_tostring | null (date-time)مثال:
2026-11-17T11:00:00Zstatusstringأحد:
pendingarriveddonefailedskippedeta_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_minintegerMinutes spent at the stop
مثال:
15geofence_idstring | nullThe geofence (customer site) the stop was picked from
مثال:
019ac0c4-8b3c-7d4e-9f5a-6b7c8d9e0f1a
eventsobject[]حقول events
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstring | nullcodestringأحد:
createdupdateddispatchedarriveddeparteddonefailedskippedcompletedcancelledactorstringWho acted: user:, agent:, system: or driver:
مثال:
system:fleetlatnumber | nullمثال:
24.6951lonnumber | nullمثال:
46.6857notestring | nullatstring (date-time)مثال:
2026-11-17T09:41:00Z
proofsobject[]حقول proofs
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dstop_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringphoto, signature: a file kept with the job; otp: the stop's code was given; note: completed without a code
أحد:
photosignatureotpnotereceived_bystring | nullWho received the delivery, as the driver wrote it
مثال:
Store manageratstring (date-time)مثال:
2026-11-17T09:48:00Z
driver_linkstring | nullThe 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
الأخطاء
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}'{
"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.
مثال:
pendinglimitintegerالاستعلامItems per page, 1 to 200 (default 50).
cursorstringالاستعلامThe next_cursor of the previous page.
الاستجابة 200
dataobject[]حقول data
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringchange: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).
أحد:
changeaddstatestringأحد:
pendingapprovedrejectedwithdrawnvehicle_idstring | nullA change's vehicle; an addition's once approved
department_idstring | nullThe department an addition goes into
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfieldsstring[]The fields asked
askedobjectA 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 | nullplate_codestring | nullvinstring | nullkindstring | nullusestring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullمثال:
2024
wasobject | nullA change's values of the fields asked when asked (null for an addition)
justificationstringfilesobject[]حقول files
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
istimara.pdfcontent_typestringأحد:
application/pdfimage/jpegimage/pngbytesinteger
asked_bystringWho asked (user:<id>, ...)
مثال:
user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dasked_atstring (date-time)decided_bystring | nullWho approved or rejected it (PING's staff), or withdrew it
decided_atstring | null (date-time)reasonstring | nullWhy it was rejected
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicle-requests" \
-H "Authorization: Bearer $PING_API_KEY"{
"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).
أحد:
changeaddvehicle_idstringThe vehicle a change is for (a change only)
department_idstring | nullThe 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
plateobjectA 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)
مثال:
1lettersstringمطلوب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)
مثال:
SKDtypestringمطلوبSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
vinstring | nullkindstring | nullusestringWhat 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_rentalothermakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | 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.pdfcontent_typestringمطلوبأحد:
application/pdfimage/jpegimage/pngdatastringمطلوبThe file, base64 (at most [service.requests] max_file_bytes decoded; the request at most max_request_bytes)
الاستجابة 201
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dkindstringchange: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).
أحد:
changeaddstatestringأحد:
pendingapprovedrejectedwithdrawnvehicle_idstring | nullA change's vehicle; an addition's once approved
department_idstring | nullThe department an addition goes into
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfieldsstring[]The fields asked
askedobjectA 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 | nullplate_codestring | nullvinstring | nullkindstring | nullusestring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullمثال:
2024
wasobject | nullA change's values of the fields asked when asked (null for an addition)
justificationstringfilesobject[]حقول files
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
istimara.pdfcontent_typestringأحد:
application/pdfimage/jpegimage/pngbytesinteger
asked_bystringWho asked (user:<id>, ...)
مثال:
user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dasked_atstring (date-time)decided_bystring | nullWho approved or rejected it (PING's staff), or withdrew it
decided_atstring | null (date-time)reasonstring | nullWhy it was rejected
الأخطاء
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."}'{
"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-4e5f6a7b8c9dkindstringchange: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).
أحد:
changeaddstatestringأحد:
pendingapprovedrejectedwithdrawnvehicle_idstring | nullA change's vehicle; an addition's once approved
department_idstring | nullThe department an addition goes into
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfieldsstring[]The fields asked
askedobjectA 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 | nullplate_codestring | nullvinstring | nullkindstring | nullusestring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullمثال:
2024
wasobject | nullA change's values of the fields asked when asked (null for an addition)
justificationstringfilesobject[]حقول files
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
istimara.pdfcontent_typestringأحد:
application/pdfimage/jpegimage/pngbytesinteger
asked_bystringWho asked (user:<id>, ...)
مثال:
user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dasked_atstring (date-time)decided_bystring | nullWho approved or rejected it (PING's staff), or withdrew it
decided_atstring | null (date-time)reasonstring | nullWhy it was rejected
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicle-requests/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dkindstringchange: a vehicle's registered fields; add: a vehicle wanted with no unit (papers only).
أحد:
changeaddstatestringأحد:
pendingapprovedrejectedwithdrawnvehicle_idstring | nullA change's vehicle; an addition's once approved
department_idstring | nullThe department an addition goes into
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfieldsstring[]The fields asked
askedobjectA 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 | nullplate_codestring | nullvinstring | nullkindstring | nullusestring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullمثال:
2024
wasobject | nullA change's values of the fields asked when asked (null for an addition)
justificationstringfilesobject[]حقول files
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dnamestringمثال:
istimara.pdfcontent_typestringأحد:
application/pdfimage/jpegimage/pngbytesinteger
asked_bystringWho asked (user:<id>, ...)
مثال:
user:019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dasked_atstring (date-time)decided_bystring | nullWho approved or rejected it (PING's staff), or withdrew it
decided_atstring | null (date-time)reasonstring | nullWhy it was rejected
الأخطاء
curl -X POST "https://api.ping.nml.sa/v1/vehicle-requests/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9e/withdraw" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dplateobjectA Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.
حقول plate
numberstringSaudi plate number (the digits)
مثال:
1lettersstringSaudi 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)
مثال:
SKDtypestringSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfleet_numberstring | nullThe account's own number for the vehicle (door or fleet code), unique in the account when set
مثال:
TRK-089kindstring | nullvinstring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullModel year
مثال:
2024department_idstring | nullThe account department the vehicle belongs to
speed_limit_kmhinteger | nullThe vehicle's own speed limit for speeding alerts, km/h
مثال:
120cargo_min_cnumber | nullLowest allowed cargo temperature, °C (cold chain)
مثال:
2cargo_max_cnumber | nullHighest allowed cargo temperature, °C (cold chain)
مثال:
8tank_linteger | nullFuel tank size, litres
مثال:
400capacity_palletsinteger | nullHow many pallets the vehicle carries (dispatch load)
مثال:
12fuel_typestring | nullusestringunset: 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_rentalotherunsetdriver_idstring | nullThe driver of the vehicle's current driver session
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zretired_atstring | null (date-time)When it was taken out of service; null while in service
retire_reasonstring | null
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicles" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dplateobjectA Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.
حقول plate
numberstringSaudi plate number (the digits)
مثال:
1lettersstringSaudi 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)
مثال:
SKDtypestringSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfleet_numberstring | nullThe account's own number for the vehicle (door or fleet code), unique in the account when set
مثال:
TRK-089kindstring | nullvinstring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullModel year
مثال:
2024department_idstring | nullThe account department the vehicle belongs to
speed_limit_kmhinteger | nullThe vehicle's own speed limit for speeding alerts, km/h
مثال:
120cargo_min_cnumber | nullLowest allowed cargo temperature, °C (cold chain)
مثال:
2cargo_max_cnumber | nullHighest allowed cargo temperature, °C (cold chain)
مثال:
8tank_linteger | nullFuel tank size, litres
مثال:
400capacity_palletsinteger | nullHow many pallets the vehicle carries (dispatch load)
مثال:
12fuel_typestring | nullusestringunset: 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_rentalotherunsetdriver_idstring | nullThe driver of the vehicle's current driver session
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zretired_atstring | null (date-time)When it was taken out of service; null while in service
retire_reasonstring | null
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-089department_idstring | nullspeed_limit_kmhinteger | nullمثال:
100cargo_min_cnumber | nullمثال:
2cargo_max_cnumber | nullمثال:
8tank_linteger | nullمثال:
400capacity_palletsinteger | nullمثال:
12fuel_typestring | nullplateobjectRegistered: refused (400); ask with requestVehicleChange
حقول plate
numberstringمطلوبSaudi plate number (the digits)
مثال:
1lettersstringمطلوب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)
مثال:
SKDtypestringمطلوبSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
kindstring | nullRegistered: refused (400); ask with requestVehicleChange
vinstring | nullRegistered: refused (400); ask with requestVehicleChange
makestring | nullRegistered: refused (400); ask with requestVehicleChange
modelstring | nullRegistered: refused (400); ask with requestVehicleChange
yearinteger | nullRegistered: refused (400); ask with requestVehicleChange
useobjectRegistered: refused (400); ask with requestVehicleChange
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dplateobjectA Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.
حقول plate
numberstringSaudi plate number (the digits)
مثال:
1lettersstringSaudi 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)
مثال:
SKDtypestringSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfleet_numberstring | nullThe account's own number for the vehicle (door or fleet code), unique in the account when set
مثال:
TRK-089kindstring | nullvinstring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullModel year
مثال:
2024department_idstring | nullThe account department the vehicle belongs to
speed_limit_kmhinteger | nullThe vehicle's own speed limit for speeding alerts, km/h
مثال:
120cargo_min_cnumber | nullLowest allowed cargo temperature, °C (cold chain)
مثال:
2cargo_max_cnumber | nullHighest allowed cargo temperature, °C (cold chain)
مثال:
8tank_linteger | nullFuel tank size, litres
مثال:
400capacity_palletsinteger | nullHow many pallets the vehicle carries (dispatch load)
مثال:
12fuel_typestring | nullusestringunset: 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_rentalotherunsetdriver_idstring | nullThe driver of the vehicle's current driver session
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zretired_atstring | null (date-time)When it was taken out of service; null while in service
retire_reasonstring | null
الأخطاء
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}'{
"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
typestringistimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.
أحد:
istimaraoperating_cardinsuranceperiodic_inspectionnumberstring | nullمثال:
OC-2291847issued_onstring | null (date)مثال:
2026-01-12expires_onstring | null (date)مثال:
2027-01-11updated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/documents" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dtypestringالمسار مطلوبمثال:
operating_card
محتوى الطلب
numberstring | nullمثال:
OC-2291847issued_onstring | null (date)مثال:
2026-01-12expires_onstring | null (date)مثال:
2027-01-11
الاستجابة 200
typestringistimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.
أحد:
istimaraoperating_cardinsuranceperiodic_inspectionnumberstring | nullمثال:
OC-2291847issued_onstring | null (date)مثال:
2026-01-12expires_onstring | null (date)مثال:
2027-01-11updated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
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"}'{
"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-9e0f1a2b3c4dtypestringالمسار مطلوبمثال:
operating_cardreasonstringالاستعلامWhy it is deleted (kept in the history)
الاستجابة 200
typestringistimara: registration; operating_card: the TGA operating card; insurance: motor insurance; periodic_inspection: FAHAS.
أحد:
istimaraoperating_cardinsuranceperiodic_inspectionnumberstring | nullمثال:
OC-2291847issued_onstring | null (date)مثال:
2026-01-12expires_onstring | null (date)مثال:
2027-01-11updated_atstring (date-time)مثال:
2026-11-17T08:30:00Z
الأخطاء
curl -X DELETE "https://api.ping.nml.sa/v1/vehicles/019ac0c4-be6f-7071-c28d-9e0f1a2b3c4d/documents/operating_card" \
-H "Authorization: Bearer $PING_API_KEY"{
"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-4e5f6a7b8c9dIdempotency-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-4e5f6a7b8c9dvehicle_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9ddriver_idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dsourcestringmanual: assigned through the API or console; ibutton: identified in the vehicle
أحد:
manualibuttonstarted_atstring (date-time)مثال:
2026-11-17T08:30:00Zended_atstring | null (date-time)Null while the session is open
الأخطاء
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"}'{
"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.
الأخطاء
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-4e5f6a7b8c9dlimitintegerالاستعلامItems per page, 1 to 200 (default 50).
cursorstringالاستعلامThe next_cursor of the previous page.
الاستجابة 200
dataobject[]حقول data
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9datstring (date-time)مثال:
2026-11-17T08:30:00Zkindstringأحد:
registeredupdateddepartment_changeddriver_assigneddocument_recordeddocument_deletedretiredactorstringWho did it (user:<id>, agent:<name>, system:<service>)
مثال:
user:usr_4Kd9plate_codestring | nullfieldstring | nullfromstring | nullمثال:
100tostring | nullمثال:
120from_department_idstring | nullto_department_idstring | nulldriver_idstring | nulldocument_typestring | nullexpires_onstring | null (date)reasonstring | nullnotestring | nullrequest_idstring | nullThe vehicle request it applied (registered and updated by an approved request)
next_cursorstring | nullمثال:
eyJpZCI6InZlaF83S3EyIn0
الأخطاء
curl "https://api.ping.nml.sa/v1/vehicles/019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9d/history" \
-H "Authorization: Bearer $PING_API_KEY"{
"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_offreturnedothernotestring | nullمثال:
Sold to the dealer with 412,000 km
الاستجابة 200
idstringمثال:
019ac0c4-6f1e-7a3b-9c2d-4e5f6a7b8c9dplateobjectA Saudi plate: its digits, its letters in their Latin form (3, or 2 on a motorcycle) and its type. Unique in the account.
حقول plate
numberstringSaudi plate number (the digits)
مثال:
1lettersstringSaudi 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)
مثال:
SKDtypestringSaudi vehicle plate type
أحد:
private_carprivate_light_transportprivate_heavy_transportprivate_small_busprivate_large_buspublic_light_transportpublic_heavy_transportpublic_small_buspublic_large_bustaxidiplomatictemporarypublic_worksexportmotorcycletrailerhistoric
plate_codestringSaudi plate as one string, as the dashcam reads it: 1-4 digits then 2-3 letters (Latin form)
مثال:
2070SKDfleet_numberstring | nullThe account's own number for the vehicle (door or fleet code), unique in the account when set
مثال:
TRK-089kindstring | nullvinstring | nullmakestring | nullمثال:
Toyotamodelstring | nullمثال:
Hiluxyearinteger | nullModel year
مثال:
2024department_idstring | nullThe account department the vehicle belongs to
speed_limit_kmhinteger | nullThe vehicle's own speed limit for speeding alerts, km/h
مثال:
120cargo_min_cnumber | nullLowest allowed cargo temperature, °C (cold chain)
مثال:
2cargo_max_cnumber | nullHighest allowed cargo temperature, °C (cold chain)
مثال:
8tank_linteger | nullFuel tank size, litres
مثال:
400capacity_palletsinteger | nullHow many pallets the vehicle carries (dispatch load)
مثال:
12fuel_typestring | nullusestringunset: 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_rentalotherunsetdriver_idstring | nullThe driver of the vehicle's current driver session
created_atstring (date-time)مثال:
2026-11-17T08:30:00Zupdated_atstring (date-time)مثال:
2026-11-17T08:30:00Zretired_atstring | null (date-time)When it was taken out of service; null while in service
retire_reasonstring | null
الأخطاء
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"}'{
"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"
}