List ledger accounts
const url = 'https://api.sancho-wms.pl/v1/ledgerAccounts.list';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"integrationId":1,"fiscalYearId":1,"cursor":"example","q":"example","filters":{"number":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}},"name":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}},"parentId":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}},"level":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}},"classification":{"$eq":"asset","$ne":"asset","$in":["asset"],"$nin":["asset"],"$meta":{"preset":"example","scoped":true}},"accountType":{"$eq":"asset","$ne":"asset","$in":["asset"],"$nin":["asset"],"$meta":{"preset":"example","scoped":true}},"isAnalytical":{"$eq":true,"$ne":true,"$in":[true],"$nin":[true],"$meta":{"preset":"example","scoped":true}},"isPostable":{"$eq":true,"$ne":true,"$in":[true],"$nin":[true],"$meta":{"preset":"example","scoped":true}},"isSettlementAccount":{"$eq":true,"$ne":true,"$in":[true],"$nin":[true],"$meta":{"preset":"example","scoped":true}},"active":{"$eq":true,"$ne":true,"$in":[true],"$nin":[true],"$meta":{"preset":"example","scoped":true}},"currency":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}},"subledgerEntryKind":{"$eq":"counterParty","$ne":"counterParty","$in":["counterParty"],"$nin":["counterParty"],"$meta":{"preset":"example","scoped":true}},"subledgerEntryId":{"$eq":"example","$ne":"example","$gt":"example","$gte":"example","$lt":"example","$lte":"example","$in":["example"],"$nin":["example"],"$exists":true,"$regex":"example","$meta":{"preset":"example","scoped":true}}},"sort":{"field":"number","dir":"asc"},"limit":100}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sancho-wms.pl/v1/ledgerAccounts.list \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "integrationId": 1, "fiscalYearId": 1, "cursor": "example", "q": "example", "filters": { "number": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "name": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "parentId": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "level": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "classification": { "$eq": "asset", "$ne": "asset", "$in": [ "asset" ], "$nin": [ "asset" ], "$meta": { "preset": "example", "scoped": true } }, "accountType": { "$eq": "asset", "$ne": "asset", "$in": [ "asset" ], "$nin": [ "asset" ], "$meta": { "preset": "example", "scoped": true } }, "isAnalytical": { "$eq": true, "$ne": true, "$in": [ true ], "$nin": [ true ], "$meta": { "preset": "example", "scoped": true } }, "isPostable": { "$eq": true, "$ne": true, "$in": [ true ], "$nin": [ true ], "$meta": { "preset": "example", "scoped": true } }, "isSettlementAccount": { "$eq": true, "$ne": true, "$in": [ true ], "$nin": [ true ], "$meta": { "preset": "example", "scoped": true } }, "active": { "$eq": true, "$ne": true, "$in": [ true ], "$nin": [ true ], "$meta": { "preset": "example", "scoped": true } }, "currency": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } }, "subledgerEntryKind": { "$eq": "counterParty", "$ne": "counterParty", "$in": [ "counterParty" ], "$nin": [ "counterParty" ], "$meta": { "preset": "example", "scoped": true } }, "subledgerEntryId": { "$eq": "example", "$ne": "example", "$gt": "example", "$gte": "example", "$lt": "example", "$lte": "example", "$in": [ "example" ], "$nin": [ "example" ], "$exists": true, "$regex": "example", "$meta": { "preset": "example", "scoped": true } } }, "sort": { "field": "number", "dir": "asc" }, "limit": 100 }'Reads one company’s chart of accounts for one fiscal year: integrationId names the company and fiscalYearId the year (ids from fiscalYears.list); a year the company does not have is 404. A ledger account’s id is per fiscal year, so map accounts by number. Send the response’s nextCursor back as cursor, with the same filters and sort, until no nextCursor comes back; the default order is by number. filters narrows by field with operators such as $eq and $in; number: { $regex: "^402-" } is the prefix filter, and isPostable: { $eq: true } keeps the accounts a journal entry line may book onto. q searches number and name and answers at most 200 ranked accounts, with no cursor. A company without double-entry books (bookkeeping kpir or ryczalt) has no chart and answers 422 with the reason notDoubleEntry.
Authorizations
Abschnitt betitelt „Authorizations“Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“object
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
object
object
object
object
object
object
object
object
object
object
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
object
object
$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.
object
object
Responses
Abschnitt betitelt „Responses“Successful response
object
object
Example
{ "items": [ { "classification": "asset", "subledgerKind": "counterParty", "subledgerEntry": { "kind": "counterParty" }, "integrationType": "comarch-optima", "accountType": "asset" } ]}Bad request
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "BAD_REQUEST", "message": "Bad request", "issues": []}Unauthorized
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNAUTHORIZED", "message": "Unauthorized", "issues": []}Payment required
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "PAYMENT_REQUIRED", "message": "Payment required", "issues": []}Forbidden
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "FORBIDDEN", "message": "Forbidden", "issues": []}Not found
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "NOT_FOUND", "message": "Not found", "issues": []}Unprocessable content
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "UNPROCESSABLE_CONTENT", "message": "Unprocessable content", "issues": []}Too many requests
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "TOO_MANY_REQUESTS", "message": "Too many requests", "issues": []}Internal server error
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "INTERNAL_SERVER_ERROR", "message": "Internal server error", "issues": []}Service unavailable
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "SERVICE_UNAVAILABLE", "message": "Service unavailable", "issues": []}