{
    "swagger": "2.0",
    "info": {
        "title": "Official smallinvoice API",
        "description": "<div id=\"developer-content\">\r\n\r\n\t<p>\r\n\tWith the smallinvoice API you can create modify and track everything going on in your account.\r\n\t<br><br>\r\n\t</p>\r\n\r\n\t<h3>Access</h3>\r\n\t<p>\r\n\tYou can access our API with the following Base-URL:\r\n\t</p>\r\n\r\n\t<div><div id=\"highlighter_495508\" class=\"syntaxhighlighter nogutter code js\"><div class=\"toolbar\"><span><a href=\"#\" class=\"toolbar_item command_help help\">?</a></span></div><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"code\"><div class=\"container\"><div class=\"line number1 index0 alt2\"><code class=\"js plain\">GET https:</code><code class=\"js comments\">//api.smallinvoice.com/</code></div></div></td></tr></tbody></table></div></div>\r\n\t<p>Every possible API-call is built up with an <b>endpoint and action</b>.\r\n\tFor example getting a list of invoices targets the endpoint invoice and the action is list.\r\n\t</p>\r\n\r\n\t<div><div id=\"highlighter_523475\" class=\"syntaxhighlighter nogutter code js\"><div class=\"toolbar\"><span><a href=\"#\" class=\"toolbar_item command_help help\">?</a></span></div><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"code\"><div class=\"container\"><div class=\"line number1 index0 alt2\"><code class=\"js plain\">GET https:</code><code class=\"js comments\">//api.smallinvoice.com/invoice/list/</code></div></div></td></tr></tbody></table></div></div>\r\n\t<h3>Authentication</h3>\r\n\t<p>\r\n\tEvery request has to contain a parameter <b>token</b> in the request URL.\r\n\t<br>\r\n\t</p>\r\n\r\n\t<div><div id=\"highlighter_283281\" class=\"syntaxhighlighter nogutter code js\"><div class=\"toolbar\"><span><a href=\"#\" class=\"toolbar_item command_help help\">?</a></span></div><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"code\"><div class=\"container\"><div class=\"line number1 index0 alt2\"><code class=\"js plain\">GET https:</code><code class=\"js comments\">//api.smallinvoice.com/invoice/list/token/60abd.../</code></div></div></td></tr></tbody></table></div></div>\r\n\t<p>\r\n\tThis token can be retreived when you're logged into your account under <b>Configuration-&gt;Users-&gt;(button)My API Token</b> and can be regenerated at any time. When you regenerate your token, the current one is disabled.\r\n\t</p>\r\n\t<br>\r\n\t<h3>URL Parameters</h3>\r\n\t<p>\r\n\tNearly every requests can contain URL parameters that for example sorts lists or defines what objects you are manipulating.\r\n\t<br>These are passed in a key/value pair and do not require a specific order.\r\n\t</p>\r\n\r\n\t<div><div id=\"highlighter_703\" class=\"syntaxhighlighter nogutter code js\"><div class=\"toolbar\"><span><a href=\"#\" class=\"toolbar_item command_help help\">?</a></span></div><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"code\"><div class=\"container\"><div class=\"line number1 index0 alt2\"><code class=\"js plain\">GET https:</code><code class=\"js comments\">//api.smallinvoice.com/invoice/list/key1/value1/key2/value2/token/60abd.../</code></div></div></td></tr></tbody></table></div></div>\r\n\t<h3>Body Parameters</h3>\r\n\t<p>\r\n\tWhen performing a POST-Request, it will be sometimes necessary to provide body parameters in form of a JSON-Object passed in the <b>POST-Variable data</b>.\r\n\t<br><br>Example: Passing the Body Parameters <b>amount and value</b> both set to 1 would look the following:\r\n\r\n\r\n\t</p><div><div id=\"highlighter_619702\" class=\"syntaxhighlighter nogutter code js\"><div class=\"toolbar\"><span><a href=\"#\" class=\"toolbar_item command_help help\">?</a></span></div><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td class=\"code\"><div class=\"container\"><div class=\"line number1 index0 alt2\"><code class=\"js plain\">data={</code><code class=\"js string\">\"amount\"</code><code class=\"js plain\">:1,</code><code class=\"js string\">\"value\"</code><code class=\"js plain\">:1}</code></div></div></td></tr></tbody></table></div></div>\r\n\t<p></p></div>",
        "termsOfService": "",
        "contact": {
            "email": "contact@mysite.com"
        },
        "license": {
            "name": "Private License",
            "url": "URL to the license"
        },
        "version": "1.0.0"
    },
    "host": "local-api.smallinvoice.com",
    "basePath": "/",
    "schemes": [
        "http"
    ],
    "paths": {
        "/invoice/list/": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "You can list your available invoices with the following URL: GET https://api.smallinvoice.com/invoice/list/",
                "description": "You can list your available invoices with the following URL: GET https://api.smallinvoice.com/invoice/list/",
                "operationId": "listAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "$ref": "#/parameters/limit"
                    },
                    {
                        "$ref": "#/parameters/page"
                    },
                    {
                        "$ref": "#/parameters/sort"
                    },
                    {
                        "$ref": "#/parameters/sorttype"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of objects",
                        "schema": {
                            "$ref": "#/definitions/ResponseListInvoices"
                        }
                    }
                }
            }
        },
        "/invoice/get/": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "summary": "You can get your invoice with the following URL: GET https://api.smallinvoice.com/invoice/get/",
                "description": "You can get your invoice with the following URL: GET https://api.smallinvoice.com/invoice/get/",
                "operationId": "getAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/ResponseInvoiceGet"
                        }
                    }
                }
            }
        },
        "/invoice/pdf/": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can get your invoice as pdf with the following URL: GET https://api.smallinvoice.com/invoice/pdf/",
                "operationId": "pdfAction",
                "produces": [
                    "application/pdf"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The PDF in raw format",
                        "schema": {
                            "description": "The PDF in raw format",
                            "type": "file"
                        }
                    }
                }
            }
        },
        "/invoice/preview/": {
            "get": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can get a invoice preview in PNG form for each page of a document with the following URL: GET https://api.smallinvoice.com/invoice/preview/",
                "operationId": "previewAction",
                "produces": [
                    "application/png"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "description": "The page you want to retrieve",
                        "required": false,
                        "type": "integer",
                        "default": 1
                    },
                    {
                        "name": "size",
                        "in": "query",
                        "description": "The size in pixels",
                        "required": false,
                        "type": "integer",
                        "default": "595",
                        "enum": [
                            240,
                            595,
                            600,
                            972,
                            1240
                        ]
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The PDF in raw format",
                        "schema": {
                            "description": "The image in raw format",
                            "type": "file"
                        }
                    }
                }
            }
        },
        "/invoice/add/": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can add a new invoice with the following URL: POST https://api.smallinvoice.com/invoice/add\n\t\t<h3>Allowed statuses:</h3>\n\t\t<pre>\n\t\t{\n\t\t1:\tSent / Open\n\t\t2:\tPaid\n\t\t3:\t1st Reminder\n\t\t4:\t2nd Reminder\n\t\t5:\t3rd Reminder\n\t\t6:\tCancelled\n\t\t7:\tDraft\n\t\t}\n\t\t</pre>\n\n\t\t",
                "operationId": "addAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "Invoice",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/AddInvoice"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/ResponseInvoiceAdd"
                        }
                    }
                }
            }
        },
        "/invoice/edit/": {
            "put": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can edit an invoice with the following URL: POST https://api.smallinvoice.com/invoice/edit",
                "operationId": "editAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "Invoice",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/EditInvoice"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },
        "/invoice/delete/": {
            "delete": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can delete an invoice with the following URL: POST https://api.smallinvoice.com/invoice/delete/",
                "operationId": "deleteAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },
        "/invoice/email/": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can email your invoice with the following URL: POST https://api.smallinvoice.com/invoice/email",
                "operationId": "emailAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "Email",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Email"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },
        "/invoice/post/": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can send your invoice via postmail with the following URL: POST https://api.smallinvoice.com/invoice/post",
                "operationId": "postAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "Email",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Postmail"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },
        "/invoice/payment/": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can add a payment to your invoice with the following URL: POST https://api.smallinvoice.com/invoice/payment",
                "operationId": "paymentAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "Payment",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Payment"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        },
        "/invoice/status/": {
            "post": {
                "tags": [
                    "Invoice"
                ],
                "description": "You can change status of your invoice with the following URL: POST https://api.smallinvoice.com/invoice/status/",
                "operationId": "statusAction",
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "description": "The Id of the invoice",
                        "$ref": "#/parameters/id"
                    },
                    {
                        "name": "Email",
                        "in": "body",
                        "description": "",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/Status"
                        },
                        "default": 7
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "schema": {
                            "$ref": "#/definitions/Response"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "Response": {
            "required": [
                "error"
            ],
            "properties": {
                "error": {
                    "description": "Is true if an error occured",
                    "type": "bool",
                    "default": false
                },
                "errorcode": {
                    "description": "Code of the error. Only returned if error is true.",
                    "type": "integer"
                },
                "errormessage": {
                    "description": "Informational message about the error. Only returned if error is true.",
                    "type": "string",
                    "default": ""
                }
            }
        },
        "ResponseList": {
            "allOf": [
                {
                    "$ref": "#/definitions/Response"
                },
                {
                    "properties": {
                        "page": {
                            "description": "Current page that was passed in on the request",
                            "type": "integer",
                            "default": 1
                        },
                        "pages": {
                            "description": "Total number of pages available",
                            "type": "integer",
                            "default": 1
                        },
                        "count": {
                            "description": "Total number of objects available",
                            "type": "integer",
                            "default": 1
                        }
                    }
                }
            ]
        },
        "Status": {
            "properties": {
                "status": {
                    "description": "\r\n\t1\tSent / Open\r\n\t2\tPaid\r\n\t3\t1st Reminder\r\n\t4\t2nd Reminder\r\n\t5\t3rd Reminder\r\n\t6\tCancelled\r\n\t7\tDraft\r\n\t99   Deleted",
                    "type": "integer"
                }
            }
        },
        "ResponseListInvoices": {
            "allOf": [
                {
                    "$ref": "#/definitions/ResponseList"
                },
                {
                    "properties": {
                        "items": {
                            "description": "Collection of invoice Objects",
                            "type": "array",
                            "items": {
                                "type": "array",
                                "$ref": "#/definitions/ListInvoice"
                            }
                        }
                    }
                }
            ]
        },
        "ResponseInvoiceGet": {
            "allOf": [
                {
                    "$ref": "#/definitions/Response"
                },
                {
                    "properties": {
                        "item": {
                            "description": "Object of invoice",
                            "$ref": "#/definitions/GetInvoice"
                        }
                    }
                }
            ]
        },
        "ResponseInvoiceAdd": {
            "allOf": [
                {
                    "$ref": "#/definitions/Response"
                },
                {
                    "properties": {
                        "id": {
                            "description": "Id of invoice",
                            "type": "integer"
                        }
                    }
                }
            ]
        },
        "Recipient": {
            "required": [
                "email",
                "name"
            ],
            "properties": {
                "cc": {
                    "type": "boolean",
                    "default": false
                },
                "email": {
                    "type": "string",
                    "default": "email@domain.com"
                },
                "name": {
                    "description": "Client Name",
                    "type": "string",
                    "default": "Client Name"
                }
            }
        },
        "Email": {
            "required": [
                "subject",
                "body",
                "recipients"
            ],
            "properties": {
                "subject": {
                    "description": "Subject of email",
                    "type": "string"
                },
                "body": {
                    "description": "Content of the email",
                    "type": "string"
                },
                "status": {
                    "description": "The status the document should be sent in",
                    "type": "integer"
                },
                "afterstatus": {
                    "description": "The status the document should take after sending",
                    "type": "integer"
                },
                "recipients": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/Recipient"
                    }
                }
            }
        },
        "Postmail": {
            "required": [
                "speed"
            ],
            "properties": {
                "speed": {
                    "description": "1 = Priority / 2 = Economy",
                    "type": "integer"
                },
                "color": {
                    "description": "0 = B/W / 1 = Color",
                    "type": "integer",
                    "default": 0
                },
                "sendstatus": {
                    "description": "The status the document should be sent in",
                    "type": "integer"
                },
                "afterstatus": {
                    "description": "The status the document should take after sending",
                    "type": "integer"
                }
            }
        },
        "Payment": {
            "required": [
                "amount"
            ],
            "properties": {
                "amount": {
                    "type": "number",
                    "format": "float"
                },
                "date": {
                    "description": "Example: 2012-04-02",
                    "type": "string",
                    "format": "date"
                },
                "type": {
                    "description": "1 = payment, 2 = cash discount",
                    "type": "integer",
                    "default": 1
                },
                "keep_status": {
                    "description": "If invoice should automatically adapt status",
                    "type": "integer",
                    "default": 0
                }
            }
        },
        "AddFreetext": {
            "required": [
                ""
            ],
            "properties": {
                "text": {
                    "type": "string"
                },
                "x": {
                    "type": "integer"
                },
                "y": {
                    "type": "integer"
                },
                "font_size": {
                    "description": "example: 9",
                    "type": "integer",
                    "default": "9"
                },
                "page": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                }
            },
            "xml": {
                "name": "AddFreetext"
            }
        },
        "AddInvoice": {
            "required": [
                "client_id",
                "client_address_id",
                "currency",
                "date",
                "due",
                "status",
                "positions"
            ],
            "properties": {
                "number": {
                    "description": "Your invoice number - example: Next higher number",
                    "type": "string",
                    "default": "Next higher number"
                },
                "client_id": {
                    "description": "Client's id",
                    "type": "integer"
                },
                "client_address_id": {
                    "description": "Client's address id",
                    "type": "integer"
                },
                "client_contact_id": {
                    "description": "Client's contact id",
                    "type": "integer"
                },
                "currency": {
                    "description": "Three-letter currency code",
                    "type": "integer"
                },
                "title": {
                    "description": "Title of the invoice",
                    "type": "string"
                },
                "period": {
                    "type": "string"
                },
                "date": {
                    "description": "Date of invoice in YYYY-MM-DD format",
                    "type": "string",
                    "format": "date"
                },
                "due": {
                    "description": "Latest payment date in YYYY-MM-DD format",
                    "type": "string",
                    "format": "date"
                },
                "account_id": {
                    "description": "Id for Account Object",
                    "type": "integer"
                },
                "esr": {
                    "description": "If invoice has ESR",
                    "type": "integer"
                },
                "esr_id": {
                    "description": "If invoice has ESR",
                    "type": "integer"
                },
                "esr_number": {
                    "description": "ESR number - example: Next higher esr-number",
                    "type": "integer",
                    "default": "Next higher esr-number"
                },
                "esr_referencenumber": {
                    "description": "ESR number",
                    "type": "string"
                },
                "esr_singlepage": {
                    "description": "ESR number",
                    "type": "integer"
                },
                "esr_position": {
                    "description": "Positioning of ESR. 0 = additional page, 1 = first page, 2 = last page",
                    "type": "integer"
                },
                "lsvplus": {
                    "description": "If LSV+ is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "dd": {
                    "description": "If DebitDirect is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "discount": {
                    "description": "Discount amount",
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "0 - Percent, 1\t- Value",
                    "type": "integer"
                },
                "conditions": {
                    "description": "Text printed below positions - example: ipsum",
                    "type": "string",
                    "default": "ipsum"
                },
                "introduction": {
                    "description": "Introduction text printed above positions - example: lorem",
                    "type": "string",
                    "default": "lorem"
                },
                "language": {
                    "description": "Two-letter language code - example: de",
                    "type": "string",
                    "default": "de"
                },
                "paypal": {
                    "description": "PayPal account payment",
                    "type": "integer"
                },
                "paypal_url": {
                    "description": "PayPal pay URL - example: http://bit.ly/x4geSA",
                    "type": "string",
                    "default": "http://bit.ly/x4geSA"
                },
                "vat_included": {
                    "description": "If VAT is included in positions' prices - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "status": {
                    "description": "See Status description - example: 7",
                    "type": "integer",
                    "default": "7"
                },
                "freetexts": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/AddFreetext"
                    }
                },
                "positions": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/AddPosition"
                    }
                }
            },
            "xml": {
                "name": "AddInvoice"
            }
        },
        "AddPosition": {
            "required": [
                ""
            ],
            "properties": {
                "type": {
                    "type": "integer"
                },
                "number": {
                    "description": "Catalog number - example: next higher number",
                    "type": "number",
                    "format": "float",
                    "default": "next higher number"
                },
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "cost": {
                    "description": "Single item cost",
                    "type": "number",
                    "format": "float"
                },
                "unit": {
                    "description": "Type of item unit, like km or kg",
                    "type": "integer"
                },
                "amount": {
                    "description": "Number of items",
                    "type": "number",
                    "format": "float"
                },
                "vat": {
                    "type": "integer"
                },
                "discount": {
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "If the discount is in % (0) or amount (1)",
                    "type": "integer"
                }
            },
            "xml": {
                "name": "AddPosition"
            }
        },
        "AddProcess": {
            "required": [
                ""
            ],
            "properties": {
                "active": {
                    "type": "integer"
                },
                "days": {
                    "type": "integer"
                },
                "action": {
                    "type": "integer"
                },
                "options": {
                    "type": "string"
                }
            },
            "xml": {
                "name": "AddProcess"
            }
        },
        "AddText": {
            "required": [
                ""
            ],
            "properties": {
                "header": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "introduction": {
                    "type": "string"
                },
                "conditions": {
                    "type": "string"
                }
            },
            "xml": {
                "name": "AddText"
            }
        },
        "EditFreetext": {
            "required": [
                ""
            ],
            "properties": {
                "text": {
                    "type": "string"
                },
                "x": {
                    "type": "integer"
                },
                "y": {
                    "type": "integer"
                },
                "font_size": {
                    "description": "example: 9",
                    "type": "integer",
                    "default": "9"
                },
                "page": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                }
            },
            "xml": {
                "name": "EditFreetext"
            }
        },
        "EditInvoice": {
            "required": [
                ""
            ],
            "properties": {
                "number": {
                    "description": "Your invoice number",
                    "type": "string"
                },
                "client_id": {
                    "description": "Client's id",
                    "type": "integer"
                },
                "client_address_id": {
                    "description": "Client's address id - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "client_contact_id": {
                    "description": "Client's contact id",
                    "type": "integer"
                },
                "currency": {
                    "description": "Three-letter currency code",
                    "type": "integer"
                },
                "title": {
                    "description": "Title of the invoice",
                    "type": "string"
                },
                "period": {
                    "type": "string"
                },
                "date": {
                    "description": "Date of invoice in YYYY-MM-DD format",
                    "type": "string",
                    "format": "date"
                },
                "due": {
                    "description": "Latest payment date in YYYY-MM-DD format",
                    "type": "string",
                    "format": "date"
                },
                "account_id": {
                    "description": "Id for Account Object",
                    "type": "integer"
                },
                "esr": {
                    "description": "If invoice has ESR",
                    "type": "integer"
                },
                "esr_id": {
                    "description": "If invoice has ESR",
                    "type": "integer"
                },
                "esr_number": {
                    "description": "ESR number",
                    "type": "integer"
                },
                "esr_referencenumber": {
                    "description": "ESR number",
                    "type": "string"
                },
                "esr_singlepage": {
                    "description": "ESR number",
                    "type": "integer"
                },
                "esr_position": {
                    "description": "Positioning of ESR. 0 = additional page, 1 = first page, 2 = last page",
                    "type": "integer"
                },
                "lsvplus": {
                    "description": "If LSV+ is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "dd": {
                    "description": "If DebitDirect is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "discount": {
                    "description": "Discount amount",
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "0 - Percent, 1\t- Value",
                    "type": "integer"
                },
                "conditions": {
                    "description": "Text printed below positions - example: ipsum",
                    "type": "string",
                    "default": "ipsum"
                },
                "introduction": {
                    "description": "Introduction text printed above positions - example: lorem",
                    "type": "string",
                    "default": "lorem"
                },
                "language": {
                    "description": "Two-letter language code - example: de",
                    "type": "string",
                    "default": "de"
                },
                "paypal": {
                    "description": "PayPal account payment",
                    "type": "integer"
                },
                "paypal_url": {
                    "description": "PayPal pay URL - example: http://bit.ly/x4geSA",
                    "type": "string",
                    "default": "http://bit.ly/x4geSA"
                },
                "vat_included": {
                    "description": "If VAT is included in positions' prices - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "status": {
                    "description": "See Status description - example: 7",
                    "type": "integer",
                    "default": "7"
                },
                "freetexts": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/EditFreetext"
                    }
                },
                "positions": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/EditPosition"
                    }
                }
            },
            "xml": {
                "name": "EditInvoice"
            }
        },
        "EditPosition": {
            "required": [
                ""
            ],
            "properties": {
                "type": {
                    "type": "integer"
                },
                "number": {
                    "description": "Catalog number",
                    "type": "number",
                    "format": "float"
                },
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "cost": {
                    "description": "Single item cost",
                    "type": "number",
                    "format": "float"
                },
                "unit": {
                    "description": "Type of item unit, like km or kg",
                    "type": "integer"
                },
                "amount": {
                    "description": "Number of items",
                    "type": "number",
                    "format": "float"
                },
                "vat": {
                    "type": "integer"
                },
                "discount": {
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "If the discount is in % (0) or amount (1)",
                    "type": "integer"
                }
            },
            "xml": {
                "name": "EditPosition"
            }
        },
        "EditProcess": {
            "required": [
                ""
            ],
            "properties": {
                "active": {
                    "type": "integer"
                },
                "days": {
                    "type": "integer"
                },
                "action": {
                    "type": "integer"
                },
                "options": {
                    "type": "string"
                }
            },
            "xml": {
                "name": "EditProcess"
            }
        },
        "EditText": {
            "required": [
                ""
            ],
            "properties": {
                "header": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "introduction": {
                    "type": "string"
                },
                "conditions": {
                    "type": "string"
                }
            },
            "xml": {
                "name": "EditText"
            }
        },
        "GetFreetext": {
            "required": [
                "x",
                "font_size",
                "page"
            ],
            "properties": {
                "text": {
                    "description": "example: lorem ipsum",
                    "type": "string",
                    "default": "lorem ipsum"
                },
                "x": {
                    "description": "example: 100",
                    "type": "integer",
                    "default": "100"
                },
                "y": {
                    "description": "example: 100",
                    "type": "integer",
                    "default": "100"
                },
                "font_size": {
                    "description": "example: 9",
                    "type": "integer",
                    "default": "9"
                },
                "page": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                }
            },
            "xml": {
                "name": "GetFreetext"
            }
        },
        "GetInvoice": {
            "required": [
                "id",
                "number",
                "client_id",
                "client_name",
                "client_address_id",
                "client_contact_id",
                "title",
                "period",
                "date",
                "due",
                "account_id",
                "esr",
                "esr_id",
                "esr_number",
                "esr_referencenumber",
                "discount",
                "discount_type",
                "paypal_url",
                "vat_included",
                "status",
                "positions"
            ],
            "properties": {
                "id": {
                    "description": "Invoice id - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "number": {
                    "description": "Your invoice number - example: 4633",
                    "type": "string",
                    "default": "4633"
                },
                "client_id": {
                    "description": "Client's id - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "client_name": {
                    "description": "Name of client - example: Jane Doe",
                    "type": "string",
                    "default": "Jane Doe"
                },
                "client_address_id": {
                    "description": "Client's address id - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "client_contact_id": {
                    "description": "Client's contact id",
                    "type": "integer"
                },
                "currency": {
                    "description": "Three-letter currency code - example: EUR",
                    "type": "integer",
                    "default": "EUR"
                },
                "title": {
                    "description": "Title of the invoice - example: My new invoice",
                    "type": "string",
                    "default": "My new invoice"
                },
                "period": {
                    "description": "example: Period of service",
                    "type": "string",
                    "default": "Period of service"
                },
                "date": {
                    "description": "Date of invoice in YYYY-MM-DD format - example: 2012-03-25",
                    "type": "string",
                    "format": "date",
                    "default": "2012-03-25"
                },
                "due": {
                    "description": "Latest payment date in YYYY-MM-DD format - example: 2012-04-22",
                    "type": "string",
                    "format": "date",
                    "default": "2012-04-22"
                },
                "account_id": {
                    "description": "Id for Account Object",
                    "type": "integer"
                },
                "esr": {
                    "description": "If invoice has ESR - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "esr_id": {
                    "description": "If invoice has ESR - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "esr_number": {
                    "description": "ESR number - example: 243",
                    "type": "integer",
                    "default": "243"
                },
                "esr_referencenumber": {
                    "description": "ESR number - example: 000000000000000000000002823",
                    "type": "string",
                    "default": "000000000000000000000002823"
                },
                "esr_singlepage": {
                    "description": "ESR number",
                    "type": "integer"
                },
                "esr_position": {
                    "description": "Positioning of ESR. 0 = additional page, 1 = first page, 2 = last page",
                    "type": "integer"
                },
                "lsvplus": {
                    "description": "If LSV+ is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "dd": {
                    "description": "If DebitDirect is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "discount": {
                    "description": "Discount amount - example: 5",
                    "type": "number",
                    "format": "float",
                    "default": "5"
                },
                "discount_type": {
                    "description": "0 - Percent, 1\t- Value - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "conditions": {
                    "description": "Text printed below positions - example: ipsum",
                    "type": "string",
                    "default": "ipsum"
                },
                "introduction": {
                    "description": "Introduction text printed above positions - example: lorem",
                    "type": "string",
                    "default": "lorem"
                },
                "language": {
                    "description": "Two-letter language code - example: de",
                    "type": "string",
                    "default": "de"
                },
                "paypal": {
                    "description": "PayPal account payment",
                    "type": "integer"
                },
                "paypal_url": {
                    "description": "PayPal pay URL - example: http://bit.ly/x4geSA",
                    "type": "string",
                    "default": "http://bit.ly/x4geSA"
                },
                "vat_included": {
                    "description": "If VAT is included in positions' prices - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "totalamount": {
                    "description": "Total sum of all positions - example: 140.15",
                    "type": "number",
                    "format": "float",
                    "default": "140.15"
                },
                "status": {
                    "description": "See Status description - example: 7",
                    "type": "integer",
                    "default": "7"
                },
                "pages": {
                    "description": "Number of pages - example: 2",
                    "type": "integer",
                    "default": "2"
                },
                "layout_options": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "layout_id": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "signature_id": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "texts": {
                    "type": "object",
                    "$ref": "#/definitions/GetTextObject"
                },
                "freetexts": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/GetFreetext"
                    }
                },
                "positions": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/GetPosition"
                    }
                }
            },
            "xml": {
                "name": "GetInvoice"
            }
        },
        "GetTextObject": {
            "properties": {
                "12": {
                    "description": "12 because its referenncing to workflow id, Graem will figure what to write in here",
                    "$ref": "#/definitions/GetText"
                },
                "default": {
                    "description": "default text lorem ipsum something something",
                    "$ref": "#/definitions/GetText"
                }
            }
        },
        "GetPosition": {
            "required": [
                "number"
            ],
            "properties": {
                "type": {
                    "type": "integer"
                },
                "number": {
                    "description": "Catalog number",
                    "type": "number",
                    "format": "float"
                },
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "cost": {
                    "description": "Single item cost",
                    "type": "number",
                    "format": "float"
                },
                "unit": {
                    "description": "Type of item unit, like km or kg",
                    "type": "integer"
                },
                "amount": {
                    "description": "Number of items",
                    "type": "number",
                    "format": "float"
                },
                "vat": {
                    "type": "integer"
                },
                "discount": {
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "If the discount is in % (0) or amount (1)",
                    "type": "integer"
                }
            },
            "xml": {
                "name": "GetPosition"
            }
        },
        "GetProcess": {
            "required": [
                "active",
                "action",
                "options"
            ],
            "properties": {
                "active": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "days": {
                    "type": "integer"
                },
                "action": {
                    "description": "example: 2",
                    "type": "integer",
                    "default": "2"
                },
                "options": {
                    "description": "example: {client_email: lorem ipsum}",
                    "type": "string",
                    "default": "{client_email: lorem ipsum}"
                }
            },
            "xml": {
                "name": "GetProcess"
            }
        },
        "GetText": {
            "required": [
                "header"
            ],
            "properties": {
                "header": {
                    "description": "example: Lorem ipsum",
                    "type": "string",
                    "default": "Lorem ipsum"
                },
                "title": {
                    "description": "example: Rechnungs-Nr. {RECHNUNGSNR} / Kunden-Nr. {KUNDENNR}",
                    "type": "string",
                    "default": "Rechnungs-Nr. {RECHNUNGSNR} / Kunden-Nr. {KUNDENNR}"
                },
                "introduction": {
                    "description": "example: Introduction {PLACEHOLDER}",
                    "type": "string",
                    "default": "Introduction {PLACEHOLDER}"
                },
                "conditions": {
                    "description": "example: Conditions {PLACEHOLDER}",
                    "type": "string",
                    "default": "Conditions {PLACEHOLDER}"
                }
            },
            "xml": {
                "name": "GetText"
            }
        },
        "ListFreetext": {
            "required": [
                "x",
                "font_size",
                "page"
            ],
            "properties": {
                "text": {
                    "description": "example: lorem ipsum",
                    "type": "string",
                    "default": "lorem ipsum"
                },
                "x": {
                    "description": "example: 100",
                    "type": "integer",
                    "default": "100"
                },
                "y": {
                    "description": "example: 100",
                    "type": "integer",
                    "default": "100"
                },
                "font_size": {
                    "description": "example: 9",
                    "type": "integer",
                    "default": "9"
                },
                "page": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                }
            },
            "xml": {
                "name": "ListFreetext"
            }
        },
        "ListInvoice": {
            "required": [
                "id",
                "number",
                "client_id",
                "client_name",
                "client_address_id",
                "client_contact_id",
                "period",
                "date",
                "due",
                "account_id",
                "esr",
                "esr_id",
                "esr_number",
                "esr_referencenumber",
                "discount",
                "discount_type",
                "paypal_url",
                "vat_included",
                "status",
                "positions"
            ],
            "properties": {
                "id": {
                    "description": "Invoice id - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "number": {
                    "description": "Your invoice number - example: 4633",
                    "type": "string",
                    "default": "4633"
                },
                "client_id": {
                    "description": "Client's id - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "client_name": {
                    "description": "Name of client - example: Jane Doe",
                    "type": "string",
                    "default": "Jane Doe"
                },
                "client_address_id": {
                    "description": "Client's address id - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "client_contact_id": {
                    "description": "Client's contact id",
                    "type": "integer"
                },
                "currency": {
                    "description": "Three-letter currency code - example: EUR",
                    "type": "integer",
                    "default": "EUR"
                },
                "period": {
                    "description": "example: Period of service",
                    "type": "string",
                    "default": "Period of service"
                },
                "date": {
                    "description": "Date of invoice in YYYY-MM-DD format - example: 2012-03-25",
                    "type": "string",
                    "format": "date",
                    "default": "2012-03-25"
                },
                "due": {
                    "description": "Latest payment date in YYYY-MM-DD format - example: 2012-04-22",
                    "type": "string",
                    "format": "date",
                    "default": "2012-04-22"
                },
                "account_id": {
                    "description": "Id for Account Object",
                    "type": "integer"
                },
                "esr": {
                    "description": "If invoice has ESR - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "esr_id": {
                    "description": "If invoice has ESR - example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "esr_number": {
                    "description": "ESR number - example: 243",
                    "type": "integer",
                    "default": "243"
                },
                "esr_referencenumber": {
                    "description": "ESR number - example: 000000000000000000000002823",
                    "type": "string",
                    "default": "000000000000000000000002823"
                },
                "esr_singlepage": {
                    "description": "ESR number",
                    "type": "integer"
                },
                "esr_position": {
                    "description": "Positioning of ESR. 0 = additional page, 1 = first page, 2 = last page",
                    "type": "integer"
                },
                "lsvplus": {
                    "description": "If LSV+ is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "dd": {
                    "description": "If DebitDirect is active - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "discount": {
                    "description": "Discount amount - example: 5",
                    "type": "number",
                    "format": "float",
                    "default": "5"
                },
                "discount_type": {
                    "description": "0 - Percent, 1\t- Value - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "conditions": {
                    "description": "Text printed below positions - example: ipsum",
                    "type": "string",
                    "default": "ipsum"
                },
                "introduction": {
                    "description": "Introduction text printed above positions - example: lorem",
                    "type": "string",
                    "default": "lorem"
                },
                "language": {
                    "description": "Two-letter language code - example: de",
                    "type": "string",
                    "default": "de"
                },
                "paypal": {
                    "description": "PayPal account payment",
                    "type": "integer"
                },
                "paypal_url": {
                    "description": "PayPal pay URL - example: http://bit.ly/x4geSA",
                    "type": "string",
                    "default": "http://bit.ly/x4geSA"
                },
                "vat_included": {
                    "description": "If VAT is included in positions' prices - example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "totalamount": {
                    "description": "Total sum of all positions - example: 140.15",
                    "type": "number",
                    "format": "float",
                    "default": "140.15"
                },
                "status": {
                    "description": "See Status description - example: 7",
                    "type": "integer",
                    "default": "7"
                },
                "pages": {
                    "description": "Number of pages - example: 2",
                    "type": "integer",
                    "default": "2"
                },
                "layout_options": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "layout_id": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "signature_id": {
                    "description": "example: 123456789",
                    "type": "integer",
                    "default": "123456789"
                },
                "texts": {
                    "type": "object",
                    "$ref": "#/definitions/ListTextObject"
                },
                "freetexts": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/ListFreetext"
                    }
                },
                "positions": {
                    "type": "array",
                    "items": {
                        "type": "array",
                        "$ref": "#/definitions/ListPosition"
                    }
                },
                "process": {
                    "type": "object",
                    "$ref": "#/definitions/ListProcessObject"
                }
            },
            "xml": {
                "name": "ListInvoice"
            }
        },
        "ListTextObject": {
            "properties": {
                "12": {
                    "description": "12 because its referenncing to workflow id, Graem will figure what to write in here",
                    "$ref": "#/definitions/ListText"
                },
                "default": {
                    "description": "default text lorem ipsum something something",
                    "$ref": "#/definitions/ListText"
                }
            }
        },
        "ListProcessObject": {
            "properties": {
                "12": {
                    "description": "lorem ipsum",
                    "$ref": "#/definitions/ListProcess"
                }
            }
        },
        "ListPosition": {
            "required": [
                "number"
            ],
            "properties": {
                "type": {
                    "type": "integer"
                },
                "number": {
                    "description": "Catalog number",
                    "type": "number",
                    "format": "float"
                },
                "name": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "cost": {
                    "description": "Single item cost",
                    "type": "number",
                    "format": "float"
                },
                "unit": {
                    "description": "Type of item unit, like km or kg",
                    "type": "integer"
                },
                "amount": {
                    "description": "Number of items",
                    "type": "number",
                    "format": "float"
                },
                "vat": {
                    "type": "integer"
                },
                "discount": {
                    "type": "number",
                    "format": "float"
                },
                "discount_type": {
                    "description": "If the discount is in % (0) or amount (1)",
                    "type": "integer"
                }
            },
            "xml": {
                "name": "ListPosition"
            }
        },
        "ListProcess": {
            "required": [
                "active",
                "action",
                "options"
            ],
            "properties": {
                "active": {
                    "description": "example: 1",
                    "type": "integer",
                    "default": "1"
                },
                "days": {
                    "type": "integer"
                },
                "action": {
                    "description": "example: 2",
                    "type": "integer",
                    "default": "2"
                },
                "options": {
                    "description": "example: {client_email: lorem ipsum}",
                    "type": "string",
                    "default": "{client_email: lorem ipsum}"
                }
            },
            "xml": {
                "name": "ListProcess"
            }
        },
        "ListText": {
            "required": [
                "header"
            ],
            "properties": {
                "header": {
                    "description": "example: Lorem ipsum",
                    "type": "string",
                    "default": "Lorem ipsum"
                },
                "title": {
                    "description": "example: Rechnungs-Nr. {RECHNUNGSNR} / Kunden-Nr. {KUNDENNR}",
                    "type": "string",
                    "default": "Rechnungs-Nr. {RECHNUNGSNR} / Kunden-Nr. {KUNDENNR}"
                },
                "introduction": {
                    "description": "example: Introduction {PLACEHOLDER}",
                    "type": "string",
                    "default": "Introduction {PLACEHOLDER}"
                },
                "conditions": {
                    "description": "example: Conditions {PLACEHOLDER}",
                    "type": "string",
                    "default": "Conditions {PLACEHOLDER}"
                }
            },
            "xml": {
                "name": "ListText"
            }
        }
    },
    "parameters": {
        "limit": {
            "name": "limit",
            "in": "query",
            "description": "Limit the amount of results",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "0"
        },
        "page": {
            "name": "page",
            "in": "query",
            "description": "When limiting the results, specifies page",
            "required": false,
            "type": "integer",
            "format": "int32",
            "default": "1"
        },
        "sort": {
            "name": "sort",
            "in": "query",
            "description": "Sorts the list by the available values",
            "required": false,
            "type": "string",
            "default": "date",
            "enum": [
                "date",
                "due",
                "number"
            ]
        },
        "sorttype": {
            "name": "sorttype",
            "in": "query",
            "description": "Defines the way of sorting",
            "required": false,
            "type": "string",
            "default": "desc",
            "enum": [
                "asc",
                "desc"
            ]
        },
        "id": {
            "name": "id",
            "in": "query",
            "required": true,
            "type": "integer",
            "format": "int32"
        }
    },
    "tags": [
        {
            "name": "Invoice",
            "description": "Everything about your Invoices"
        }
    ]
}