updateSKUPattern
Requires permission products:product:update.
Updates a SKU pattern. Any brand or category it is changed to must belong to the organization. Needs the products update permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation UpdateSKUPattern($id: ID!, $updateSKUPatternInput: UpdateSKUPatternInput!) {
updateSKUPattern(id: $id, updateSKUPatternInput: $updateSKUPatternInput) {
id
name
createdAt
brandId
categoryId
deletedAt
brand {
id
code
name
createdAt
deletedAt
deletedBy
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateSKUPattern($id: ID!, $updateSKUPatternInput: UpdateSKUPatternInput!) {\n updateSKUPattern(id: $id, updateSKUPatternInput: $updateSKUPatternInput) {\n id\n name\n createdAt\n brandId\n categoryId\n deletedAt\n brand {\n id\n code\n name\n createdAt\n deletedAt\n deletedBy\n }\n }\n}",
"variables": {
"id": "id",
"updateSKUPatternInput": {}
}
}
EOF
Variables:
{
"id": "id",
"updateSKUPatternInput": {}
}
Response:
{
"data": {
"updateSKUPattern": {
"id": "id",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"brandId": "id",
"categoryId": "id",
"deletedAt": "2025-01-15T00:00:00Z",
"brand": {
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"deletedAt": "2025-01-15T00:00:00Z",
"deletedBy": "string"
}
}
}
}
updateSKUPattern(
id: ID!
updateSKUPatternInput: UpdateSKUPatternInput!
): SKUPattern!
Arguments
updateSKUPattern.id ● ID! non-null scalar
The ID of the SKU pattern.
updateSKUPattern.updateSKUPatternInput ● UpdateSKUPatternInput! non-null input
The fields to change.
Type
SKUPattern object
A rule that builds SKUs from placeholders such as brand, category and a running number.