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 ...
    • 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 menu. 3. In the ...
    • Best Practices for Collecting Customer Information for e-Invoicing Compliance

      As you implement the e-Invoice Plugin for Zoho Books, it is essential to establish a streamlined process for collecting accurate information from your own customers, vendors, and freelancers. This ensures full compliance with Malaysia’s e-Invoicing ...
    • How to Submit an Invoice to LHDN

      Introduction Learn how to seamlessly submit your invoices to the LHDN MyInvois portal directly from Zoho Books. Ensure compliance with just a one-click. How to Submit an Invoice to LHDN Complete the invoice details and save the document. Ensure the ...
    • Step 2: Item Master Configuration

      Introduction Configure your Item Master in Zoho Books to align with e-Invoicing requirements. This ensures all product and service data is properly formatted for MyInvois submissions. Update Item Master Navigate to Items > Items, then create a new ...