API – Contracts¶
Paths are under https://api.innovanet.com. Header Authorization: Bearer inv_mcp_…. The innovanet() function is in the API chapter.
The contract list has no success envelope. A successful response is the object with records directly.
GET /api/contracts¶
| Parameter | Type | Required | Description |
|---|---|---|---|
page |
integer | no | default 1 |
per_page |
integer | no | default 20 |
search |
string | no | |
project_id |
integer | no | |
company_id |
integer | no | partner |
contract_type |
integer | no | from GET /api/contracts/types |
valid_from, valid_to |
date | no | |
parent_only |
boolean | no | |
deleted |
string | no | active (default), deleted, all |
state |
string | no | valid, expiring (both only contracts with a signed scan), unsigned (already running, but without a signed scan), upcoming, expired |
unsigned |
boolean | no | Only contracts that have not ended and have no signed scan (includes those that have not started yet) |
order_by |
string | no | default contract_id |
order_dir |
string | no | asc or desc |
PHP
$res = innovanet('GET', '/api/contracts?page=1&per_page=20&state=valid');
Response 200
{
"records": [
{
"contract_id": 8,
"contract_number": "Z20260008",
"contract_subject": "Servisná zmluva",
"contract_type": 1,
"contract_valid_from": "2026-01-01",
"contract_valid_to": "2026-12-31",
"contract_total": "12000.00",
"effective_valid_to": "2026-12-31",
"supplement_count": 0,
"validity_state": "valid",
"has_signed_scan": true
}
],
"total": 1,
"page": 1,
"per_page": 20,
"total_pages": 1
}
GET /api/contracts/stats is in a success envelope. Code lists: /types, /cost-types, /payment-types, /party-roles.
Detail: GET /api/contracts/8.
POST /api/contracts¶
Only the number is required. The other fields are optional.
| Field | Type | Required | Description |
|---|---|---|---|
contract_number |
string | yes | at most 200 characters. Must be unique among contracts that are not deleted |
contract_type |
integer | no | |
contract_subject |
string | no | |
contract_project |
integer | no | the project must exist |
contract_owner |
integer | no | master user id |
contract_signed |
date | no | |
contract_valid_from |
date | no | |
contract_valid_to |
date | no | not earlier than contract_valid_from |
contract_payment_term |
integer | no | payment term in days, 0 to 3650 |
contract_payment_type |
integer | no | |
contract_currency |
integer | no | the currency must exist |
contract_total |
number | no | without VAT, not negative |
contract_total_with_vat |
number | no | not negative and not lower than contract_total |
party_company_id |
integer | no | partner |
party_role |
integer | no | |
contract_parent_id |
integer | no | parent contract, for an amendment |
Request
{
"contract_number": "Z20260008",
"contract_type": 1,
"contract_subject": "Servisná zmluva",
"contract_project": 42,
"party_company_id": 120,
"party_role": 1,
"contract_valid_from": "2026-01-01",
"contract_valid_to": "2026-12-31",
"contract_currency": 1,
"contract_total": 12000,
"contract_total_with_vat": 14760
}
cURL
curl -sS -X POST "https://api.innovanet.com/api/contracts" \
-H "Authorization: Bearer inv_mcp_…" \
-H "Content-Type: application/json" \
-d "{\"contract_number\":\"Z20260008\",\"contract_subject\":\"Servisná zmluva\",\"party_company_id\":120,\"contract_valid_from\":\"2026-01-01\",\"contract_valid_to\":\"2026-12-31\",\"contract_total\":12000}"
PHP
$res = innovanet('POST', '/api/contracts', [
'contract_number' => 'Z20260008',
'contract_subject' => 'Servisná zmluva',
'party_company_id' => 120,
'contract_valid_from' => '2026-01-01',
'contract_valid_to' => '2026-12-31',
'contract_total' => 12000,
]);
Response 201
{
"success": true,
"message": "Contract created",
"data": { "contract_id": 8 }
}
Without permission to create contracts the response is 403.
Validation rules. A violation returns 422 with errors per field (the same for PUT):
contract_numberis unique among contracts that are not deleted. A supplement number must be unique within its contract.contract_totalandcontract_total_with_vatare not negative, and the amount with VAT is not lower than the amount without VAT. Exception: a supplement of the type change of amount (contract_child_type=amount) may have a negative amount and so lower the contract.- The project (
contract_project) and the currency (contract_currency) must exist. contract_payment_term0 to 3650 days,contract_warranty0 to 600 months,contract_invoicing_frequency0 to 60 months,contract_invoicing_repetition0 to 1200.- A retainer given in percent (type 1, fields
contract_retainer_short_valueandcontract_retainer_long_value) is at most 100 %.
A database error on save does not expose technical details (SQL, server) to the client; a general message is returned. A deleted contract does not enter the cashflow forecast.
Update: PUT /api/contracts/8. Amendment: POST /api/contracts/8/supplements (the supplement number must be unique within the contract, otherwise 422). Note: POST /api/contracts/8/notes.
Other paths¶
Each path below belongs to this module. Field names are the ones the API reads. A downloaded file is not JSON.
GET /api/contracts/permissions¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/contracts/cost-types¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/contracts/payment-types¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/contracts/party-roles¶
No body.
Response 200 – Envelope { "success": true, "data": ... }.
PUT /api/contracts/{id}/archive-location¶
Body
| Field | Type | Required |
|---|---|---|
location_number |
string | yes |
location_whole |
string | yes |
{
"location_number": "text",
"location_whole": "text"
}
$res = innovanet('PUT', '/api/contracts/1/archive-location', [
'location_number' => 'text',
'location_whole' => 'text',
]);
Response 200 – Envelope { "success": true, "data": ... }.
GET /api/contracts/{id}/attachments¶
No body. Returns all attachments of the contract – current, replaced and deleted ones (deleted files are never removed, only marked).
Response 200 – Envelope { "success": true, "data": { "attachments": [...], "has_signed_scan": bool, "has_original_file": bool } }. has_signed_scan / has_original_file are true when a current (non-deleted) file of that kind exists.
Attachment fields: attachment_id, type (original or signed), file_name, size, mime, uploaded_at, uploaded_by, uploaded_by_name, current (the newest non-deleted file of its kind), replaced (not deleted, but a newer one exists), replaced_by, deleted, deleted_at, deleted_by, deleted_by_name.
GET /api/contracts/{id}/attachments/{attachmentId}/download¶
Downloads one specific attachment by its attachment_id – also a replaced or deleted one (a deleted one carries the header X-Attachment-Deleted: 1). Anyone who may see the contract may download.
Response – The response is a file, not JSON.
GET /api/contracts/{id}/attachments/download¶
Parameters
| Field | Type | Required |
|---|---|---|
type |
string | no |
The API reads these fields. A field is required when the table says yes. Returns the current file of kind original or signed (default signed).
Response – The response is a file, not JSON.
DELETE /api/contracts/{id}/attachments/{attachmentId}¶
The delete is soft: the attachment is marked as deleted (who and when), the file stays on disk and in the list, and the portal shows it struck through. Deleting it again returns 404.
Response 200 – Envelope { "success": true, "data": ... }.
DELETE /api/contracts/{id}/attachments¶
Parameters
| Field | Type | Required |
|---|---|---|
type |
string | no |
The API reads these fields. A field is required when the table says yes. Soft-deletes the current file of that kind (same as above).
Response 200 – Envelope { "success": true, "data": ... }.
POST /api/contracts/{id}/original-file¶
Body
| Field | Type | Required |
|---|---|---|
file |
file | yes |
The file is sent as multipart, not in JSON.
Response 201 – Envelope { "success": true, "data": ... }.
POST /api/contracts/{id}/signed-scan¶
Body
| Field | Type | Required |
|---|---|---|
file |
file | yes |
The file is sent as multipart, not in JSON.
Response 201 – Envelope { "success": true, "data": ... }.
Want to try this feature? Start your innovanet trial →