Sync canceled line items to Magento

Recipe ToolsWorkatoMarketingEcommerceSales Enablement

What it does

When a function call arrives, this automation retrieves the order from Magento by increment ID. It loops through shipments and items to identify canceled quantities, builds a list, and posts each canceled item back to Magento.

Who it's for

Operations teams who need canceled line items reflected in Magento without manual updates.

How teams use this

Keep Magento inventory accurate after cancellations

When orders are canceled in the source system, this automation syncs those canceled line items to Magento so inventory counts and order records match without manual reconciliation.

Automate partial order cancellations

If only some items in an order are canceled, this automation identifies and posts only those line items to Magento. Full and partial cancellations are handled the same way.

Add a notification when items are canceled

Include a Slack step after canceled items are posted so the team gets notified of which items were synced. Set a filter to only notify when the canceled quantity exceeds a threshold.

How it works

  1. Receive the function call. A function call arrives with order details in real time, starting this automation to process canceled items from the source system.
  2. Wait for the specified time. Pause for a configured duration to allow upstream systems to finish processing before retrieving the order from Magento.
  3. Retrieve the order by increment ID. Fetch the order from Magento using the increment ID so the automation can access shipments and line items for processing.
  4. Build and post canceled items. Loop through shipments and items, identify those with canceled quantities greater than zero, and post each canceled item back to Magento.