Zum Inhalt springen

List fixed assets

POST
/assets.list
curl --request POST \
--url https://api.sancho-wms.pl/v1/assets.list \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "cursor": "example", "filters": { "kind": { "$eq": "fixedAsset", "$ne": "fixedAsset", "$in": [ "fixedAsset" ], "$nin": [ "fixedAsset" ], "$meta": { "preset": "example", "scoped": true } }, "status": { "$eq": "inUse", "$ne": "inUse", "$in": [ "inUse" ], "$nin": [ "inUse" ], "$meta": { "preset": "example", "scoped": true } }, "category": { "$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 } }, "hasTags": { "$eq": true, "$ne": true, "$in": [ true ], "$nin": [ true ], "$meta": { "preset": "example", "scoped": true } }, "integrationId": { "$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": "name", "dir": "asc" }, "limit": 100, "q": "example" }'

Lists fixed assets, equipment and tools from the key’s integrations, as the ERP’s registers keep them, each with the number of Sancho tags paired to it (tagCount). Send the response’s nextCursor back as cursor, with the same q, filters and sort, until no nextCursor comes back; limit (default and maximum 100) applies to each integration, and an integration that failed to answer is named in failedIntegrationIds. q is a text search of at least two characters, matching among others the name, the inventory number and the serial number, and filters narrows by kind, status, category and integrationId ($eq or $in), and by hasTags ($eq): true for assets with a Sancho tag paired, false for those with none. value is the initial value, not the net book value. Address an asset by its integrationId, kind and id: each register numbers its entries apart.

Media typeapplication/json
object
cursor
string
filters
object
kind
object
$eq
string
Allowed values: fixedAsset equipment tool
$ne
string
Allowed values: fixedAsset equipment tool
$in
Array<string>
Allowed values: fixedAsset equipment tool
$nin
Array<string>
Allowed values: fixedAsset equipment tool
$meta
object
preset
string
scoped
boolean
status
object
$eq
string
Allowed values: inUse liquidated sold
$ne
string
Allowed values: inUse liquidated sold
$in
Array<string>
Allowed values: inUse liquidated sold
$nin
Array<string>
Allowed values: inUse liquidated sold
$meta
object
preset
string
scoped
boolean
category
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
hasTags
object
$eq
boolean
$ne
boolean
$in
Array<boolean>
$nin
Array<boolean>
$meta
object
preset
string
scoped
boolean
integrationId
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: name inventoryNumber purchaseDate
dir
required
string
Allowed values: asc desc
limit
integer
default: 100 > 0 <= 100
q
string
>= 2 characters

Successful response

Media typeapplication/json
AssetPage
object
items
required
Array<object>
AssetListItem
One of: discriminator: integrationType
ComarchOptimaAssetListItem
object
id
required
number
kind
required
string
Allowed values: fixedAsset equipment tool
integrationId
required
number
inventoryNumber
required
string
serialNumber
required
string | null
name
required
string
description
required
string
category
required
string
status
required
string
Allowed values: inUse liquidated sold
purchaseDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
value
required
number
quantity
required
number | null
unit
required
string | null
holder
required
Any of:
AssetHolder
object
id
required
number | string | null
name
required
string
since
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
placeOfUse
required
string | null
placeOfUseSince
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
liquidationDate
required
Any of:
string format: date
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$/
integrationType
required
string
Allowed value: comarch-optima
tagCount
required
number
nextCursor
string
failedIntegrationIds
required
Array<number>

Example

{
"items": [
{
"kind": "fixedAsset",
"status": "inUse",
"integrationType": "comarch-optima"
}
]
}

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": []
}