Mark contract as signed (accepts { signedDocument } body)
PATCH
/api/v1/contracts/{id}/sign
const url = 'https://api.dokanmazad.com/api/v1/contracts/cmcont00000001ny11aabbcc0/sign';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"signedDocument":{"url":"https://cdn.dokanmazad.com/contracts/signed/contract-201-signed.pdf","filename":"contract-201-signed.pdf","mimeType":"application/pdf","size":204800}}'};
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/sign \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "signedDocument": { "url": "https://cdn.dokanmazad.com/contracts/signed/contract-201-signed.pdf", "filename": "contract-201-signed.pdf", "mimeType": "application/pdf", "size": 204800 } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Contract ID (CUID)
Example
cmcont00000001ny11aabbcc0Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
signedDocument
Signed document metadata stored as flexible JSON. Recommended shape: { url, filename, mimeType, size }. The field is stored as-is — any JSON structure is accepted.
object
Examples
Exampledefault
{ "signedDocument": { "url": "https://cdn.dokanmazad.com/contracts/signed/contract-201-signed.pdf", "filename": "contract-201-signed.pdf", "mimeType": "application/pdf", "size": 204800 }}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
id
required
Contract CUID
string
status
required
New status — always Signed after this call
string
contractNumber
required
Sequential contract number
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": 25000, "currency": "USD", "vin": "WBAXH1C50DD123456", "mileage": "12,500 km", "status": "Signed", "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}Headers
Section titled “Headers”Retry-After
integer
Seconds to wait before retrying
