Skip to content

Update a tag

POST
/tags.update
curl --request POST \
--url https://api.sancho-wms.pl/v1/tags.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "productId": 1, "productKey": "example", "documentType": "goodsReceivedNote", "documentId": 1, "documentKey": "example", "productBatchId": 1, "productBatchKey": "example", "documentLineIndex": 1, "documentKind": "external", "assetKind": "fixedAsset", "assetId": 1, "assetKey": "example", "id": 1, "integrationId": 1, "identifier": "example", "note": "example", "documentName": "example", "productName": "example", "assetName": "example" }'

Writes a tag’s whole writable state: read it with tags.get or tags.list, change what you need and send the whole object back, since every field is required. It may move the tag to another integration, product, document line, batch or asset. An asset is addressed by assetKind and assetId, set together, and assetKey is always null. assetName, like productName and documentName, is a display snapshot you supply: Sancho stores it as sent and does not look it up. code, type, the author and the timestamps are Sancho’s. Updating a retired tag (one with deletedAt set) restores it: send null for the links you are leaving, or it comes back with its old document line and asset. A key needs both the tag’s current integration and the one the update names. "" clears identifier and note.

Media typeapplication/json
object
productId
required
number | null
productKey
required
string | null
documentType
required
Any of:
string
Allowed values: goodsReceivedNote goodsIssuedNote transfer
documentId
required
number | null
documentKey
required
string | null
productBatchId
required
number | null
productBatchKey
required
string | null
documentLineIndex
required
Any of:
integer
<= 9007199254740991
documentKind
required
Any of:
string
Allowed values: external internal purchase sales transfer order
assetKind
required
Any of:
string
Allowed values: fixedAsset equipment tool
assetId
required
Any of:
integer
> 0 <= 9007199254740991
assetKey
required
null
id
required
integer
> 0 <= 9007199254740991
integrationId
required
integer
> 0 <= 9007199254740991
identifier
required
string
note
required
string
documentName
required
string | null
productName
required
string | null
assetName
required
string | null

Successful response

Media typeapplication/json
TagWriteResult
object
result
required
TagListItem
object
productId
required
number | null
productKey
required
string | null
documentType
required
Any of:
string
Allowed values: goodsReceivedNote goodsIssuedNote transfer
documentId
required
number | null
documentKey
required
string | null
productBatchId
required
number | null
productBatchKey
required
string | null
documentLineIndex
required
Any of:
integer
<= 9007199254740991
documentKind
required
Any of:
string
Allowed values: external internal purchase sales transfer order
assetKind
required
Any of:
string
Allowed values: fixedAsset equipment tool
assetId
required
number | null
assetKey
required
string | null
id
required
number
accountId
required
number
integrationId
required
number
userId
required
number
code
required
string
type
required
string
Allowed values: qr nfc
identifier
required
string
note
required
string
documentName
required
string | null
productName
required
string | null
assetName
required
string | null
createdAt
required
string format: date-time
/^(?:(?:\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])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
updatedAt
required
string format: date-time
/^(?:(?:\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])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
deletedAt
required
Any of:
string format: date-time
/^(?:(?:\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])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
user
required
object
id
required
number
name
required
string
avatar
required
string | null
warnings
required
Array<object>
WriteWarning
object
stage
required
string
Allowed values: placements documents tags participants images assetExtras
detail
required
string

Example

{
"result": {
"documentType": "goodsReceivedNote",
"documentKind": "external",
"assetKind": "fixedAsset",
"type": "qr"
},
"warnings": [
{
"stage": "placements"
}
]
}

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

Conflict

Media typeapplication/json
error.CONFLICT

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": "CONFLICT",
"message": "Conflict",
"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": []
}