Przejdź do głównej zawartości

List ledger accounts

POST
/ledgerAccounts.list
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.

Media typeapplication/json
object
integrationId
required
number
fiscalYearId
required
Any of:
integer
> 0 <= 9007199254740991
cursor
string
q
string
>= 1 characters
filters
object
number
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
name
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
parentId
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
level
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
classification
object
$eq
string
Allowed values: asset liability equity revenue expense offBalance other
$ne
string
Allowed values: asset liability equity revenue expense offBalance other
$in
Array<string>
Allowed values: asset liability equity revenue expense offBalance other
$nin
Array<string>
Allowed values: asset liability equity revenue expense offBalance other
$meta
object
preset
string
scoped
boolean
accountType
object
$eq
string
Allowed values: asset liability assetLiability revenue cost offBalance revenueCost
$ne
string
Allowed values: asset liability assetLiability revenue cost offBalance revenueCost
$in
Array<string>
Allowed values: asset liability assetLiability revenue cost offBalance revenueCost
$nin
Array<string>
Allowed values: asset liability assetLiability revenue cost offBalance revenueCost
$meta
object
preset
string
scoped
boolean
isAnalytical
object
$eq
boolean
$ne
boolean
$in
Array<boolean>
$nin
Array<boolean>
$meta
object
preset
string
scoped
boolean
isPostable
object
$eq
boolean
$ne
boolean
$in
Array<boolean>
$nin
Array<boolean>
$meta
object
preset
string
scoped
boolean
isSettlementAccount
object
$eq
boolean
$ne
boolean
$in
Array<boolean>
$nin
Array<boolean>
$meta
object
preset
string
scoped
boolean
active
object
$eq
boolean
$ne
boolean
$in
Array<boolean>
$nin
Array<boolean>
$meta
object
preset
string
scoped
boolean
currency
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
subledgerEntryKind
object
$eq
string
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
$ne
string
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
$in
Array<string>
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
$nin
Array<string>
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
$meta
object
preset
string
scoped
boolean
subledgerEntryId
FieldCondition
object
$eq
FilterValue
string | number | boolean | null
$ne
FilterValue
string | number | boolean | null
$gt
FilterValue
string | number | boolean | null
$gte
FilterValue
string | number | boolean | null
$lt
FilterValue
string | number | boolean | null
$lte
FilterValue
string | number | boolean | null
$in
Array<string | number | boolean | null>
$nin
Array<string | number | boolean | null>
$exists
boolean
$regex

$regex takes literal text, optionally anchored with a leading ^ and a trailing $; escape any other regex character with a backslash. Matching ignores case.

string
$meta
object
preset
string
scoped
boolean
sort
object
field
required
string
Allowed values: number name
dir
required
string
Allowed values: asc desc
limit
integer
default: 100 > 0 <= 1000

Successful response

Media typeapplication/json
LedgerAccountPage
object
items
required
Array<object>
LedgerAccount
One of: discriminator: integrationType
ComarchOptimaLedgerAccount
object
id
required
number
fiscalYearId
required
number | null
parentId
required
number | null
number
required
string
name
required
string
level
required
number
classification
required
string
Allowed values: asset liability equity revenue expense offBalance other
isPostable
required
boolean
isSettlementAccount
required
boolean
active
required
boolean
currency
required
string
subledgerKind
required
Any of:
string
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
subledgerEntry
required
Any of:
object
kind
required
string
Allowed values: counterParty bank employee shareholder taxAuthority other fixedAsset product
id
required
number
integrationId
required
number
integrationType
required
string
Allowed value: comarch-optima
accountType
required
string
Allowed values: asset liability assetLiability revenue cost offBalance revenueCost
segment
required
string
isAnalytical
required
boolean
nextCursor
string

Example

{
"items": [
{
"classification": "asset",
"subledgerKind": "counterParty",
"subledgerEntry": {
"kind": "counterParty"
},
"integrationType": "comarch-optima",
"accountType": "asset"
}
]
}

Bad request

Media typeapplication/json
error.BAD_REQUEST

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "BAD_REQUEST",
"message": "Bad request",
"issues": []
}

Unauthorized

Media typeapplication/json
error.UNAUTHORIZED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNAUTHORIZED",
"message": "Unauthorized",
"issues": []
}

Payment required

Media typeapplication/json
error.PAYMENT_REQUIRED

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "PAYMENT_REQUIRED",
"message": "Payment required",
"issues": []
}

Forbidden

Media typeapplication/json
error.FORBIDDEN

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "FORBIDDEN",
"message": "Forbidden",
"issues": []
}

Not found

Media typeapplication/json
error.NOT_FOUND

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}

Unprocessable content

Media typeapplication/json
error.UNPROCESSABLE_CONTENT

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "UNPROCESSABLE_CONTENT",
"message": "Unprocessable content",
"issues": []
}

Too many requests

Media typeapplication/json
error.TOO_MANY_REQUESTS

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests",
"issues": []
}

Internal server error

Media typeapplication/json
error.INTERNAL_SERVER_ERROR

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}

Service unavailable

Media typeapplication/json
error.SERVICE_UNAVAILABLE

The error information

object
message
required

The error message

string
code
required

The error code

string
issues

An array of issues that were responsible for the error

Array<object>
object
message
required
string

Example

{
"code": "SERVICE_UNAVAILABLE",
"message": "Service unavailable",
"issues": []
}