Skip to content

Update a draft contract

PATCH
/api/v1/contracts/{id}
curl --request PATCH \
--url https://api.dokanmazad.com/api/v1/contracts/cmcont00000001ny11aabbcc0 \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "customerName": "Ahmed Ali", "customerPhone": "+971501234567", "totalAmount": 27000, "currency": "USD" }'
id
required
string

Contract ID (CUID)

Example
cmcont00000001ny11aabbcc0
Media typeapplication/json
object
customerName

Customer full name in English

string
customerNameAr

Customer name in Arabic

string
customerIdNumber

Customer ID / passport number

string
customerPhone

Customer phone number

string
customerEmail

Customer email address

string
customerAddress

Customer mailing address

string
customerCountry

Customer country

string
customerIdDocument

Uploaded ID document metadata JSON — { url, type (e.g. “passport”) }

object
carDetails

Car details JSON snapshot (makeEn, modelEn, year, price, …)

object
totalAmount

Total contract amount (minimum 0)

number
currency

ISO 4217 — USD | KRW | AED

string
vin

Vehicle Identification Number

string
mileage

Vehicle mileage (e.g. “12,500 km”)

string
color

Vehicle color

string
terms

Contract terms text

string
notes

Additional notes

string
contractPdfUrl

URL of the generated contract PDF

string
Examples
Exampledefault
{
"customerName": "Ahmed Ali",
"customerPhone": "+971501234567",
"totalAmount": 27000,
"currency": "USD"
}

Success

Media typeapplication/json
object
success
required
boolean
data
required
meta
object
page
integer
limit
integer
total
integer
totalPages
integer
data
required
object
id
required

Contract CUID

string
contractNumber
required

Sequential contract number

number
status
required

Contract status (Draft while editable)

string
customerName
required

Updated customer name

string
totalAmount

Updated contract amount

number
updatedAt
required

Last updated timestamp

string format: date-time
Examples
Examplesuccess
{
"success": true,
"data": {
"id": "cmcont00000001ny11aabbcc0",
"orderId": "cmosor2zy000313ny24hgtfy0",
"contractNumber": 201,
"customerName": "Ahmed Ali",
"customerNameAr": "أحمد علي",
"customerIdNumber": "A12345678",
"customerPhone": "+971501234567",
"customerEmail": "ahmed@example.com",
"customerAddress": "123 Main St, Dubai, UAE",
"customerCountry": "UAE",
"carDetails": {
"makeEn": "BMW",
"modelEn": "3 Series",
"year": 2023,
"price": 25000
},
"totalAmount": 27000,
"currency": "USD",
"vin": "WBAXH1C50DD123456",
"mileage": "12,500 km",
"status": "Draft",
"pdfUrl": null,
"createdAt": "2026-05-01T10:00:00.000Z"
}
}

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
}
Retry-After
integer

Seconds to wait before retrying