3 min read

Automating taxes in Mexico - part II

Part II - Diagnosing accounting and getting it done

The accounting market in Mexico is diverse, with over 12 million registered taxpayers across more than five different tax regimes. These regimes dictate the percentage of tax an entity or individual must pay and determine their accounting needs. Despite this diversity, many customers share similar requirements.

Most of our customers were “RESICO,” followed by “PFAE.” They share certain common characteristics in their behavior with taxes and invoicing. For instance, while they do not require frequent invoicing or specialized services, at least seven out of ten need to create an electronic invoice every month.

I chose RESICO as the first tax regime to automate, allowing us to streamline their processes and tailor our marketing efforts effectively.

Diagnosing the accounting process

I once read that deciding whether to stay or leave someone isn’t about weighing pros and cons, but about diagnosing the root cause of your discomfort—like a medical diagnosis. In a similar way, I approached the monthly accounting cycle, diagnosing why it’s so time-consuming, complex, and costly.

The monthly accounting process involves tasks like VAT and corporate tax declarations, third-party operation reports, payroll, and more. Some tasks are standard and mandatory, while others depend on the specific nature of the business.

The RESICO approach

For RESICO, you don’t need to provide a bank statement. Accounting is typically based on electronic invoices retrieved from the tax authority’s website.

The automation process

Although I hope to open-source our approach someday, here’s a brief overview of how we automated RESICO.

Within a month, our team’s hard work paid off. We established connections with the tax authority for every area we needed—whether fetching, updating, or even deleting data. It wasn’t the cleanest or most reliable method, but sometimes you have to get creative and build your own workaround when official channels are limited or nonexistent.

This approach worked wonders in automating the hardcore tasks of our operational teams. The world isn’t fully API-driven yet, so sometimes you need to adapt.

We used:

  • React for the front-end,
  • Node.js for the back-end,
  • AWS and a lot of their functions (e.g. step functions for orchestrating workflows, lambda, etc)
  • Datadog for monitoring and performance tracking

I also relied on no-code tools for operations:

  • Looker: To access and analyze data, giving us deep insights into how things were running and where we could optimize.
  • Make.com: Instrumental in running scenarios and automating complex workflows.
  • Retool: Served as our CRM, helping us manage customer relationships efficiently.

These tools upgraded our operations (Brenda was pretty happy about it), cutting the team lead’s workload by 50%. One big question was whether we would use AI or any LLMs in the process. We decided against it due to the highly sensitive nature of customer data. While I believe in the commitment of companies like OpenAI to data protection, LLMs didn’t offer a big enough advantage to justify the risk.

The results

We discovered that 50% of our new customers had experienced incorrect accounting in the past. By reprocessing their entire accounting data, we ensured accurate declarations for the current month. Now, their accounting is in good hands.

Customers can now see everything considered in their declarations in real-time. They can make decisions on what goes into their accounting, have full visibility into all their invoices, tax declarations, and current tax status.

www.guatson.com

Even better, we managed to keep our costs steady. Running a single declaration now costs 100 times less than paying an accountant. This was a big discovery, especially for customers who still prefer having a human handle their taxes.

As a business, Guatson can now scale from a team of two accountants to managing up to 1,500 customers. The error rate in declarations is close to 1%, thanks to real-time matching with information from the tax authority. Automation handles the bulk of the work, with potential mistakes flagged for review.

But let’s be clear: the journey isn’t over. I didn’t “automate accounting.” What we did was automate 80% of RESICO and, along the way, provided our customers with more value through new features. This is just square one. Imagine if all tax regimes were handled this way.

Who knows? Maybe the role of an accountant will evolve into something more specialized, like an auditor or tax specialist. In my view, that’s what real automation should aim for.