json/v2.0/contact.json in sk_api_schema-0.10.6 vs json/v2.0/contact.json in sk_api_schema-0.11.0
- old
+ new
@@ -1,49 +1,56 @@
-{"type":"object",
+{
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type":"object",
"title": "contact",
- "name": "contact",
- "description": "A contact can be a lead, client or supplier, depending on its type field. Use the filter[type] parameter to show only contacts of a kind. Use this resource instead of clients, as they are deprecated and dropped in the future.",
+ "description": "A contact can be a lead, client or supplier, depending on its type field. Use the filter[type] parameter to show only contacts of a kind.",
+ "required" : ["type"],
"properties":{
"id":{
"description":"Unique identifier - UUID",
"identity":true,
- "readonly":true,
+ "readOnly":true,
"type":"string",
"maxLength": 22,
"minLength":22
},
+ "company_id":{
+ "description":"Company",
+ "readOnly":true,
+ "type":"string",
+ "maxLength": 22,
+ "minLength":22
+ },
"parent_id":{
"description": "ID of a parent contact.",
"type":"string",
"maxLength": 22,
"minLength":22
},
"type":{
"description": "Type of contact",
"enum":["Client", "Lead", "Supplier"],
- "required" : true,
"type":"string",
- "maxLength": 50
+ "default":"Lead"
},
"is_employee":{
"description": "An employee gets number, organisation, tax and vat_number from its parent. If you set any of these, they are overwritten. When changing a parent-contact the fields on his direct child-employees are updated too.",
"type": "boolean",
"default": false
},
"number":{
- "description": "Unique number, auto-created by SK for new contacts(client, supplier) without number.",
+ "description": "Unique number, auto-set, if empty, for new Client and Suppliers from SK's contact number schema.",
"type":"string",
"maxLength": 50
},
"organisation":{
- "description": "Name of a company. This or lastname must be present",
- "required" : true,
+ "description": "Name of a company. This or lastname MUST be present",
"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",
+ "description": "Last name of a person. This or the organisation field must be present for new records",
"type":"string",
"maxLength": 50
},
"first_name":{
"description": "First name of a person.",
@@ -56,11 +63,11 @@
"type":"string"
},
"notes":{
"description": "Notes for a contact. For day to day information you should use comments instead.",
"type":"string",
- "format": "text"
+ "format": "string"
},
"position":{
"description": "Position of a person in a company.",
"type":"string",
"maxLength": 50
@@ -100,17 +107,17 @@
"type":"string"
},
"created_at":{
"description": "Date the record was created in SK. Never changes afterwards.",
"format":"date-time",
- "readonly":true,
+ "readOnly":true,
"type":"string"
},
"updated_at":{
"description": "Last date when the record was edited.",
"format":"date-time",
- "readonly":true,
+ "readOnly":true,
"type":"string"
},
"language":{
"description": "Should be a valid language short-code: de-DE, fr, en-GB; like defined in your account language menu. When the client is emailed, a localized version of a multi-language template(email, pdf) will be used if available. The language will also be set for new documents.",
"type":"string",
@@ -177,29 +184,33 @@
"type":"string",
"maxLength": 30
},
"lock_version":{
"description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.",
+ "readOnly":true,
"type":"integer"
},
"cash_discount":{
"description": "Default cash discount for new invoices.",
"type":"number"
},
"due_days":{
- "description": "Default due days for new invoices.",
+ "description": "Default due days for new documents.",
"type":"integer"
},
"address_field":{
"description": "Returns the address field used on new docs. Consist of Organisation name and default(first) address",
- "readonly":true,
+ "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":"./address.json#properties"}
+ "type": "array",
+ "items": {
+ "type": "object",
+ "$ref" : "./address.json#"
+ }
},
"team_id":{
"description": "A team uuid. If set only the team and its parent teams can see the record. The team is set for all new documents and related objects like comments, attachments, emails. When changed ALL related objects are updated with the new team!!",
"type":"string",
"maxLength": 22,
@@ -231,12 +242,18 @@
"description": "Likelihood that the sales potential will be realised in percent e.g. How hot is the contact, How much of the sales potential will we get also see expected_revenue?",
"type":"number"
},
"expected_revenue":{
"description": "Product of the probability and sales potential. e.g how much of the sales_potential can we get?",
- "readonly":true,
+ "readOnly":true,
"type":"number"
+ },
+ "tax_exemption_id":{
+ "description": "ID of a tax exemption. New documents inherit the tax exemption and will be created without any taxes.",
+ "type":"string",
+ "maxLength": 22,
+ "minLength":22
}
},
"links":[
{ "rel": "self",
"href": "contacts/{id}"
@@ -362,57 +379,36 @@
{ "rel": "create",
"href": "contacts",
"method": "POST"
},
{ "rel": "documents",
- "href": "contacts/{id}/documents"
+ "href": "documents?filter[contact_ids]={id}"
},
{ "rel": "attachments",
- "href": "contacts/{id}/attachments"
+ "href": "attachments?filter[related_object_ids]={id}"
},
{ "rel": "invoices",
- "href": "contacts/{id}/invoices"
+ "href": "invoices?filter[contact_ids]={id}"
},
{ "rel": "estimates",
- "href": "contacts/{id}/estimates"
+ "href": "estimates?filter[contact_ids]={id}"
},
{ "rel": "orders",
- "href": "contacts/{id}/orders"
+ "href": "orders?filter[contact_ids]={id}"
},
{ "rel": "credit_notes",
- "href": "contacts/{id}/credit_notes"
+ "href": "credit_notes?filter[contact_ids]={id}"
},
{ "rel": "recurrings",
- "href": "contacts/{id}/recurrings"
+ "href": "recurrings?filter[contact_ids]={id}"
},
{ "rel": "payment_reminders",
- "href": "contacts/{id}/payment_reminders"
+ "href": "payment_reminders?filter[contact_ids]={id}"
},
{ "rel": "comments",
- "href": "contacts/{id}/comments"
+ "href": "comments?filter[related_object_ids]={id}"
},
{ "rel": "emails",
- "href": "contacts/{id}/emails"
- },
- { "rel": "emails create",
- "href": "contacts/{id}/emails",
- "method": "POST",
- "properties" : {
- "template_id":{
- "title" : "Template",
- "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
- "type":"string",
- "maxLength": 22,
- "minLength":22
- },
- "send":{
- "title" : "Send email",
- "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
- },
- "archived_pdf":{
- "title" : "Attach archived pdf",
- "description": "Adds the archived pdf from the related resource(if it has one)."
- }
- }
+ "href": "emails?filter[related_object_ids]={id}"
}
]
}
\ No newline at end of file