{"type":"object", "title": "client", "description": "A client as seen by SalesKing", "properties": { "id": { "identity":true, "readonly":true, "type":"string" }, "number": { "description": "Unique number, auto-created by SK for new client without number.", "type":"string" }, "organisation": { "description": "Name of a company. At least this or the lastname field must be filled for new records", "required" : true, "type":"string" }, "last_name": { "description": "Last name of a person. At least this or the organisation field must be filled for new records", "type":"string" }, "first_name": { "description": "First name of a person.", "type":"string" }, "gender": { "description": "Can be empty for a company. Is used in salutation", "enum":["male", "female"], "type":"string" }, "position": { "description": "Position of a person in a company.", "type":"string" }, "title": { "description": "Academical title of a person e.g. Dr., Prof", "type":"string" }, "tax_number": { "description": "Tax number, normaly applies to a private person", "type":"string" }, "vat_number": { "description": "VAT number, for a company or person paying value added taxes.", "type":"string" }, "email": { "description": "Email address of the contact.", "type":"string" }, "url": { "description": "An url associated with the person, e.g its company website.", "type":"string" }, "birthday": { "format":"date", "type":"string" }, "tag_list": { "description": "Space seperated list of tags.", "type":"string" }, "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" }, "bank_number": { "description": "Number of the bank", "type":"string" }, "bank_name": { "description": "Name of the bank.", "type":"string" }, "bank_account_number": { "description": "Number of the bank account.", "type":"string" }, "bank_iban": { "description": "IBAN Number of the bank account. Is validated", "type":"string" }, "bank_swift": { "description": "SWIFT BIC- Bank Identifier Code", "type":"string" }, "bank_owner": { "description": "Owner of the bank account.", "type":"string" }, "phone_fax": { "description": "Fax number", "type":"string" }, "phone_office": { "description": "Office phone number", "type":"string" }, "phone_home": { "description": "Private phone number.", "type":"string" }, "phone_mobile": { "description": "Mobile phone number", "type":"string" }, "lock_version": { "description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.", "type":"integer" }, "cash_discount": { "description": "Default cash discount for new invoices.", "type":"number" }, "due_days": { "description": "Default due days for new invoices.", "type":"integer" }, "address_field": { "description": "Returns the address field used on new docs. Consist of Organisation name and default(first) address", "readonly":true, "type":"string" }, "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":"./addresses.json#properties"} }, "team_id":{ "description": "A team uuid. If set only the team and its parent teams can see the record.", "type":"string" } }, "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" }, "filter[q]":{ "title" : "Search", "description": "Search in first, last_name, organisation, email, number", "type":"string" }, "filter[tags]":{ "title" : "Tags", "description": "Filter by a space delimited list of tags", "type":"string" }, "filter[from]":{ "title" : "From date", "description": "All objects with a date after the date" }, "filter[to]":{ "title" : "To date", "description": "All objects with date before the date" }, "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' }, "sort":{ "title" : "Sort", "enum":["ASC","DESC"], "description": "Sort the results in ASC or DESC" } } }, { "rel": "destroy", "href": "clients/{id}", "method": "DELETE" }, { "rel": "update", "href": "clients/{id}", "method": "PUT" }, { "rel": "create", "href": "clients", "method": "POST" }, { "rel": "attachments", "href": "clients/{id}/attachments" }, { "rel": "invoices", "href": "clients/{id}/invoices" }, { "rel": "estimates", "href": "clients/{id}/estimates" }, { "rel": "orders", "href": "clients/{id}/orders" }, { "rel": "credit_notes", "href": "clients/{id}/credit_notes" }, { "rel": "recurrings", "href": "clients/{id}/recurrings" }, { "rel": "payment_reminders", "href": "clients/{id}/payment_reminders" }, { "rel": "comments", "href": "clients/{id}/comments" }, { "rel": "emails", "href": "clients/{id}/emails" } ] }