{"type":"object", "title": "client", "name": "client", "description": "A example client.", "properties":{ "id":{ "description":"Unique identifier - UUID", "identity":true, "readonly":true, "type":"string", "maxLength": 22, "minLength":22 }, "number":{ "description": "Unique number, auto-created for new client without number.", "type":"string", "maxLength": 50 }, "organisation":{ "description": "Name of a company. This or lastname must be present", "required" : true, "type":"string", "maxLength": 100 }, "last_name":{ "description": "Last name of a person. At least this or the organisation field must be filled for new records", "type":"string", "maxLength": 50 }, "first_name":{ "description": "First name of a person.", "type":"string", "maxLength": 50 }, "email":{ "description": "Email address of the contact.", "type":"string", "maxLength": 100 }, "created_at":{ "description": "Date the record was created in SK. Never changes afterwards.", "format":"date-time", "readonly":true, "type":"string" }, "updated_at":{ "description": "Last date when the record was edited.", "format":"date-time", "readonly":true, "type":"string" }, "phone_mobile":{ "description": "Mobile phone number", "type":"string", "maxLength": 30 }, "cash_discount":{ "description": "Default cash discount for new invoices.", "maximum": 100, "minimum": 0, "type":"number" }, "addresses":{ "description": "A client can have many addresses, sorted by date descending(new first). Default address is the most recent one.", "type":"array", "properties" : {"$ref":"./address.json#properties"} }, "work_address":{ "description": "The work address as an example for a single nested/related object", "type":"object", "properties" : {"$ref":"./address.json#properties"} } }, "links":[ { "rel": "self", "href": "clients/{id}" }, { "rel": "instances", "href": "clients", "properties" : { "page":{ "title" : "Page", "description": "In paginated results set the page to look for", "type":"number" }, "per_page":{ "title" : "Per page", "description": "Results per page. Default is 10, max is 100", "type":"number" }, "filter[q]":{ "title" : "Search", "description": "Wildcard search in first, last_name, organisation, email, number", "type":"string" }, "sort_by":{ "title" : "Sort by", "description": "Sort the results by the given field => number", "enum":["organisation", "number","email","first_name","last_name", "created_at", "updated_at"], "type": "string" } } }, { "rel": "destroy", "href": "clients/{id}", "method": "DELETE" }, { "rel": "update", "href": "clients/{id}", "method": "PUT" }, { "rel": "create", "href": "clients", "method": "POST" }, { "rel": "documents", "href": "clients/{id}/documents" }, { "rel": "test replacement", "href": "clients/{id}/{first_name}" } ] }