Ops · n8n

Automatically Cancel Zendrop Orders When WooCommerce Orders Are Cancelled

When a customer cancels an order in WooCommerce, this workflow instantly finds the matching Zendrop order and cancels it — preventing unnecessary fulfillment and supplier charges. No more manually hunting down orders across two platforms.

difficulty Intermediatesetup 45 minresult Every WooCommerce cancellation automatically triggers a Zendrop order cancellation, saving your ops team time and avoiding wasted fulfillment costs.
  1. 1

    Trigger on WooCommerce Order Cancellation

    Add a WooCommerce Trigger node. Set the Event field to Order Updated. In your WooCommerce admin, make sure webhooks are enabled. The node will fire every time any order is updated — the next step filters for cancellations only. Copy the webhook URL from this node and paste it into WooCommerce under Settings > Advanced > Webhooks.

  2. 2

    Filter for Cancelled Status Only

    Add an IF node connected to the trigger. Set Condition 1 to: {{$json["status"]}} equals the string cancelled. If the condition is TRUE the workflow continues; if FALSE it stops here. This ensures only genuine cancellations pass through.

  3. 3

    Extract the Zendrop Order ID

    Add a Set node on the TRUE branch of the IF node. Create a new field called zendropOrderId and set its value to {{$json["meta_data"].find(m => m.key === "_zendrop_order_id")?.value}}. This reads the Zendrop order ID that Zendrop stores as order meta when it originally created the fulfilment. Adjust the meta key name if your store uses a different one.

  4. 4

    Cancel the Order in Zendrop

    Add an HTTP Request node. Set Method to POST and URL to https://api.zendrop.com/api/v1/orders/{{$json["zendropOrderId"]}}/cancel. Under Authentication choose Header Auth and add a header named Authorization with value Bearer YOUR_ZENDROP_API_KEY. Set Content-Type header to application/json. Send an empty JSON body {}. Store your Zendrop API key safely in n8n Credentials rather than hardcoding it.

  5. 5

    Log the Result to Google Sheets (Optional Audit Trail)

    Add a Google Sheets node connected after the HTTP Request. Use the Append Row operation to log columns: wooOrderId = {{$node["WooCommerce Trigger"].json["id"]}}, zendropOrderId = {{$node["Set"].json["zendropOrderId"]}}, cancelledAt = {{$now}}, and status = {{$json["status"]}}. Connect your Google account credential in the node settings and point it to your audit spreadsheet.

Frequently asked questions

What if the WooCommerce order doesn't have a Zendrop order ID stored in meta?

The `Set` node expression will return undefined, and the HTTP Request will fail with an invalid URL. To handle this gracefully, add a second IF node after the Set node that checks whether `zendropOrderId` is not empty before calling the Zendrop API. Orders placed before Zendrop was connected to your store won't have this meta field.

Where do I find my Zendrop API key?

Log in to your Zendrop account, go to Settings > Integrations or Account > API, and generate or copy your API key. Paste it into an n8n Header Auth credential so it is stored securely and never exposed in plain text inside the workflow.

Will this cancel a Zendrop order that has already shipped?

Zendrop's API will return an error if the order has already been dispatched and cannot be cancelled. You can handle this by adding an IF node after the HTTP Request that checks the response status code — if it is not 200, write the failed attempt to your audit sheet or send an alert so your team can handle it manually.

About this recipe. Recipes on FlowRecipesHub are written for business owners, not developers, and are tested before publishing — how recipes get made. Some ingredient links are affiliate links that cost you nothing — full disclosure.