Add New Contract

POST/api/contracts

Headers

FieldTypeDescription
authtoken String Authentication token, generated from admin area

Parameters

FieldTypeDescription
subject String Mandatory. Contract subject
datestart Date Mandatory. Contract start date
client Number Mandatory. Customer ID
dateend Date Optional. Contract end date
contract_type Number Optional. Contract type
contract_value Number Optional. Contract value
description String Optional. Contract description
content String Optional. Contract content
curl -X POST "https://yoursite.com/api/contracts" \
  -H "authtoken: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subject": "...", "datestart": "...", "client": "...", "dateend": "...", "contract_type": "...", "contract_value": "...", "description": "...", "content": "..." }'

Success-Response:

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Contract Added Successfully"
}

Error-Response:

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Contract ID Exists"
}

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "newitems[]": "The Start date field is required"
	    },
	    "message": "<p>The Start date field is required</p>\n"
	}

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "subtotal": "The Subject field is required"
	    },
	    "message": "<p>The Subject field is required</p>\n"
	}

Error-Response:

  HTTP/1.1 404 Not Found
   {
	    "status": false,
	    "error": {
	        "total": "The Customer ID is required"
	    },
	    "message": "<p>The Customer ID is required</p>\n"
	}
MethodPOST
Path/api/contracts
GroupContracts
Sincev0.3.0
Defined inmodules/api/controllers/Contracts.php