Skip to content

Create contract

POST
/api/v1/contracts
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" }'
Media typeapplication/json
object
orderId
required

Order CUID this contract belongs to

string
customerName
required

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

Contract total amount (minimum 0)

number
currency

ISO 4217 — USD | KRW | AED (default: USD)

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
Examples
Exampledefault
{
"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"
}

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

Newly created contract CUID

string
orderId
required

Parent order CUID

string
contractNumber
required

Auto-incremented sequential contract number

number
status
required

Always Draft on create

string
createdAt
required

Creation 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": 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

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