Generate the contract PDF server-side and persist its URL
POST
/api/v1/contracts/{id}/pdf
const url = 'https://api.dokanmazad.com/api/v1/contracts/cmcont00000001ny11aabbcc0/pdf';const options = {method: 'POST', headers: {'X-API-Key': '<X-API-Key>'}};
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/cmcont00000001ny11aabbcc0/pdf \ --header 'X-API-Key: <X-API-Key>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Contract ID (CUID)
Example
cmcont00000001ny11aabbcc0Responses
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
pdfUrl
URL of the generated PDF
string
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": "Draft", "pdfUrl": "https://cdn.dokanmazad.com/contracts/contract-201.pdf", "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
