Automatically Create Zoho Books Invoices When WooCommerce Orders Are Completed

Automatically Create Zoho Books Invoices When WooCommerce Orders Are Completed

Overview

Automating invoice creation can streamline your sales and accounting processes. With Zoho Flow, you can set up a workflow that automatically creates a Zoho Books invoice when an order in WooCommerce is marked as "Completed." This guide walks you through the step-by-step process of configuring this integration, including handling tax, shipping, discounts, and custom fields.

Steps to Set Up the Integration

1. Configure the WooCommerce Trigger in Zoho Flow

  • In Zoho Flow, click Create Flow and provide a name (e.g., "WooCommerce to Zoho Books Invoice").

  • Choose WooCommerce as the trigger app and select Order Updated as the event.

  • Connect your WooCommerce account using REST API keys or OAuth credentials.

2. Filter Orders by "Completed" Status

  • Add a Decision block after the trigger.

  • Set the condition: Order Status equals "completed".

  • Proceed only with the "Yes" branch to continue the workflow.

3. Retrieve Detailed Order Data

  • Add Fetch Order (WooCommerce) action.

  • Map the Order ID from the trigger to fetch complete order details (line items, tax, shipping, custom fields).

  • If necessary, use a Webhook trigger or custom function to access custom order meta fields.

4. Check if Customer Exists in Zoho Books

  • Use Fetch Customer (Zoho Books) to search for an existing customer by email.

  • Add a Decision block:

    • If the customer does not exist, use Create Customer.

    • If the customer exists, you may optionally update them with Update Customer.

5. Create Invoice in Zoho Books

  • Add a Create Invoice action.

  • Map the required fields:

    • Customer ID from the previous step.

    • Invoice Date, Order Number, and any custom fields.

    • Line Items: If mapping multiple line items, use a custom function to construct the invoice using the Zoho Books API.

    • Alternatively, create a single-line invoice with a summary and include total tax, shipping, and discounts.

    • Tax: Map tax codes that match WooCommerce's settings.

    • Shipping Charges: Map from the WooCommerce shipping total.

    • Discount: Map the total discount as an amount.

6. Test and Activate the Flow

  • Use Test and Debug mode to simulate an order completion.

  • Review each step to ensure data is passed correctly.

  • Check the generated invoice in Zoho Books.

  • Once verified, activate the flow.

Best Practices and Tips

  • Use descriptive field mappings and variable names to keep your flow organized.

  • Always test with orders that include different combinations (e.g., with/without tax or discount).

  • Maintain a list of matching tax codes in both WooCommerce and Zoho Books.

  • Use custom functions for advanced handling like multi-line invoices.

  • Refer to Zoho Books API Documentation for custom function parameters.

Need Help?

If you need assistance with creating custom functions or troubleshooting your Zoho Flow setup, please contact our support team or visit Zoho Flow to know more. 

    • Related Articles

    • How to Issue e-Invoices from Zoho Books Using Bigin by Zoho CRM

      Overview This Article is aimed at Zoho Books clients who are using Bigin by Zoho CRM to streamline your sales and accounting processes. If this is the first time you're hearing about Bigin, welcome! With e-invoicing placing a higher demand on ...
    • Progress invoices

      Introduction Enable, create and use progress invoices in your company's workflow, ensuring all payments are catalogued and accounted for quickly and easily. Enable progress invoices <br> Navigate ...
    • Zoho Books' Payment Retention Feature: A Comprehensive Guide for Malaysia's Construction Industry

      Introduction In Malaysia's construction sector, it's customary for clients to withhold a portion of payment—known as payment retention—until project completion. This practice ensures quality assurance and contractual compliance. Zoho Books' Payment ...
    • How to Install the eInvoice Malaysia Zoho Books Plugin

      Installing the eInvoice Malaysia Zoho Books Plugin <br><br> Navigate to the eInvoice Malaysia for Zoho Books Plugin Merketplace page Select "buy" or "start free trial" Select "install" and "install extension" in the popup ...
    • How to Buy the eInvoice Malaysia Plugin for Zoho Books Plugin

      <br><text></text> 1. Sign in to your Zoho Books account. 2. Click on Settings in the top-right corner, then select Marketplace from the ...