{ "type":"object", "title": "credit_note", "description": "A credit note", "properties":{ "id":{ "description": "UUID assigned by SK", "identity":true, "readonly":true, "type":"string" }, "number":{ "description": "Unique number assigned by SK credit note number schema. Auto-assigned when document is opened. Required unless doc status is draft.", "type":"string" }, "address_field":{ "description": "Address field with the receiver. Shown in envelope window.", "type":"string" }, "date":{ "description": "Date the credit note is issued. Automatically set when document is opened. Required unless doc status is draft.", "format":"date", "type":"string" }, "due_days":{ "description": "Used to calculate the due date of the credit note. Useless if date and due date are present.", "type":"integer" }, "due_date":{ "description": "Auto-calculated from date + due days if empty and the document is opened.", "format":"date", "type":"string" }, "status":{ "description": "Defaults to draft for new documents, unless otherwise stated. For new documents with status 'open', following fields are set if empty: number(next in number schema), date(today), due date(due_days must be given). Only draft invoices can be deleted.", "default":"draft", "enum":["draft","open","closed"], "type":"string" }, "payment_method":{ "description": "How the document 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 credit note [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 seperated list of tags.", "type":"string" }, "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 documents take the clients address field, due days and cash discount if those fields are not set.", "type":"string" }, "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 by SK to prevent concurrent updateing. First save wins.", "type":"integer" }, "price_total":{ "description": "Deprecated use net_total_base_raw", "readonly":true, "type":"number" }, "price_tax":{ "description": "Deprecated: use tax_total", "readonly":true, "type":"number" }, "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" } } }