[ { "label": "Set order as paid when an order is delivered", "trigger_type": [ "order_updated" ], "object_type": "order", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "order.fulfillment_orders.fulfillments.shipment_status", "settings": { "multiple": "any", "operator": "any", "value": { "delivered": "delivered", "confirmed": 0, "in_transit": 0, "out_for_delivery": 0, "failure": 0 }, "condition_type": "AND" }, "weight": 999 }, "2": { "field": "order.financial_status", "settings": { "operator": "any", "value": { "pending": "pending", "authorized": 0, "partially_paid": 0, "paid": 0, "partially_refunded": 0, "refunded": 0, "voided": 0 }, "condition_type": "AND" }, "weight": 999 } }, "actions": { "2": { "type": "shopify_graphql_request", "settings": { "token_object_type": "order", "query_wrapper": { "query": "mutation orderMarkAsPaid($input: OrderMarkAsPaidInput!) {\r\n orderMarkAsPaid(input: $input) {\r\n order {\r\n id\r\n }\r\n userErrors {\r\n field\r\n message\r\n }\r\n }\r\n}\r\n" }, "label": "Mark order as paid", "query_type_mode_wrapper": { "query_type_mode": "graphql" }, "query_change_editor_wrapper": { "query_change_editor": "Use Twig Editor" }, "variables": "{\r\n \"input\": {\r\n \"id\": \"{{order.admin_graphql_api_id}}\"\r\n }\r\n}\r\n", "twig": "{{ response | debug }}", "wait": "0", "cw_timezone": "Europe\/Berlin", "custom_wait": "", "run_once": 0 }, "weight": 1009, "target_key": "order" } } } }, "shared_workflow_id": 296181 }, "description": "This automation waits for order updates, checking for when an order is marked as delivered. Once delivered, the workflow then marks the order as paid. This workflow is very helpful for merchants who process orders and only mark them as paid after delivery through a pay-on-delivery model." } ]