updateProductDeliveryFlags
Requires permission products:product:update.
Changes a product's delivery flags and merges them into its metadata. A flag left out keeps its value, null clears it, and other metadata is kept. The change is audited. Needs the delivery partners plan feature and permission to update products.
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 UpdateProductDeliveryFlags($input: ProductDeliveryFlagsInput!, $productId: ID!) {
updateProductDeliveryFlags(input: $input, productId: $productId) {
categoryOwnPackaging
effectiveOwnPackaging
fragile
ownPackaging
productId
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation UpdateProductDeliveryFlags($input: ProductDeliveryFlagsInput!, $productId: ID!) {\n updateProductDeliveryFlags(input: $input, productId: $productId) {\n categoryOwnPackaging\n effectiveOwnPackaging\n fragile\n ownPackaging\n productId\n }\n}",
"variables": {
"input": {},
"productId": "id"
}
}
EOF
Variables:
{
"input": {},
"productId": "id"
}
Response:
{
"data": {
"updateProductDeliveryFlags": {
"categoryOwnPackaging": true,
"effectiveOwnPackaging": true,
"fragile": true,
"ownPackaging": true,
"productId": "id"
}
}
}
updateProductDeliveryFlags(
input: ProductDeliveryFlagsInput!
productId: ID!
): ProductDeliveryFlags!
Arguments
updateProductDeliveryFlags.input ● ProductDeliveryFlagsInput! non-null input
The flags to change: own packaging and fragile.
updateProductDeliveryFlags.productId ● ID! non-null scalar
The ID of the product.
Type
ProductDeliveryFlags object
A product's delivery flags (Product.metadata.deliveryFlags), for every variant: own packaging and fragile. Null = not set.