Ops · n8n

Auto-Unpublish Shopify Products When Zendrop Shows Out of Stock

Monitors Zendrop for out-of-stock products and automatically unpublishes the matching Shopify listings so customers never see unavailable items. Saves dropshippers from manual checks and lost customer trust.

difficulty Intermediatesetup 45 minresult Every time a product goes out of stock in Zendrop, the matching Shopify product is unpublished within minutes automatically.
  1. 1

    Schedule a regular inventory check

    Add a Schedule Trigger node. Set Trigger Interval to every 1 hour (or 30 minutes for faster response). This node starts the workflow on a timer so Zendrop inventory is checked automatically without manual action.

  2. 2

    Fetch out-of-stock products from Zendrop

    Add an HTTP Request node named Get Zendrop Inventory. Set Method to GET and URL to https://api.zendrop.com/v1/products?stock_status=out_of_stock. In the Headers section add Authorization with value Bearer YOUR_ZENDROP_API_KEY. This returns a list of products currently out of stock. Store your API key in n8n credentials and reference it here.

  3. 3

    Filter only truly out-of-stock items

    Add an IF node named Check Stock Status. Set the condition to: {{ $json.stock_status }} equals out_of_stock. Items passing the TRUE branch will proceed to be unpublished in Shopify. This guards against false positives from the API response.

  4. 4

    Map Zendrop SKU to Shopify product data

    Add a Set node named Prepare Shopify Payload. Create a field sku mapped to {{ $json.sku }} and a field product_id mapped to {{ $json.shopify_product_id }}. This organises the data needed for the Shopify API call. Note: you must store the Shopify product ID in Zendrop product metadata or a lookup sheet for this mapping to work.

  5. 5

    Unpublish the product in Shopify

    Add an HTTP Request node named Unpublish Shopify Product. Set Method to PUT and URL to https://YOUR-STORE.myshopify.com/admin/api/2024-01/products/{{ $json.product_id }}.json. Set Body Content Type to JSON and Body to {"product":{"id":"{{ $json.product_id }}","status":"draft"}}. In Headers add X-Shopify-Access-Token with your private app token. Setting status to draft effectively unpublishes the product from your storefront.

Frequently asked questions

What if my Zendrop products don't have a Shopify product ID field?

You will need to create a mapping table — a Google Sheet or Airtable base — that links Zendrop SKUs to Shopify product IDs. Add an extra HTTP Request or Google Sheets node between the IF node and the Set node to look up the Shopify ID by SKU before the unpublish step.

Will this permanently delete my Shopify product?

No. Setting the Shopify product status to `draft` simply hides it from your storefront without deleting any data. When the product comes back in stock in Zendrop, you can create a second workflow that sets the status back to `active` using the same approach.

How do I get my Zendrop API key?

Log in to your Zendrop account, go to Settings, then API Access. Generate a new API key there. Zendrop API access is available on their paid plans. Paste the key into the `Authorization` header of the HTTP Request node as shown in step 2.

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.