Transition order status
const url = 'https://api.dokanmazad.com/api/v1/orders/cmosor2zy000313ny24hgtfy0/status';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"status":"DepositConfirmed","version":1,"notes":"Deposit verified via bank transfer"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.dokanmazad.com/api/v1/orders/cmosor2zy000313ny24hgtfy0/status \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "status": "DepositConfirmed", "version": 1, "notes": "Deposit verified via bank transfer" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Order CUID
Example
cmosor2zy000313ny24hgtfy0Request Bodyrequired
Section titled “Request Bodyrequired”object
Target status to transition to (must follow state machine rules)
Current version from order.version — throws 409 ConflictException on mismatch (minimum 1)
Reason for the status change (stored in the immutable OrderLog audit entry)
Inspection date — required when transitioning to InspectionScheduled (ISO 8601 or Date-parseable string)
Examples
{ "status": "DepositConfirmed", "version": 1, "notes": "Deposit verified via bank transfer"}Responses
Section titled “Responses”Success
object
object
object
Order CUID
New order status after transition
Valid next statuses from the new state (role-aware)
Updated progress percentage (0–100, -1 for cancelled)
Whether the order can be cancelled from the new status
Whether the new status is terminal
Incremented version after transition
Updated timestamp
Examples
{ "success": true, "data": { "id": "cmosor2zy000313ny24hgtfy0", "orderNumber": 1042, "status": "DepositConfirmed", "allowedStatusTransitions": [ "InspectionScheduled", "Cancelled" ], "progress": 7, "canCancel": true, "isTerminal": false, "version": 2, "customerId": "cmoabcde000001ny11aabbcc0", "marketerId": "cmoabcde000002ny22aabbcc0", "tenantId": "cmoabcde000003ny33aabbcc0", "carDetails": { "makeEn": "BMW", "modelEn": "3 Series", "year": 2023, "price": 25000 }, "totalAmount": 25000, "currency": "USD", "notes": null, "inspectionDate": null, "customer": { "id": "cmoabcde000001ny11aabbcc0", "name": "Ahmed Ali", "email": "ahmed@example.com" }, "marketer": { "id": "cmoabcde000002ny22aabbcc0", "name": "Sales Rep", "email": "sales@example.com" }, "createdAt": "2026-05-01T08:00:00.000Z", "updatedAt": "2026-05-02T08:00:00.000Z" }}Unauthorized — missing or invalid API key
object
Example
{ "success": false}Forbidden — route not in this key’s allowedRoutes
object
Example
{ "success": false}Rate limit exceeded
object
Example
{ "success": false}Headers
Section titled “Headers”Seconds to wait before retrying
