Validate a status transition without performing it
POST
/api/v1/orders/{id}/validate-transition
const url = 'https://api.dokanmazad.com/api/v1/orders/cmosor2zy000313ny24hgtfy0/validate-transition';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"targetStatus":"DepositConfirmed"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dokanmazad.com/api/v1/orders/cmosor2zy000313ny24hgtfy0/validate-transition \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "targetStatus": "DepositConfirmed" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Order CUID
Example
cmosor2zy000313ny24hgtfy0Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
targetStatus
required
Target status to validate — checks rules without performing the transition
string
Examples
Exampledefault
{ "targetStatus": "DepositConfirmed"}Responses
Section titled “Responses”Success
Media typeapplication/json
object
success
required
boolean
data
required
meta
object
page
integer
limit
integer
total
integer
totalPages
integer
data
required
object
valid
required
Whether the transition is valid for the current user role and order state
boolean
errors
required
Array of human-readable error messages when valid=false (empty when valid=true)
Array<string>
currentStatus
required
The current status of the order
string
targetStatus
required
The target status that was validated
string
allowedTransitions
required
All valid next statuses from the current state (for the calling role)
Array<string>
missingRequirements
Machine-readable list of unmet prerequisites when valid=false. Each item: { type, code, message }. Empty array when valid=true.
Array
Examples
Examplesuccess
{ "success": true, "data": { "valid": true, "errors": [], "currentStatus": "DepositSubmitted", "targetStatus": "DepositConfirmed", "allowedTransitions": [ "DepositConfirmed", "Cancelled" ], "missingRequirements": [] }}Unauthorized — missing or invalid API key
Media typeapplication/json
object
success
required
boolean
error
required
string
statusCode
required
integer
Example
{ "success": false}Forbidden — route not in this key’s allowedRoutes
Media typeapplication/json
object
success
required
boolean
error
required
string
statusCode
required
integer
Example
{ "success": false}Rate limit exceeded
Media typeapplication/json
object
success
required
boolean
error
required
string
statusCode
required
integer
Example
{ "success": false}Headers
Section titled “Headers”Retry-After
integer
Seconds to wait before retrying
