json/v2.0/recurring.json in sk_api_schema-0.10.6 vs json/v2.0/recurring.json in sk_api_schema-0.11.0

- old
+ new

@@ -1,49 +1,54 @@ -{ "type":"object", +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type":"object", "title": "recurring", - "name": "recurring", "description": "An recurring is used as an template for new invoices.", + "required": ["number", "date", "final_date", "frequency" ], "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 + }, "number":{ "description": "Unique name to identify the document. Unlike all other document this one has no number schema and not auto assign", "type":"string", - "required":true, "maxLength": 50 }, "address_field":{ "description": "Receiver address, normally shown in envelope window. Defaults to client address_field if empty and client_id given.", "type":"string" }, "date":{ "description": "First date the recurring is issued. Not allowed to be in the past. YYYY-MM-DD", "format":"date", - "type":"string", - "required":true + "type":"string" }, "due_days":{ "description": "Used to calculate the due date of the recurring. Useless if date and due date are present.", "type":"integer" }, "final_date":{ "description": "The last date the recurring is executed. YYYY-MM-DD", "format":"date", - "type":"string", - "required":true + "type":"string" }, "frequency":{ "description": "Recurring frequency", "enum":["yearly", "monthly", "weekly", "quarterly", "biweekly", "sixmonthly"], - "type":"string", - "required":true + "type":"string" }, "payment_method":{ "description": "How the document is being payed. Used in new payments.", "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"], "type":"string" @@ -59,16 +64,16 @@ "maxLength": 255 }, "notes_before":{ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.", "type":"string", - "format":"text" + "format":"string" }, "notes_after":{ "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.", "type":"string", - "format":"text" + "format":"string" }, "tag_list":{ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.", "type":"string" }, @@ -96,104 +101,101 @@ "sepa_debit_sequence_type":{ "description": "SEPA direct debit sequence type. Check with you bank how they handle FRST(first) and FNAL(final) types. When exporting SEPA debit to your bank the type defaults to OOF if blank.", "type":"string", "enum":["FRST","OOFF","RCUR","FNAL"] }, - "client":{ - "description": "DEPRECATED: use contact", - "readonly":true, - "type":"object", - "properties":{"$ref":"./client.json#properties"} - }, - "client_id":{ - "description": "DEPRECATED: use contact_id", - "type":"string", - "maxLength": 22, - "minLength":22 - }, "contact":{ "description": "The contact for the document. Use contact_id field to set a contact.", - "readonly":true, + "readOnly":true, "type":"object", - "properties":{"$ref":"./contact.json#properties"} + "$ref":"./contact.json#" }, "contact_id":{ "description": "The contact uuid. When assigning a contact its language, currency, address_field (due days, cash discount) values are used for the document if those doc-fields are not set.", "type":"string", "maxLength": 22, "minLength":22 }, "team_id":{ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.", - "readonly" :true, + "readOnly" :true, "type":"string", "maxLength": 22, "minLength":22 }, - "line_items":{ - "description": "DEPRECATED use items", - "type":"array", - "properties":{"$ref":"./line_item.json#properties"} - }, "items":{ - "description": "Items for the document. Access items of all types including divider and sub_total items. GOTCHAs when using items instead of line_items: You MUST set the type field(CamelCasesItem class name) on each item. You cannot use both, the line_items array is stronger for backward compat.", + "description": "Items for the document, including divider and sub_total items. You MUST set the type field(CamelCasedItem class name) on each item on creation.", "type":"array", - "default": "any", "minItems": 0, - "items": [{ "$ref": "./line_item.json#properties"}, - { "$ref": "./divider_item.json#properties"}, - { "$ref": "./sub_total_item.json#properties"}] + "items": { + "type" : "object", + "anyOf" : [ + { + "title": "line_item", + "$ref": "./line_item.json#" + }, + { + "title": "divider_item", + "$ref": "./divider_item.json#" + }, + { + "title": "sub_total_item", + "$ref": "./sub_total_item.json#" + } + ] + } }, "created_at":{ "description": "Date the object was created in SK. Never changes afterwards.", "format":"date-time", - "readonly":true, + "readOnly":true, "type":"string" }, "updated_at":{ "description": "Date the object was edited in SK.", "format":"date-time", - "readonly":true, + "readOnly":true, "type":"string" }, "lock_version":{ - "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version. ", + "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version.", + "readOnly":true, "type":"integer" }, "gross_total":{ "description": "Gross total of all line items, 2 decimals places", - "readonly":true, + "readOnly":true, "type":"number" }, "tax_total":{ "description": "Tax total, 2 decimals places", - "readonly":true, + "readOnly":true, "type":"number" }, "net_total":{ "description": "Net total, 2 decimals places", - "readonly":true, + "readOnly":true, "type":"number" }, "net_total_base":{ "description": "Net total, 6 decimal places incl. discount", - "readonly":true, + "readOnly":true, "type":"number" }, "cost_total":{ "description": "Cost total of all line items, 2 decimals places in document currency.", - "readonly":true, + "readOnly":true, "type":"number" }, "gross_margin_total":{ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.", - "readonly":true, + "readOnly":true, "type":"number" }, "gross_margin_pct":{ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100", - "readonly":true, + "readOnly":true, "type":"number" }, "pdf_template_id":{ "description": "The PDF template used for printing the invoice when auto sending. Required when auto_send'ing is enabled.", "type":"string", @@ -209,10 +211,16 @@ "auto_send":{ "description": "Enable automatic sending of new invoices created from the recurring. Opens the invoice, creates a PDF and sends an email to the contact. GOTCHA's: check PDF-, Email-Template, SMTP Settings and of course the contacts email address! Since new recurrings which start today directly create new invoices, they are also SEND if auto_send is true!! If something fails, we'll send an error-email to the user who created the recurring. For success infos you can add yourself to the BCC of the email template or", "default": null, "type": "string", "enum":["email"] + }, + "tax_exemption_id":{ + "description": "ID of a tax exemption. When set all item taxes are omitted.", + "type":"string", + "maxLength": 22, + "minLength":22 } }, "links":[ { "rel": "self", "href": "recurrings/{id}" @@ -267,15 +275,10 @@ "filter[languages]":{ "title" : "Languages", "description": "A list of language codes, comma separated", "type" : "string" }, - "filter[client_ids]":{ - "title" : "Clients", - "description": "DEPRECATED use contact_ids", - "type" : "string" - }, "filter[contact_ids]":{ "title" : "Contacts", "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.", "type" : "string" }, @@ -329,12 +332,12 @@ }, { "rel": "invoices", "href": "invoices?filter[recurring_ids]={id}" }, { "rel": "attachments", - "href": "recurrings/{id}/attachments" + "href": "attachments?filter[related_object_ids]={id}" }, { "rel": "comments", - "href": "recurrings/{id}/comments" + "href": "comments?filter[related_object_ids]={id}" } ] }