Update a draft contract
const url = 'https://api.dokanmazad.com/api/v1/contracts/cmcont00000001ny11aabbcc0';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"customerName":"Ahmed Ali","customerPhone":"+971501234567","totalAmount":27000,"currency":"USD"}'};
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/contracts/cmcont00000001ny11aabbcc0 \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "customerName": "Ahmed Ali", "customerPhone": "+971501234567", "totalAmount": 27000, "currency": "USD" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Contract ID (CUID)
Example
cmcont00000001ny11aabbcc0Request Bodyrequired
Section titled “Request Bodyrequired”object
Customer full name in English
Customer name in Arabic
Customer ID / passport number
Customer phone number
Customer email address
Customer mailing address
Customer country
Uploaded ID document metadata JSON — { url, type (e.g. “passport”) }
object
Car details JSON snapshot (makeEn, modelEn, year, price, …)
object
Total contract amount (minimum 0)
ISO 4217 — USD | KRW | AED
Vehicle Identification Number
Vehicle mileage (e.g. “12,500 km”)
Vehicle color
Contract terms text
Additional notes
URL of the generated contract PDF
Examples
{ "customerName": "Ahmed Ali", "customerPhone": "+971501234567", "totalAmount": 27000, "currency": "USD"}Responses
Section titled “Responses”Success
object
object
object
Contract CUID
Sequential contract number
Contract status (Draft while editable)
Updated customer name
Updated contract amount
Last updated timestamp
Examples
{ "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
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
