{"swagger":"2.0","info":{"title":"AbaNinja Invoice Backlog API","version":"1.0.0-ALPHA","description":"API for gastronomy and other areas, where invoice items are generated.\n\nThis interface enables a client system to append invoice items to the invoice backlog of an AbaNinja account.\nAll incoming records are to be reviewed and corrected manually.\nThus, invoices will never be sent automatically as a result of a call to this API.\n\nTransferred objects are bound to the AbaNinja account determined by the access token.\n\nMoney amounts and quantities must be specified as strings (format \"decimal\") in order to avoid floating point representation errors directly\nand indirectly by encouraging the use of according numeric type implementations such as BigDecimal in Java.\nThe regex pattern for strings in decimal format would thus be\n\"^(?:\\\\\\\\d+(?:\\\\\\\\.\\\\\\\\d+)?|\\\\\\\\.\\\\\\\\d+)$\".\n","termsOfService":"Free access for registered entities, no warranty.\n","license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"},"contact":{"name":"ABACUS Research AG","url":"https://www.abacus.ch","email":"info@abacus.ch"}},"host":"app.abaninja.ch","schemes":["https"],"produces":["application/json"],"basePath":"/api/invoice_backlog/v1.0a","securityDefinitions":{"oauth2":{"type":"oauth2","flow":"accessCode","tokenUrl":"https://auth-dev.abasky.net/auth/realms/abasky/protocol/openid-connect/token","authorizationUrl":"https://auth-dev.abasky.net/auth/realms/abasky/protocol/openid-connect/auth"}},"security":[{"oauth2":[]}],"paths":{"/userinfo":{"get":{"summary":"Returns information about logged in user and the availabile accounts","responses":{"200":{"description":"User information successfully returned","schema":{"$ref":"#/definitions/UserInfo"}},"default":{"description":"error","schema":{"$ref":"#/definitions/Error"}}}}},"/account/{account}/item_collections":{"post":{"summary":"Appends an invoice item collection to the backlog\n","consumes":["application/json"],"parameters":[{"name":"account","in":"path","required":true,"type":"string"},{"name":"InvoiceItemCollection","in":"body","required":true,"schema":{"$ref":"#/definitions/InvoiceItemCollection"}}],"tags":["InvoiceItemCollection"],"responses":{"200":{"description":"Collection has been persisted successfully"},"default":{"description":"error","schema":{"$ref":"#/definitions/Error"}}}}}},"definitions":{"UserInfo":{"type":"object","properties":{"uid":{"type":"string","description":"unique user identifier"},"accounts":{"type":"array","items":{"$ref":"#/definitions/UserAccount"}}},"required":["uid","accounts"]},"UserAccount":{"type":"object","properties":{"uid":{"type":"string","description":"unique account identifier"},"name":{"type":"string","description":"human readable account name"}},"required":["uid","name"]},"InvoiceItemCollection":{"type":"object","properties":{"header":{"type":"object","required":["uid"],"properties":{"uid":{"type":"string","description":"collection id (unique within data source)"},"entryDate":{"type":"string","format":"dateTime","description":"date as defined in RFC 3339"},"language":{"type":"string","description":"language code as defined in ISO 639-1"},"customerId":{"type":"string","description":"customer id, takes precedence over association by customerEMail;\nsee /api/v1/clients\n"},"customerEMail":{"type":"string","format":"email","description":"used for association with customer records, when the customerId is missing"},"customerName":{"type":"string","description":"name of customer"},"customerAddressLine1":{"type":"string","description":"address information line 1"},"customerAddressLine2":{"type":"string","description":"address information line 2"},"customerAddressZip":{"type":"string","description":"address information zip code"},"customerAddressCity":{"type":"string","description":"address information city"},"customerAddressCountry":{"type":"string","description":"address information country"},"externalDocumentNumber":{"type":"string","description":"e.g. a voucher number (unique within data source)"},"externalDocumentUri":{"type":"string","description":"E.g. an URI pointing to a voucher (PDF) on a cloud storage space.\nFor consistency, the document needs to be uploaded beforehand.\n"},"currency":{"type":"string","description":"currency of all money amounts; code as defined in ISO 4217"}}},"items":{"type":"array","minLength":1,"items":{"$ref":"#/definitions/InvoiceItem"},"description":"one or more invoice items"}},"required":["header","items"]},"InvoiceItem":{"type":"object","properties":{"type":{"type":"string","enum":["product"],"description":"object type"},"articleNumber":{"type":"string"},"productGroupNumber":{"type":"string","description":"AbaNinja product group;\nNote, that definitions in AbaPOS don't correspond to those in AbaNinja.\n"},"description":{"type":"string"},"quantity":{"type":"string","format":"decimal","default":"1"},"amountExclVAT":{"type":"string","format":"decimal","description":"amount with VAT excluded\n"},"vatRate":{"type":"string","format":"decimal","description":"VAT rate in percent, e.g. \"8.0\""},"vatAmount":{"type":"string","format":"decimal","description":"VAT amount;\nvatAmount = amountExclVAT * (vatRate/100.0)\n"},"amountInclVAT":{"type":"string","format":"decimal","description":"amount with VAT included;\namountInclVAT = amountExclVAT + vatAmount\n"},"postingType":{"type":"string","description":"as configured in AbaNinja"}},"required":["type"]},"Error":{"type":"object","description":"<p><font color=\"red\">\nTODO: If reasonable, this entity should be replaced or extend with a definition according to a standard such as RFC 7807.\nDefinitions in ABACUS Connect shall be reused, if possible.\n</font></p>\n","properties":{"error":{"type":"string","description":"A single ASCII error code\n"},"error_description":{"type":"string","description":"Human-readable ASCII text providing\nadditional information, used to assist the client developer in\nunderstanding the error that occurred.\n"},"error_uri":{"type":"string","description":"A URI identifying a human-readable web page with\ninformation about the error, used to provide the client\ndeveloper with additional information about the error\n"}},"required":["error"]}}}