[ { "label": "Set inventory level at a location (Shopify API)", "trigger_type": [ "product_custom" ], "object_type": "product", "app_id": "triggers", "settings": { "condition_groups": { "1": { "conditions": [], "actions": { "3": { "type": "debug", "settings": { "wait": "0", "custom_wait": "", "action_label": "Debug location information (Needed in subworkflow configuration)", "title": "", "body": "{% for product_variant in product.variants %}\r\n______________________________________\r\nItem ID: {{ product_variant.inventory_item_id }}\r\n Product Title: {{ product.title }} - {{ product_variant.title }} \r\n Product URL: {{ product_variant.admin_url }}\r\n\r\n{% for location in shop.locations %}\r\n**************************************\r\n Location ID: {{ location.id }}\r\n Location Name: {{ location.name}} \r\n Quantity Available: {{ product.inventory_quantity_by_location[location.id] }}\r\n{% endfor %}\r\n{% endfor %}", "token_object_type": "product" }, "weight": 10, "target_key": "product" }, "2": { "type": "trigger_child_workflow", "settings": { "target_path": "product.variants", "exported_workflow": { "label": "Variant subworkflow", "trigger_type": [ "manual" ], "object_type": "product_variant", "app_id": "triggers", "settings": { "condition_groups": { "1": { "conditions": [], "actions": { "1": { "type": "shopify_api_request", "settings": { "wait": "0", "custom_wait": "", "label": "set inventory quantity", "method": "POST", "path": "inventory_levels\/set", "data": "{ \r\n \"location_id\": YOUR_LOCATION_ID (Run the debug logger in main workflow via Test Center),\r\n \"inventory_item_id\": {{ product_variant.inventory_item.id }},\r\n \"available\": 1\r\n}", "response_handle": "", "response_object_type": "", "parent_data": "", "workflow_actions": [], "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } } } } } }, "weight": 20, "target_key": "product" } } } }, "shared_workflow_id": 19727 } } ]