{"_id":"@bennetgallein/lexoffice-client-js","_rev":"5-e1d9534631029c29dac336ed555dbe54","name":"@bennetgallein/lexoffice-client-js","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.0":{"name":"@bennetgallein/lexoffice-client-js","version":"1.0.0","keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"author":{"name":"elbstack","email":"hello@elbstack.com"},"license":"MIT","_id":"@bennetgallein/lexoffice-client-js@1.0.0","maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"dist":{"shasum":"31cc29b7b1b86f7b39415c0f35e526edbc864242","tarball":"https://registry.npmjs.org/@bennetgallein/lexoffice-client-js/-/lexoffice-client-js-1.0.0.tgz","fileCount":40,"integrity":"sha512-0oNiuB+9TtTciztJxHhOskhnTjuqo21NqNRGMN/78T15UK/exuubDj8yD/mycoZPrhgh3L9smhLas3uD/51zXg==","signatures":[{"sig":"MEUCIGIT4ZmwXEIp+7tEBAmu2eDohFjEvYc1I74BF6yhIakbAiEAh7Dl66iIRfzxMJVp5t6IrgJkaEbOwIhzkWic42CqxzQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66907},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.m.js","source":"src/index.ts","gitHead":"8f45c95a8c067882bbfe0d124520d8f79daf8eae","scripts":{"dev":"microbundle watch","lint":"eslint 'src/**/*.ts' --fix","test":"echo \"No test specified\"","build":"rm -rf dist && microbundle","release":"npm run build && np","start:example":"ts-node example/index.ts"},"_npmUser":{"name":"bennetgallein","email":"bg@esyoil.com"},"umd:main":"dist/index.umd.js","repository":{"url":"git+https://github.com/bennetgallein/lexoffice-client-js.git","type":"git"},"_npmVersion":"10.5.2","description":"An universal client for the Lexoffice API written in Typescript","directories":{},"_nodeVersion":"20.13.1","dependencies":{"axios":"^0.21.1","tslib":"^2.2.0","uri-tag":"^1.3.0","form-data":"^4.0.0","ts-results":"^3.1.1","utility-types":"^3.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.5.0","jest":"^26.6.3","nock":"^13.0.7","eslint":"^7.19.0","ts-node":"^9.1.1","prettier":"^2.2.1","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.1","eslint-plugin-import":"^2.22.1","eslint-config-prettier":"^7.2.0","local-package-publisher":"^1.0.4","@typescript-eslint/parser":"^4.14.2","@typescript-eslint/eslint-plugin":"^4.14.2"},"_npmOperationalInternal":{"tmp":"tmp/lexoffice-client-js_1.0.0_1729415099598_0.874005946677562","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@bennetgallein/lexoffice-client-js","version":"1.1.0","keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"author":{"name":"elbstack","email":"hello@elbstack.com"},"license":"MIT","_id":"@bennetgallein/lexoffice-client-js@1.1.0","maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"dist":{"shasum":"4f2c77430871d72e0ac1029830f73484e7ac86b9","tarball":"https://registry.npmjs.org/@bennetgallein/lexoffice-client-js/-/lexoffice-client-js-1.1.0.tgz","fileCount":41,"integrity":"sha512-mBpjscTobGESxeYtiSelpevAD63/rkwa7VNuc7z3UtMPI3eit2s+IvuciDtoJekF4o5rihgL+x4QWEJ2FmuqDg==","signatures":[{"sig":"MEYCIQC/h4BgudZC/6fIs8Cwm4kpd2Ryw80E8FGoONa88HkJAgIhAIWcs3i8/s4wMSzr7XhUKhS/22xElx4m+lKcBBxC+G5I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68250},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.m.js","source":"src/index.ts","gitHead":"a4bb3a83b21bb4effe5d36f3e2a3b4003e74e2cb","scripts":{"dev":"microbundle watch","lint":"eslint 'src/**/*.ts' --fix","test":"echo \"No test specified\"","build":"rm -rf dist && microbundle","release":"npm run build && np","start:example":"ts-node example/index.ts"},"_npmUser":{"name":"bennetgallein","email":"bg@esyoil.com"},"umd:main":"dist/index.umd.js","repository":{"url":"git+https://github.com/bennetgallein/lexoffice-client-js.git","type":"git"},"_npmVersion":"10.5.2","description":"An universal client for the Lexoffice API written in Typescript","directories":{},"_nodeVersion":"20.13.1","dependencies":{"axios":"^0.21.1","tslib":"^2.2.0","uri-tag":"^1.3.0","form-data":"^4.0.0","ts-results":"^3.1.1","utility-types":"^3.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.5.0","jest":"^26.6.3","nock":"^13.0.7","eslint":"^7.19.0","ts-node":"^9.1.1","prettier":"^2.2.1","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.1","eslint-plugin-import":"^2.22.1","eslint-config-prettier":"^7.2.0","local-package-publisher":"^1.0.4","@typescript-eslint/parser":"^4.14.2","@typescript-eslint/eslint-plugin":"^4.14.2"},"_npmOperationalInternal":{"tmp":"tmp/lexoffice-client-js_1.1.0_1729415616484_0.07221661173955751","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@bennetgallein/lexoffice-client-js","version":"1.1.1","keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"author":{"name":"elbstack","email":"hello@elbstack.com"},"license":"MIT","_id":"@bennetgallein/lexoffice-client-js@1.1.1","maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"dist":{"shasum":"6f7307c937a795245e50d7ca00b7101446caeb57","tarball":"https://registry.npmjs.org/@bennetgallein/lexoffice-client-js/-/lexoffice-client-js-1.1.1.tgz","fileCount":41,"integrity":"sha512-zhw9JCiiClTiwOt1mJH14rNDbQuCfPO6/fYZBcHgt/yEQGxnxvYm1ovALloDSVw1BY0+y3wYpeoLqUMaNr+Q3A==","signatures":[{"sig":"MEUCIQDUTYwiPqjmFBc6rolhlWiWIOj9OSdUR96nV5YVeWARSgIgJTqZSeIbiAs6NRmO7q6RBUgkhYgHrFPSCGUn480Cb+s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":68250},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.m.js","source":"src/index.ts","gitHead":"2d0835f4b7e26294d2efc3e4344292e3ef0ee001","scripts":{"dev":"microbundle watch","lint":"eslint 'src/**/*.ts' --fix","test":"echo \"No test specified\"","build":"rm -rf dist && microbundle","release":"npm run build && np","start:example":"ts-node example/index.ts"},"_npmUser":{"name":"bennetgallein","email":"bg@esyoil.com"},"umd:main":"dist/index.umd.js","repository":{"url":"git+https://github.com/bennetgallein/lexoffice-client-js.git","type":"git"},"_npmVersion":"10.5.2","description":"An universal client for the Lexoffice API written in Typescript","directories":{},"_nodeVersion":"20.13.1","dependencies":{"axios":"^0.21.1","tslib":"^2.2.0","uri-tag":"^1.3.0","form-data":"^4.0.0","ts-results":"^3.1.1","utility-types":"^3.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.5.0","jest":"^26.6.3","nock":"^13.0.7","eslint":"^7.19.0","ts-node":"^9.1.1","prettier":"^2.2.1","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.1","eslint-plugin-import":"^2.22.1","eslint-config-prettier":"^7.2.0","local-package-publisher":"^1.0.4","@typescript-eslint/parser":"^4.14.2","@typescript-eslint/eslint-plugin":"^4.14.2"},"_npmOperationalInternal":{"tmp":"tmp/lexoffice-client-js_1.1.1_1729415985973_0.012897329670258584","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@bennetgallein/lexoffice-client-js","version":"1.1.2","keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"author":{"name":"elbstack","email":"hello@elbstack.com"},"license":"MIT","_id":"@bennetgallein/lexoffice-client-js@1.1.2","maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"dist":{"shasum":"834438f2d294102bce23f710d1535145f366b2a4","tarball":"https://registry.npmjs.org/@bennetgallein/lexoffice-client-js/-/lexoffice-client-js-1.1.2.tgz","fileCount":123,"integrity":"sha512-401YZ/bds4lwoS6hp+kjcvsUCUAPigBach3K82WDusFLJnAmojLCY2v4FrjNQpDlPDyxQhx7OGpF/Pd9GHsQdA==","signatures":[{"sig":"MEQCIB6mwynisLIdFDUcHZ1K3Fb/DMCmFdif6iwhLySAkSouAiBiB+e1FEYKMIhmKFhkcATXYHZQzsgYsoRZSc9fnOh97Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":391228},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.m.js","source":"src/index.ts","gitHead":"2357c8bed2ba94c0c82c3b361438203fab3d3be3","scripts":{"dev":"microbundle watch","lint":"eslint 'src/**/*.ts' --fix","test":"echo \"No test specified\"","build":"rm -rf dist && microbundle","release":"npm run build && np","start:example":"ts-node example/index.ts"},"_npmUser":{"name":"bennetgallein","email":"bg@esyoil.com"},"umd:main":"dist/index.umd.js","repository":{"url":"git+https://github.com/bennetgallein/lexoffice-client-js.git","type":"git"},"_npmVersion":"10.5.2","description":"An universal client for the Lexoffice API written in Typescript","directories":{},"_nodeVersion":"20.13.1","dependencies":{"axios":"^0.21.1","tslib":"^2.2.0","uri-tag":"^1.3.0","form-data":"^4.0.0","ts-results":"^3.1.1","utility-types":"^3.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"np":"^7.5.0","jest":"^26.6.3","nock":"^13.0.7","eslint":"^7.19.0","ts-node":"^9.1.1","prettier":"^2.2.1","typescript":"^4.1.3","@types/jest":"^26.0.20","microbundle":"^0.13.1","eslint-plugin-import":"^2.22.1","eslint-config-prettier":"^7.2.0","local-package-publisher":"^1.0.4","@typescript-eslint/parser":"^4.14.2","@typescript-eslint/eslint-plugin":"^4.14.2"},"_npmOperationalInternal":{"tmp":"tmp/lexoffice-client-js_1.1.2_1729416532347_0.09576281701383471","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@bennetgallein/lexoffice-client-js","version":"1.2.0","description":"An universal client for the Lexoffice API written in Typescript","main":"dist/index.js","module":"dist/index.m.js","umd:main":"dist/index.umd.js","types":"dist/index.d.ts","source":"src/index.ts","scripts":{"build":"rm -rf dist && microbundle","dev":"microbundle watch","release":"npm run build && np","lint":"eslint 'src/**/*.ts' --fix","test":"echo \"No test specified\"","start:example":"ts-node example/index.ts"},"repository":{"type":"git","url":"git+https://github.com/bennetgallein/lexoffice-client-js.git"},"keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"author":{"name":"elbstack","email":"hello@elbstack.com"},"contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"license":"MIT","bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","publishConfig":{"access":"public"},"devDependencies":{"@types/jest":"^26.0.20","@typescript-eslint/eslint-plugin":"^4.14.2","@typescript-eslint/parser":"^4.14.2","eslint":"^7.19.0","eslint-config-prettier":"^7.2.0","eslint-plugin-import":"^2.22.1","jest":"^26.6.3","local-package-publisher":"^1.0.4","microbundle":"^0.13.1","nock":"^13.0.7","np":"^7.5.0","prettier":"^2.2.1","ts-node":"^9.1.1","typescript":"^4.1.3"},"dependencies":{"axios":"^0.21.1","form-data":"^4.0.0","ts-results":"^3.1.1","tslib":"^2.2.0","uri-tag":"^1.3.0","utility-types":"^3.10.0"},"_id":"@bennetgallein/lexoffice-client-js@1.2.0","gitHead":"22ee365653062c0c8854bda9d6c9ac104c4fb2f6","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-qh3iLCEz9McrQ7jRAUIni/KGMbL79oc6dcHN8h09tnEFcFFFCBIQEQlJGp9uPTMAWoxHgfVcLAdAnoSWRkTalw==","shasum":"dd1ff46cd83386e2dc073e3732c1a37a2aafb345","tarball":"https://registry.npmjs.org/@bennetgallein/lexoffice-client-js/-/lexoffice-client-js-1.2.0.tgz","fileCount":123,"unpackedSize":391210,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDMLr7gl7ULw9KB5GOkuJPMQwnQh/kLP+ICttgSBGNxnAiBwae/NOLhN7TSznKPpKu3f79ctdQ8VYgsNKFBUsMdcyA=="}]},"_npmUser":{"name":"bennetgallein","email":"bg@esyoil.com"},"directories":{},"maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lexoffice-client-js_1.2.0_1767441384171_0.4383255551614602"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-20T09:04:59.435Z","modified":"2026-01-03T11:56:24.520Z","1.0.0":"2024-10-20T09:04:59.777Z","1.1.0":"2024-10-20T09:13:36.710Z","1.1.1":"2024-10-20T09:19:46.141Z","1.1.2":"2024-10-20T09:28:52.618Z","1.2.0":"2026-01-03T11:56:24.314Z"},"bugs":{"url":"https://github.com/bennetgallein/lexoffice-client-js/issues"},"author":{"name":"elbstack","email":"hello@elbstack.com"},"license":"MIT","homepage":"https://github.com/bennetgallein/lexoffice-client-js#readme","keywords":["lexoffice","api","client","javascript","typescript","node","browser"],"repository":{"type":"git","url":"git+https://github.com/bennetgallein/lexoffice-client-js.git"},"description":"An universal client for the Lexoffice API written in Typescript","contributors":[{"name":"Annaelle Rössert","email":"annaelle@elbstack.com"}],"maintainers":[{"name":"bennetgallein","email":"bg@esyoil.com"}],"readme":"<h1 align = \"center\">lexoffice-client-js</h1>\n\n<p align=\"center\">\n  <strong>Javascript client library for the <a href=\"https://www.lexoffice.de/partner/public-api/\">lexoffice Public API<a>.</strong>\n</p>\n\n<p align=\"center\"><strong><img src=\"https://emojis.slackmojis.com/emojis/images/1479745458/1383/typescript.png?1479745458\" width=\"20\" height=\"20\"/> fully typed</strong></p>\n<p align=\"center\"><strong><img src=\"/images/promise-logo.png\" width=\"20\" height=\"20\"/> promise based</strong></p>\n<p align=\"center\"><strong>❌ non throwing</strong></p>\n<br>\n<p align=\"center\">\n  <a href=\"https://github.com/bennetgallein/lexoffice-client-js\">\n    <img src=\"https://badgen.net/badge/-/github?icon=github&label alt=\"GitHub\" />\n  </a>\n  <a href=\"https://github.com/bennetgallein/lexoffice-client-js/stargazers\">\n    <img src=\"https://badgen.net/github/stars/bennetgallein/lexoffice-client-js\" alt=\"GitHub Stars\"/>\n  </a>\n    <a>\n    <img alt=\"npm (latest)\" src=\"https://img.shields.io/npm/v/@bennetgallein/lexoffice-client-js/latest?color=%23f73149\"/>\n  </a>\n  <a>\n    <img alt=\"npm (next)\" src=\"https://img.shields.io/npm/v/@bennetgallein/lexoffice-client-js/next?color=%23e044aa\"/>\n  </a>\n    <br>\n  <a href=\"https://github.com/bennetgallein/lexoffice-client-js/pulse\" >\n    <img src=\"https://img.shields.io/github/commit-activity/m/bennetgallein/lexoffice-client-js?color=%23329121\" alt=\"Activity\" />        \n  </a>\n  <a href=\"https://github.com/bennetgallein/lexoffice-client-js/graphs/contributors\">\n    <img src=\"https://img.shields.io/github/contributors/bennetgallein/lexoffice-client-js?color=%2345e6db\" alt=\"Contributors\" />\n  </a>\n  <a href=\"https://github.com/bennetgallein/lexoffice-client-js/blob/main/LICENSE\">\n    <img\n      src=\"https://badgen.net/badge/license/MIT/blue\"\n      alt=\"MIT license\"\n    />\n  </a>\n</p>\n\n## 📦 Contents\n\n- [📦 Contents](#-contents)\n  - [Retrieve an invoice](#retrieve-an-invoice)\n  - [Create an invoice](#create-an-invoice)\n  - [Upload File](#upload-file)\n  - [Error codes and types](#error-codes-and-types)\n  - [Contact](#contact)\n  - [Country](#country)\n  - [Credit note](#credit-note)\n  - [Down payment invoice](#down-payment-invoice)\n  - [Event subscription](#event-subscription)\n  - [File](#file)\n  - [Invoice](#invoice)\n  - [Order confirmation](#order-confirmation)\n  - [Payment](#payment)\n  - [Payment condition](#payment-condition)\n  - [Posting category](#posting-category)\n  - [Profile](#profile)\n  - [Quotation](#quotation)\n  - [Recurring template](#recurring-template)\n  - [Voucher](#voucher)\n  - [Voucherlist](#voucherlist)\n  - [Updating](#updating)\n  - [Rendering Document File Id](#rendering-document-file-id)\n  - [Download File](#download-file)\n  - [👩🏻‍💻👨🏽‍💻 We are hiring!](#-we-are-hiring)\n<ul><li><a href=\"#about\"><img src=\"/images/favicon-32x32.png\"width=\"20\" height=\"20\"/> About us</a></li></ul>\n\n---\n\n<h2 name=\"installation\" >⚙️ Installation</h2>\n\n```bash\nnpm install @bennetgallein/lexoffice-client-js\n```\n\nor\n\n```bash\nyarn add @bennetgallein/lexoffice-client-js\n```\n\n<h2 name=\"documentation\">📚 Documentation</h2>\n\nYou can find the official lexoffice API documentation [here](https://developers.lexoffice.io/docs/#lexoffice-api-documentation).\n\n<h2 name=\"usage\" >🔑 Usage</h2>\n\nTo get your API Key, you must already be a lexoffice user. Get it [here](https://app.lexoffice.de/settings/#/public-api).\n\n```ts\nimport { Client } from '@bennetgallein/lexoffice-client-js';\n\nconst client = new Client(YOUR_LEXOFFICE_API_KEY);\n```\n\n<h2 name=\"examples\">💡 Examples</h2>\n\nAll functions are promise based. These promises are formatted by the [ts-results package](https://github.com/vultix/ts-results), for extended error handling see [Error handling](#error-handling).\n\n### Retrieve an invoice\n\n```ts\nconst invoiceResult = await client.retrieveInvoice('caf4e0c3-c3e8-4a06-bcfe-346bc7190b2');\n\nif (invoiceResult.ok) {\n  const invoice = invoiceResult.val;\n} else {\n  console.error('An error occured');\n}\n```\n\n### Create an invoice\n\n```ts\nconst invoice = {\n  voucherDate: '2017-02-22T00:00:00.000+01:00',\n  address: {\n    name: 'Bike & Ride GmbH & Co. KG',\n    supplement: 'Gebäude 10',\n    street: 'Musterstraße 42',\n    city: 'Freiburg',\n    zip: '79112',\n    countryCode: 'DE',\n  },\n  lineItems: [\n    {\n      type: 'custom',\n      name: 'Energieriegel Testpaket',\n      quantity: 1,\n      unitName: 'Stück',\n      unitPrice: {\n        currency: 'EUR',\n        netAmount: 5,\n        taxRatePercentage: 0,\n      },\n      discountPercentage: 0,\n    },\n    {\n      type: 'text',\n      name: 'Strukturieren Sie Ihre Belege durch Text-Elemente.',\n      description: 'Das hilft beim Verständnis',\n    },\n  ],\n  totalPrice: {\n    currency: 'EUR',\n  },\n  taxConditions: {\n    taxType: 'net',\n  },\n  shippingConditions: {\n    shippingDate: '2017-04-22T00:00:00.000+02:00',\n    shippingType: 'delivery',\n  },\n  title: 'Rechnung',\n  introduction: 'Ihre bestellten Positionen stellen wir Ihnen hiermit in Rechnung',\n  remark: 'Vielen Dank für Ihren Einkauf',\n};\n\nconst createdInvoiceResult = await client.createInvoice(invoice, { finalize: true });\n\nif (createdInvoiceResult.ok) {\n  const invoice = createdInvoiceResult.val;\n} else {\n  console.error('An error occured');\n}\n```\n\n### Upload File\n\n```ts\nlet fs = require('fs');\nlet FormData = require('form-data');\n\nlet data = new FormData();\n\ndata.append('file', fs.createReadStream(__dirname + '/yourFolder/yourFile'));\ndata.append('type', 'voucher');\n\nconst uploadedFileResult = await client.uploadFile(data);\n\nif (uploadedFileResult.ok) {\n  const invoice = uploadedFileResult.val;\n} else {\n  console.error('An error occured');\n}\n```\n\n<h2 name=\"error-handling\">❌ Error handling</h2>\n\nAs mentioned above, the returned promises are formatted by ts-results which is a typescript implementation of Rust's [Result](https://doc.rust-lang.org/std/result/) and [Option](https://doc.rust-lang.org/std/option/) objects. It brings compile-time error checking and optional values to typescript.\nAll errors are instances of type RequestError.\nIf you want to use the advantages of ts-results, all client responses should be processed similar to the following:\n\n```ts\nif (YOUR_RESULT.ok) {\n  const YOUR_VARIABLE = YOUR_RESULT.val;\n  // Work with your result\n} else {\n  // Your request returned an error\n  const error = YOUR_RESULT.val;\n  console.log('error:', error);\n  // Further error checking is possible by\n  if (error instanceof RequestError) {\n    console.log('Hello instance of RequestError!');\n\n    if (error instanceof RequestNotFoundError) {\n      console.log('Wow, it looks like you have many instances!');\n    }\n    if (error instanceof RequestMethodNotAcceptableLegacyError) {\n      console.log('Seems, that you take care of your legacy!');\n    }\n  }\n}\n```\n\n### Error codes and types\n\n<table>\n<th colspan=\"4\">Regular errors</th>\n<tr>\n<th width=\"15%\">❌ Error code</th>\n<th width=\"35%\"><img src=\"https://emojis.slackmojis.com/emojis/images/1479745458/1383/typescript.png?1479745458\" width=\"20\" height=\"20\"/> Error type</th>\n<th width=\"15%\">❌ Server error code</th>\n<th width=\"35%\"><img src=\"https://emojis.slackmojis.com/emojis/images/1479745458/1383/typescript.png?1479745458\" width=\"20\" height=\"20\"/> Error type</th>\n</tr>\n<tr>\n<td>400</td>\n<td>RequestBadRequestError</td>\n<td>500</td>\n<td>RequestInternalServerError</td>\n</tr>\n<tr>\n<td>401</td>\n<td>RequestUnauthorizedError</td>\n<td>503</td>\n<td>RequestServiceUnavailableError</td>\n</tr>\n<tr>\n<td>402</td>\n<td>RequestPaymentRequiredError</td>\n<td>504</td>\n<td>RequestGatewayTimeoutError</td>\n</tr>\n<tr>\n<td>403</td>\n<td>RequestForbiddenError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>404</td>\n<td>RequestNotFoundError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>405</td>\n<td>RequestMethodNotAllowedError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>406</td>\n<td>RequestMethodNotAcceptableError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>409</td>\n<td>RequestConflictError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>415</td>\n<td>RequestUnsupportedMediaTypeError</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>429</td>\n<td>RequestTooManyRequestsError</td>\n<td></td>\n<td></td>\n</tr>\n<th colspan=\"4\">Legacy errors (used by the endpoints files, profiles and contacts)</th>\n<tr>\n<td>400</td>\n<td>RequestBadRequestLegacyError</td>\n<td>500</td>\n<td>RequestInternalServerLegacyError</td>\n</tr>\n<tr>\n<td>406</td>\n<td>\nRequestMethodNotAcceptableLegacyError</td>\n<td></td>\n<td></td>\n</tr>\n</table>\n\n<h2 name=\"provided-methods\">🛠 Provided methods grouped by endpoint</h2>\n\n### Contact\n\n```ts\n\ncreateContact(contact: ContactCreatePerson | ContactCreateCompany): Promise<Result<ContactCreateResponse, RequestError>>\n\nretrieveContact(id: string): Promise<Result<ContactRetrieveResponse, RequestError>>\n\nupdateContact(id: string, contact: ContactUpdatePerson | ContactUpdateCompany): Promise<Result<ContactUpdateResponse, RequestError>>\n\nfilterContact(filter?: OptionalFilters & Partial<PagingParameters>): Promise<Result<ContactFilterRetrieveResponse, RequestError>>\n```\n\n### Country\n\n```ts\nretrieveListOfCountries(): Promise<Result<Country[], RequestError>>\n```\n\n### Credit note\n\n```ts\ncreateCreditNote(creditNote: CreditNoteCreate, optionalFinalized?: OptionalFinalized): Promise<Result<CreditNoteCreateResponse, RequestError>>\n\nretrieveCreditNote(id: string): Promise<Result<CreditNoteRetrieveResponse, RequestError>>\n\nrenderCreditNoteDocumentFileId(id: string): Promise<Result<DocumentFileId, RequestError>>\n```\n\n### Down payment invoice\n\n```ts\nretrieveDownPaymentInvoice(id: string): Promise<Result<DownPaymentInvoice, RequestError>>\n```\n\n### Event subscription\n\n```ts\ncreateEventSubscription(eventSubscription: EventSubscriptionCreate): Promise<Result<EventSubscription, RequestError>>\n\nretrieveEventSubscription(id: string): Promise<Result<EventSubscription, RequestError>>\n\nretrieveAllEventSubscriptions(): Promise<Result<EventSubscriptions, RequestError>>\n\ndeleteEventSubscription(id: string): Promise<Result<unknown, RequestError>>\n```\n\n### File\n\n```ts\nuploadFile(data: FormData): Promise<Result<FileResponse, RequestError>>\n\ndownloadFile(documentFileId: string, optionalParameter?: RenderType): Promise<Result<unknown, RequestError>>\n```\n\n### Invoice\n\n```ts\ncreateInvoice(invoice: InvoiceCreate | XRechnung, optionalFinalized?: OptionalFinalized): Promise<Result<InvoiceCreateResponse, RequestError>>\n\nretrieveInvoice(id: string): Promise<Result<InvoiceRetrieveResponse, RequestError>>\n\nrenderInvoiceDocumentFileId(id: string): Promise<Result<DocumentFileId, RequestError>>\n```\n\n### Order confirmation\n\n```ts\ncreateOrderConfirmation(orderConfirmation: OrderConfirmation): Promise<Result<OrderConfirmationResponse, RequestError>>\n\nretrieveOrderConfirmation(id: string): Promise<Result<OrderConfirmationRetrieveResponse, RequestError>>\n\nrenderOrderConfirmationDocumentFileId(id: string): Promise<Result<DocumentFileId, RequestError>>\n```\n\n### Payment\n\n```ts\nretrievePayment(id: string): Promise<Result<Payment, RequestError>>\n```\n\n### Payment condition\n\n```ts\nretrievePaymentConditionList(): Promise<Result<PaymentCondition, RequestError>>\n```\n\n### Posting category\n\n```ts\nretrieveListPostingCategories(): Promise<Result<PostingCategory[], RequestError>>\n```\n\n### Profile\n\n```ts\nretrieveProfile(): Promise<Result<Profile, RequestError>>\n```\n\n### Quotation\n\n```ts\ncreateQuotation(quotation: QuotationCreate, optionalFilter?: OptionalFinalized): Promise<Result<QuotationCreate, RequestError>>\n\nretrieveQuotation(id: string): Promise<Result<Partial<Quotation>, RequestError>>\n\nrenderQuotationDocumentFileId(id: string): Promise<Result<DocumentFileId, RequestError>>\n```\n\n### Recurring template\n\n```ts\nretrieveRecurringTemplate(id: string): Promise<Result<Partial<RecurringTemplate>, RequestError>>\n\nretrieveAllRecurringTemplates(optionalFilter?: PagingParameters): Promise<Result<RecurringTemplates, RequestError>>\n```\n\n### Voucher\n\n```ts\ncreateVoucher(voucher: CreateVoucher): Promise<Result<VoucherCreateResponse, RequestError>>\n\nretrieveVoucher(id: string): Promise<Result<Partial<Voucher>, RequestError>>\n\nupdateVoucher(id: string, voucher: CreateVoucher): Promise<Result<VoucherCreateResponse, RequestError>>\n\nfilterVoucher(voucherNumber: VoucherNumber): Promise<Result<Partial<Vouchers>, RequestError>>\n\nuploadFileToVoucher(data: FormData, id: string): Promise<Result<FileResponse, RequestError>>\n```\n\n### Voucherlist\n\n```ts\nretrieveVoucherlist(filterParameter: FilterParameter): Promise<Result<Voucherlist, RequestError>>\n```\n\n<h2 name=\"side-notes\">🔖 Side notes</h2>\n\n### Updating\n\nFor updating any type of vouchers where the \"version\" property is required, you first need to retrieve it and use the current \"version\" value to properly update.\n\n### Rendering Document File Id\n\nOnly possible for any type of vouchers that are not in \"draft\" mode.\n\n### Download File\n\nThe required id is not the id itself, it is the documentFileId, which can be required with the matching method and the vouchers id:\n\n```ts\nrenderCreditNoteDocumentFileId(id);\nrenderInvoiceDocumentFileId(id);\nrenderOrderConfirmationDocumentFileId(id);\nrenderQuotationDocumentFileId(id);\n```\n\n<h2 name=\"about\"><img src=\"images/favicon-32x32.png\" width=\"30\" height=\"30\"/> This package has been brought to you by elbstack!</h2>\n\nelbstack is a software engineering & design company. We question, we advise, and we're excited to help your next project to succeed.<br>\nWe offer software development and design as service. That's how we support you with the realisation of your projects - with individual employees or with a whole team. We love to work remotely, but we will work at your place, too.\n\n### 👩🏻‍💻👨🏽‍💻 We are hiring!\n\n<p>We are more than a classic software agency, rather like a highly self organized company with our own start-up incubator. You can choose how much, for whom and what you want to work for. Acquire your own customers and projects, simply make your sideproject become reality or even a proper start-up.</p>\n<p>Sounds like a scam?</p>\n\n<a href=\"https://www.kununu.com/de/elbstack2\">➡️ Go and check kununu.com</a><br>\n<a href=\"https://elbstack.com\">➡️ elbstack.com</a>\n","readmeFilename":"README.md"}