updateCategoryDeliveryDefaults
Requires permission categories:category:update.
Replaces a category's delivery defaults and keeps the category's other metadata. Needs the delivery partners plan feature and permission to update categories.
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 UpdateCategoryDeliveryDefaults($categoryId: ID!, $input: CategoryDeliveryDefaultsInput!) {
updateCategoryDeliveryDefaults(categoryId: $categoryId, input: $input) {
categoryName
inheritedFromCategoryName
categoryId
effective {
heightCm
lengthCm
ownPackaging
weightKg
widthCm
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateCategoryDeliveryDefaults($categoryId: ID!, $input: CategoryDeliveryDefaultsInput!) {\n updateCategoryDeliveryDefaults(categoryId: $categoryId, input: $input) {\n categoryName\n inheritedFromCategoryName\n categoryId\n effective {\n heightCm\n lengthCm\n ownPackaging\n weightKg\n widthCm\n }\n }\n}",
"variables": {
"categoryId": "id",
"input": {}
}
}
EOF
Variables:
{
"categoryId": "id",
"input": {}
}
Response:
{
"data": {
"updateCategoryDeliveryDefaults": {
"categoryName": "string",
"inheritedFromCategoryName": "string",
"categoryId": "id",
"effective": {
"heightCm": 0,
"lengthCm": 0,
"ownPackaging": true,
"weightKg": 0,
"widthCm": 0
}
}
}
}
updateCategoryDeliveryDefaults(
categoryId: ID!
input: CategoryDeliveryDefaultsInput!
): CategoryDeliveryDefaults!
Arguments
updateCategoryDeliveryDefaults.categoryId ● ID! non-null scalar
The ID of the category.
updateCategoryDeliveryDefaults.input ● CategoryDeliveryDefaultsInput! non-null input
The delivery defaults to save for the category.
Type
CategoryDeliveryDefaults object
A category's delivery defaults: its own values and what applies to its items (inherited from parents).