Create contract
const url = 'https://api.dokanmazad.com/api/v1/contracts';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"orderId":"cmosor2zy000313ny24hgtfy0","customerName":"Ahmed Ali","customerNameAr":"أحمد علي","customerPhone":"+971501234567","customerEmail":"ahmed@example.com","customerCountry":"UAE","carDetails":{"makeEn":"BMW","modelEn":"3 Series","year":2023,"price":25000},"totalAmount":25000,"currency":"USD","vin":"WBAXH1C50DD123456","mileage":"12,500 km"}'};
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/contracts \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "orderId": "cmosor2zy000313ny24hgtfy0", "customerName": "Ahmed Ali", "customerNameAr": "أحمد علي", "customerPhone": "+971501234567", "customerEmail": "ahmed@example.com", "customerCountry": "UAE", "carDetails": { "makeEn": "BMW", "modelEn": "3 Series", "year": 2023, "price": 25000 }, "totalAmount": 25000, "currency": "USD", "vin": "WBAXH1C50DD123456", "mileage": "12,500 km" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Order CUID this contract belongs to
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
Contract total amount (minimum 0)
ISO 4217 — USD | KRW | AED (default: USD)
Vehicle Identification Number
Vehicle mileage (e.g. “12,500 km”)
Vehicle color
Contract terms text
Additional notes
Examples
{ "orderId": "cmosor2zy000313ny24hgtfy0", "customerName": "Ahmed Ali", "customerNameAr": "أحمد علي", "customerPhone": "+971501234567", "customerEmail": "ahmed@example.com", "customerCountry": "UAE", "carDetails": { "makeEn": "BMW", "modelEn": "3 Series", "year": 2023, "price": 25000 }, "totalAmount": 25000, "currency": "USD", "vin": "WBAXH1C50DD123456", "mileage": "12,500 km"}Responses
Section titled “Responses”Success
object
object
object
Newly created contract CUID
Parent order CUID
Auto-incremented sequential contract number
Always Draft on create
Creation 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": 25000, "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
