Skip to content

Commit 6dc48f7

Browse files
committed
feat: add method to get the bookkeeping system version
1 parent 1b7c39e commit 6dc48f7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/SevdeskApiClient.ts

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ export default class XentralApiClient {
1717
this.userAgent = options.userAgent;
1818
}
1919

20+
//#region Basics
21+
/**
22+
* Get the bookkeeping system version. Sevdesk 2.0 introduces some breaking API changes so you'll
23+
* have to use this and change the API payloads accordingly, depending on the version of the target instance.
24+
* @see https://tech.sevdesk.com/api_news/posts/2024_04_04-system-update-breaking-changes/
25+
* @returns The bookkeeping system version
26+
*/
27+
getBookkeepingSystemVersion(): Promise<{ version: '1.0' | '2.0' }> {
28+
return this.apiRequest('/Tools/bookkeepingSystemVersion')
29+
.then((res) => res.json())
30+
.then(({ objects }) => objects);
31+
}
32+
//#endregion
33+
2034
/**
2135
*
2236
* @param route Route with leading slash (eg. /version)

0 commit comments

Comments
 (0)