Update a fixed asset
const url = 'https://api.sancho-wms.pl/v1/assets.update';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"integrationId":1,"kind":"fixedAsset","id":1,"expectedModifiedAt":"example","expectedSavedAt":"example","data":{"integrationType":"comarch-optima","inventoryNumber":"example","name":"example","description":"example","categoryId":1,"purchaseDate":"2026-04-15","value":1,"holder":{"employeeId":1,"name":"example","since":"2026-04-15"},"placeOfUse":{"name":"example","since":"2026-04-15"},"kind":"fixedAsset","kst":"example","inventoryBook":"example","commissioningDate":"2026-04-15","depreciationStartDate":"2026-04-15","depreciation":{"method":"none","rate":1,"coefficient":1},"taxDepreciation":{"method":"none","rate":1,"coefficient":1,"value":1,"startDate":"2026-04-15"}},"tags":[{"code":"example","type":"qr","identifier":"example","note":"example"}],"images":["example"]}'};
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/assets.update \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "integrationId": 1, "kind": "fixedAsset", "id": 1, "expectedModifiedAt": "example", "expectedSavedAt": "example", "data": { "integrationType": "comarch-optima", "inventoryNumber": "example", "name": "example", "description": "example", "categoryId": 1, "purchaseDate": "2026-04-15", "value": 1, "holder": { "employeeId": 1, "name": "example", "since": "2026-04-15" }, "placeOfUse": { "name": "example", "since": "2026-04-15" }, "kind": "fixedAsset", "kst": "example", "inventoryBook": "example", "commissioningDate": "2026-04-15", "depreciationStartDate": "2026-04-15", "depreciation": { "method": "none", "rate": 1, "coefficient": 1 }, "taxDepreciation": { "method": "none", "rate": 1, "coefficient": 1, "value": 1, "startDate": "2026-04-15" } }, "tags": [ { "code": "example", "type": "qr", "identifier": "example", "note": "example" } ], "images": [ "example" ] }'Saves the asset’s full image: data is the card, and tags and images replace Sancho’s tags and photos. Build data from /assets.get and change what you mean to; a DMS tool’s data is { "integrationType": "gascontrol-dms" }. The card goes to the ERP only when data differs from the card as read, so a tag or photo edit writes nothing there. A key with asset:annotate but not asset:update saves only the tags and images; its data is ignored. The integration must grant asset:update for every save, a tag or photo edit included. A null holder or place of use deletes the current period, as deleting the row on the card does in the ERP. Send the modifiedAt and snapshotSavedAt you read as expectedModifiedAt (null for a DMS tool) and expectedSavedAt; when either has moved, nothing is written and the answer is 409 documentConflict. Status and liquidation change only through /assets.dispose. images are /api/images/N paths kept from /assets.get or https:// URLs, and the whole request must stay under 64 KiB. A warning with stage assetExtras means the card was written but the tags and images were not.
Authorizations
Dział zatytułowany „Authorizations”Request Bodyrequired
Dział zatytułowany „Request Bodyrequired”object
object
object
object
object
object
Responses
Dział zatytułowany „Responses”Successful response
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "result": { "kind": "fixedAsset", "status": "inUse", "integrationType": "comarch-optima", "fixedAsset": { "depreciation": { "method": "none" }, "taxDepreciation": { "method": "none" } }, "tags": [ { "documentType": "goodsReceivedNote", "documentKind": "external", "assetKind": "fixedAsset", "type": "qr" } ], "customFieldsMeta": {} }, "warnings": [ { "stage": "placements" } ]}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": []}Conflict
The error information
object
The error message
The error code
An array of issues that were responsible for the error
object
Example
{ "code": "CONFLICT", "message": "Conflict", "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": []}