{ "type":"object", "title": "recurring", "description": "An recurring is used as an template for new invoices.", "properties":{ "id":{ "description": "UUID assigned by SK", "identity":true, "readonly":true, "type":"string" }, "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 }, "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.", "format":"date", "type":"string", "required":true }, "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.", "format":"date", "type":"string", "required":true }, "frequency":{ "description": "Recurring frequency", "enum":['yearly', 'monthly', 'weekly', 'quarterly', 'biweekly', 'sixmonthly'], "type":"string", "required":true }, "payment_method":{ "description": "How the invoce is beeing payed. Used in new payments.", "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque"], "type":"string" }, "title":{ "description": "The headline of a document. Use SK placeholders to prevent exessive typing e.g. 'Your recurring [number]'", "type":"string" }, "notes_before":{ "description": "Notes shown before the line items. Normaly contains salutation and other introductional information. SK placeholders can be used.", "type":"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" }, "tag_list": { "description": "Space separated list of tags.", "type":"string" }, "precision":{ "description": "Decimal places for displayed(printed) money values. gross_total and net_total will always be displayed rounded to a precision of 2. When greater 2 use net_total_base(also in line_item) to show the net val with the set precision(3,4).", "type":"number", "enum": [2,3,4], "default":2 }, "client":{ "description": "The client for the document. New documents cannot create a client, use client_id field to set it.", "readonly":true, "type":"object", "properties":{"$ref":"./client.json#properties"} }, "client_id":{ "description": "The clients uuid, must be set for a new document. New recurrings take the clients address field, due days and cash discount if those fields are not set.", "type":"string", "required":true }, "team_id":{ "description": "A team uuid. If set only the team and its parent teams can see the record.", "type":"string" }, "line_items":{ "description": "Line items for the document", "type":"array", "properties":{"$ref":"./address.json#properties"} }, "created_at":{ "description": "Date the object was created in SK. Never changes afterwards.", "format":"date-time", "readonly":true, "type":"string" }, "updated_at":{ "description": "Date the object was edited in SK.", "format":"date-time", "readonly":true, "type":"string" }, "lock_version":{ "description": "Auto-incremented to prevent concurrent updateing. First save wins and increments version. ", "optional":true, "type":"integer" }, "gross_total":{ "description": "Gross total of all line items, 2 decimals places", "readonly":true, "type":"number" }, "tax_total":{ "description": "Tax total, 2 decimals places", "readonly":true, "type":"number" }, "net_total":{ "description": "Net total, 2 decimals places", "readonly":true, "type":"number" }, "net_total_base":{ "description": "Net total, decimals places as set in precision, default 2", "readonly":true, "type":"number" }, "net_total_base_raw":{ "description": "Net total, 6 decimal places. Summmed items net_total_base_raw (incl discount)", "readonly":true, "type":"number" } }, "links":[ { "rel": "self", "href": "recurrings/{id}" }, { "rel": "instances", "href": "recurrings", "properties" : { "page":{ "title" : "Page", "description": "In paginated results set the page to look for", "type":"number" }, "filter[q]":{ "title" : "Search", "description": "Search in title, number, addressfield", "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":['title', 'number', 'created_at', 'updated_at', 'client_id', 'price_total'], "type": 'string' }, "sort":{ "title" : "Sort", "enum":["ASC","DESC"], "description": "Sort the results in ASC or DESC" } } }, { "rel": "destroy", "href": "recurrings/{id}", "method": "DELETE" }, { "rel": "update", "href": "recurrings/{id}", "method": "PUT" }, { "rel": "create", "href": "recurrings", "method": "POST", "properties" : { "source" : { "title" : "Source document id", "description": "Copies the source document(excl. number,date) and returns a new draft document." }, "cancel" : { "title" : "Cancel an recurring", "description": "Cancelling a document negates its line item values. A source id must be set.", "dependencies": ['source'] } } }, { "rel": "attachments", "href": "recurrings/{id}/attachments" }, { "rel": "comments", "href": "recurrings/{id}/comments" } ] }