<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nasrun Nasution</title>
    <description>The latest articles on DEV Community by Nasrun Nasution (@nasrun_nasution).</description>
    <link>https://dev.to/nasrun_nasution</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4253972%2F2b7816cc-546a-41e2-a8d6-58b9b2ffa148.jpg</url>
      <title>DEV Community: Nasrun Nasution</title>
      <link>https://dev.to/nasrun_nasution</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nasrun_nasution"/>
    <language>en</language>
    <item>
      <title>How to log WooCommerce orders to Google Sheets without double counting (Make.com)</title>
      <dc:creator>Nasrun Nasution</dc:creator>
      <pubDate>Tue, 24 Nov 2026 23:19:50 +0000</pubDate>
      <link>https://dev.to/nasrun_nasution/how-to-log-woocommerce-orders-to-google-sheets-without-double-counting-makecom-57kj</link>
      <guid>https://dev.to/nasrun_nasution/how-to-log-woocommerce-orders-to-google-sheets-without-double-counting-makecom-57kj</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;If you run a small WooCommerce store, there is a good chance a Google Sheet somewhere tracks your stock. It starts simple: an order comes in, a row goes into the sheet, a formula subtracts the quantity.&lt;/p&gt;

&lt;p&gt;Then, a few weeks later, the sheet and the shelf disagree. The sheet says 12 black T-shirts in size M; the shelf has 10. Nobody can tell which order caused it, so someone does a manual count and overwrites the number. A month later it happens again.&lt;/p&gt;

&lt;p&gt;Most of these mismatches come from two mistakes, and both are easy to avoid once you know where they come from. This post shows how to build an order-to-sheet flow in Make.com that avoids them, step by step, using only free building blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two rules
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rule 1: only paid orders move stock.&lt;/strong&gt; WooCommerce creates an order the moment a customer reaches checkout, often with the status &lt;em&gt;pending payment&lt;/em&gt;. Many of those are never paid. If your automation fires on "new order", unpaid and abandoned orders reduce stock that never left the shelf. Trigger only on the statuses that mean money arrived: usually &lt;em&gt;processing&lt;/em&gt; (paid, not shipped yet) and &lt;em&gt;completed&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rule 2: each order is recorded exactly once.&lt;/strong&gt; The same order passes through several statuses: pending, processing, completed. If your scenario listens for order updates, it sees the same order two or three times. Webhooks can also be delivered twice, and Make can retry a run after a temporary error. Without a check, every one of those becomes another deduction.&lt;/p&gt;

&lt;p&gt;The fix for Rule 2 is an idempotency check: before writing anything, look up the order ID. If it is already in the sheet, stop. If it is not, write the rows. This one lookup removes the most common cause of double counting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building it in Make
&lt;/h2&gt;

&lt;p&gt;You need a WooCommerce store with REST API keys, a Google account and a free Make account.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Prepare the sheet.&lt;/strong&gt; Create two tabs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ledger&lt;/strong&gt;, one row per stock movement: &lt;code&gt;order_id&lt;/code&gt;, &lt;code&gt;sku&lt;/code&gt;, &lt;code&gt;quantity&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;logged_at&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inventory&lt;/strong&gt;, one row per product: &lt;code&gt;sku&lt;/code&gt;, &lt;code&gt;opening_stock&lt;/code&gt;, &lt;code&gt;current_stock&lt;/code&gt;. In &lt;code&gt;current_stock&lt;/code&gt; use a formula instead of typing numbers, for example &lt;code&gt;=B2-SUMIF(Ledger!B:B, A2, Ledger!C:C)&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The point of this design: you never overwrite a stock number. Every change is a ledger row, so when something looks wrong you can see exactly which order caused it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create a data store for processed orders.&lt;/strong&gt; In Make, go to Data stores and create one called &lt;code&gt;processed_orders&lt;/code&gt; with the order ID as the key. This is your memory of which orders are already recorded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Trigger on orders.&lt;/strong&gt; Start the scenario with the WooCommerce &lt;em&gt;Watch Orders&lt;/em&gt; module (or a custom webhook that WooCommerce calls on order updates).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Filter on paid statuses.&lt;/strong&gt; Add a filter after the trigger: status equals &lt;code&gt;processing&lt;/code&gt; OR status equals &lt;code&gt;completed&lt;/code&gt;. Everything else stops here. That is Rule 1.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Check whether the order is already recorded.&lt;/strong&gt; Add &lt;em&gt;Data store → Check the existence of a record&lt;/em&gt; with the order ID as the key, then a filter that continues only when the result is false. That is Rule 2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Split the order into line items.&lt;/strong&gt; Add an &lt;em&gt;Iterator&lt;/em&gt; over the order's &lt;code&gt;line_items&lt;/code&gt; array, so a three-product order becomes three bundles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Write one ledger row per item.&lt;/strong&gt; Add &lt;em&gt;Google Sheets → Add a Row&lt;/em&gt; to the Ledger tab and map the order ID, the item's SKU, quantity, the order status and the current time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Mark the order as recorded.&lt;/strong&gt; Add &lt;em&gt;Data store → Add/replace a record&lt;/em&gt; with the order ID as the key. Place it after the sheet module, so an order is only marked once its rows are actually written.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;9. Turn on sequential processing.&lt;/strong&gt; In the scenario settings, enable sequential processing so two webhooks for the same order are handled one after the other instead of at the same time.&lt;/p&gt;

&lt;p&gt;Run a test order, change its status from processing to completed, and check the Ledger: you should see the rows once, not twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Edge cases worth thinking about
&lt;/h2&gt;

&lt;p&gt;The simple version above fixes most problems. These are the places where it can still go wrong, and what to do about them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A run stops halfway through a multi-item order.&lt;/strong&gt; If the sheet module fails after writing two of three items, the order is never marked as recorded. When Make retries, all three items are written again and the first two are now doubled. A safer key is one per line item, for example &lt;code&gt;orderID-lineItemID&lt;/code&gt;, checked and marked inside the iterator instead of once per order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two deliveries arrive at the same second.&lt;/strong&gt; Without sequential processing, both runs can check the data store before either has written anything, and both continue. Keep sequential processing on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Refunds and cancellations.&lt;/strong&gt; Nothing here restores stock automatically, and that is deliberate: a refunded item may be damaged or never returned. Record returned stock as a new ledger row with a positive quantity once the item is actually back on the shelf. Never delete old rows; the history is what makes the sheet trustworthy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variations.&lt;/strong&gt; Size and colour variations need their own SKUs (for example &lt;code&gt;TEE-BLK-M&lt;/code&gt; and &lt;code&gt;TEE-BLK-L&lt;/code&gt;). WooCommerce puts the variation's SKU on the line item, so if variations share one SKU, your sheet cannot tell them apart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unknown SKUs.&lt;/strong&gt; If an order contains a SKU that is not in the Inventory tab, the &lt;code&gt;SUMIF&lt;/code&gt; formula silently ignores it. Add a check (a filter or a lookup against the Inventory tab) that sends you an email instead of writing a row nobody will ever count.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost.&lt;/strong&gt; Every module run uses Make credits, and the iterator multiplies them by the number of items. Check your Make plan before turning this on for a busy store.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;You do not need a complex inventory system to stop your stock sheet from drifting. Two rules carry most of the weight: only paid orders move stock, and each order is recorded exactly once. Build those into your automation and keep every change as a ledger row, and the next time the numbers disagree you will know which order to look at.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you would rather not build it yourself:&lt;/strong&gt; I packaged a tested version of this setup as the WooCommerce Stock Ledger Kit (full disclosure: I built it, with a lot of help from AI). It goes a bit further than the version above: it re-reads each order directly from WooCommerce before recording it, keeps one ledger row per line item, and sends unknown SKUs or insufficient stock to a Needs_Review tab with an email alert instead of changing stock silently. It comes with illustrated step-by-step guides in English and Indonesian, for Windows and Mac.&lt;/p&gt;

&lt;p&gt;To be clear about what it is not: it keeps a separate stock ledger in Google Sheets and does not change WooCommerce's own stock (it is not two-way sync). You need your own Make account, and one paid order uses about 10–11 Make credits.&lt;/p&gt;

&lt;p&gt;It is $19 on Gumroad, and the first 20 buyers get 30% off with LAUNCH30: &lt;a href="https://automateflowlabs.gumroad.com/l/woocommerce-stock-ledger-kit/LAUNCH30" rel="noopener noreferrer"&gt;https://automateflowlabs.gumroad.com/l/woocommerce-stock-ledger-kit/LAUNCH30&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Questions about the free version are welcome in the comments too. I am happy to help you get it working either way.&lt;/p&gt;

</description>
      <category>woocommerce</category>
      <category>googlesheets</category>
      <category>automation</category>
      <category>nocode</category>
    </item>
  </channel>
</rss>
