• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

  • Due to Holi celebrations, our team will have limited availability. While we’ll continue to monitor threads, responses may be slightly delayed.

Woocommerce tax_rate_id mapping to bookkeeping app

Your Workflow URL
https://connect.pabbly.com/v2/app/workflow/share/CkIDMQVSVDcCSAFrD2oMKwwYBQFQCVQ2AxoDEQEOXCRXGQN4URAAag9DVz0CTQNiVx5VP1UKDWkOGlVRB1FTIFxSCRsAA1MpVRhSKQxdCDsKVAMrBWQ#
Consent to Access & Modify
I authorize Pabbly Support to log in to my account and make changes to the specified workflow for troubleshooting.
Hi,

I have a WooCommerce shop and use Moneybird for bookkeeping. I use multiple steps to create a Moneybird invoice by mapping and transforming order fields. The invoice creation stops because I need to map the WooCommerce `tax_rate_id` to the Moneybird `tax_rate_id`.

How do I handle international VAT rates? And how do I map the `tax_rate` received by the WooCommerce connector to the Moneybird connector for use on the Moneybird invoice?

I can make a JSON GET request to the API gateway, but I still need to map those values to the WooCommerce values.

How do I do that?

If you make changes please tell me what you changed.
 

Preeti Paryani

Well-known member
Staff member
Hi @GuillaumeGroen,

To map the WooCommerce tax_rate_id with the Moneybird tax_rate_id, you can use the Lookup Table by Pabbly action before the Create Invoice (Moneybird) step.

Here’s how you can set it up:
  1. Add a Lookup Table by Pabbly action before the Moneybird – Create Invoice action.
  2. Set the Lookup Key as the tax_rate_id coming from WooCommerce.
  3. In the Lookup Table configuration (click the + icon to add entries):
    • Add the WooCommerce tax_rate_id as the Key
    • Add the corresponding Moneybird tax_rate_id as the Value

You can find the Moneybird tax_rate_id in the Moneybird action. Turn Map ON for the Tax Rate field to see the available tax IDs and use the appropriate one for each tax percentage.

Whenever a specific tax_rate_id comes from WooCommerce, the corresponding Moneybird tax_rate_id will be returned by the Lookup Table action. You can then map this returned value into the Create Invoice action in Moneybird.

Please try this approach and let us know if you face any issues.

Video reference:
 
Hi, thank you. But can I map the values?
I added the WooCommerce rate_id as a lookup key. And via a Moneybird custom API request, I request the BWT (VAT) classes. I can add them manually, but then I get a failed response. When I map them, I get a failed response aswell. What am I doing wrong? I followed the video guidance.

I added the lookup table in the workflow.
 

Preeti Paryani

Well-known member
Staff member
Hi @GuillaumeGroen,

The issue occurs because the WooCommerce tax_rate_id values are coming as comma-separated values, while the Lookup Table can process only one value at a time, which is why the lookup is failing.

To automate this, you would need to:

  1. Convert the comma-separated tax_rate_id values into an array (using a Text Formatter).
  2. Process them using a Loop/Iterator so each tax ID is checked individually in the Lookup Table.
  3. Collect the corresponding Moneybird tax_rate_id values and use them later in the Moneybird action.
Please note that this approach will make the workflow more complex and may require restructuring some steps. If your tax rates are fixed, a simpler option would be to manually maintain the tax ID mappings in Moneybird.

Let us know which approach you would prefer, and we will guide you accordingly.
 
Hi Preeti, Thank you for your email.

1. I did that with a data transformer.
2. i created the Iterator.
3. How should i do that? do i have to add another step to build a comma seperated line to add to the invoice creation? because i need per line-item the correct vat code.

Thank you,
 

ArshilAhmad

Well-known member
Staff member
The use case you are describing is not possible with the Iterator or Data Formatter steps.

You need to add code to your workflow that acts as a database of WooCommerce Tax Codes and their respective Moneybird Tax IDs. You can then directly map the comma-separated WooCommerce Tax Codes to the Python code, and it will return the corresponding comma-separated Moneybird Tax IDs. These can then be used in the 'Moneybird: Create Sales Invoice with Line Items' action step.

We have set up a sample Python code for you with two WooCommerce Tax Codes and their respective Moneybird Tax IDs. You can add more WooCommerce Tax Codes and their respective Moneybird Tax IDs to this code.
Python:
import json

# Tax Code -> Tax ID database
tax_db = {
    "NL-21% BTW-1": "177664333975652314",
    "NL-9% BTW-1": "242340906308469944"
}

def get_tax_ids(tax_codes):
    # Split input into list
    codes = [code.strip() for code in tax_codes.split(",")]
    
    # Fetch IDs
    tax_ids = [tax_db.get(code, "") for code in codes if code in tax_db]
    
    # Join into comma-separated string
    result = ",".join(tax_ids)
    
    # Return JSON
    return json.dumps({
        "Tax ID Moneybird": result
    })

# Example input
input_codes = "NL-21% BTW-1,NL-9% BTW-1"

# Output JSON
print(get_tax_ids(input_codes))

Thanks & Regards,
Arshil Ahmad
Customer Support Associate
🌐 Pabbly.com
👉Rate your support
 
Top