This article explains how to build a Shopify Flow that detects the transaction error codes synced from KOMOJU to Shopify (PROCESSING_ERROR / CANCELLED_PAYMENT) and automatically cancels the affected orders.
Prerequisites
- Applicable payment methods: This applies to orders using "time-limited (deferred)" payment methods such as Konbini payments and bank transfers, which have expired due to a missed payment deadline. Credit card payments are not covered.
- Why both error codes are included:
PROCESSING_ERRORis the legacy code, andCANCELLED_PAYMENTis the current code. Both are included in the conditions so that the flow covers both past transactions (legacy code) and current transactions (new code). - About using Shopify Flow: Shopify Flow is a feature provided by Shopify. For questions about how to operate or the specifications of the Flow app itself, please contact Shopify. KOMOJU cannot provide full support for it.
Setup steps
1. Create a new workflow
In your Shopify admin, open "Flow" and click ≪Create workflow≫.
2. Set the trigger, conditions, and action
If an input field is displayed, enter the following. When configuring manually, set it up as shown below.
Trigger: Order transaction created Conditions: - orderTransaction.gateway INCLUDES "KOMOJU" - AND orderTransaction.errorCode EQUALS "PROCESSING_ERROR" - OR orderTransaction.errorCode EQUALS "CANCELLED_PAYMENT" Action: Cancel order Restock: ON Customer Notifications: ON Refund: ON Staff Memo: "Cancelled because KOMOJU payment was cancelled"
3. Preview the workflow
Once the workflow is created, click ≪Preview≫ in the panel on the right to review the configuration.
- Trigger: Order transaction created
- Conditions: "Order transaction gateway includes KOMOJU" + "Order transaction error code equals PROCESSING_ERROR" / "Order transaction error code equals CANCELLED_PAYMENT"
- Action: Cancel order
4. Adjust the Cancel order (cancellation) settings
Click ≪Cancel order≫ at the bottom of the workflow and adjust each of the following settings to suit your needs.
- Send a notification to the customer: Sets whether to send the customer a notification about the order cancellation.
- Refund: Sets whether to issue a [Refund] as part of Shopify's order processing.
- Restock items: Sets whether to perform [inventory adjustment (restocking)] as part of Shopify's order processing.
- Staff note: You can leave a note in the transaction's memo field indicating that automated processing was performed. Entering something like
Cancelled because KOMOJU payment was cancelledmakes order management easier later on.
5. Turn on the workflow
Click ≪Turn on workflow≫ at the top of the screen to activate the workflow.
Important notes
PROCESSING_ERROR or the new code CANCELLED_PAYMENT. Before turning it on, please carefully review the following.- Timing of activation: Only transactions created after activation are covered. Please confirm your intended start date in advance.
- Conflicts with existing Shopify Flows: Please check in advance that processing does not overlap or conflict with any workflows you have already built (such as those related to order cancellations or notifications).
Next steps
- In your Shopify admin under "Flow," confirm that this workflow is "on (enabled)."
- If you have questions about the behavior or detailed specifications of the Flow app itself, please contact Shopify.