Real-world case · our own product

Sistemas MDQ: Argentine e-invoicing with ARCA, end to end

Sistemas MDQ is our electronic invoicing platform for Argentine businesses: it issues type A, B and C invoices, credit notes and debit notes through ARCA — Argentina's tax authority — with CAE authorization in seconds. We built it end to end and run it in production.

It's for businesses that invoice every day and want to do it without fighting ARCA — and for those who already run their own system and need the invoice to be issued from inside it, through an API.

Try the demo (in Spanish), no sign-up

Every visit gets its own fictitious company with a simulated ARCA: invoices have no tax validity and everything is deleted after 2 hours.

The problem

Invoicing shouldn't be the hard part

Issuing invoices through ARCA comes with unforgiving rules: the invoice type each customer requires, strictly sequential numbering per point of sale, the data each document type demands. One mistake at the wrong moment leaves a burned sequence number, or an invoice that has to be voided with a credit note.

And the invoice is only part of it: then there's stock to deduct, monthly recurring charges, the VAT ledger the accountant asks for, and invoices someone issued outside the system. Sistemas MDQ puts all of that in one place.

What it does

Everything that happens around an invoice

  • Type A, B and C documents

    Invoices, credit notes and debit notes with ARCA CAE authorization (WSFEv1), in pesos or in foreign currency with its exchange rate.

  • MiPyME credit invoices

    Issues ARCA's electronic MiPyME credit invoice (FCE) through the same flow as every other document.

  • Products, prices and stock

    Catalog with price lists. Stock is deducted when the invoice is issued, with alerts when a product drops below its minimum.

  • Customers from the ARCA registry

    Enter the tax ID and the customer's details are filled in from ARCA's taxpayer registry.

  • Ready-to-send PDF

    PDF invoice with the ARCA QR code and the VAT breakdown required by Argentina’s fiscal transparency law (Ley 27.743).

  • Digital VAT ledger

    Exports the digital VAT ledger (RG 4597) in ARCA's format, plus the sales VAT ledger as PDF and Excel for the accountant.

  • Scheduled invoices

    Recurring invoices — weekly, biweekly, monthly or on a custom schedule — emailed from the company's own mailbox, with a history of every send.

  • Users, companies and points of sale

    Admin, operator and read-only roles; multiple companies and multiple points of sale. It works from a phone, too.

  • History and outside invoices

    Imports past invoices and recovers the ones issued outside the system, through a nightly reconciliation against ARCA.

  • REST API

    Your ERP issues the invoice through the API with its own key (X-Api-Key) and gets the CAE back.

The detail that matters

No burned numbers, no error 10016

In ARCA every invoice must be exactly the next number for its point of sale and type. If a request goes out with invalid data, or gets cut off halfway and is blindly retried, you end up with a burned number or rejection 10016: the number is not the next one to authorize.

Sistemas MDQ validates everything before requesting the number, and every issuance is idempotent: if the connection drops and the request is repeated, nothing is issued twice. And if ARCA authorized something that never got saved, the nightly reconciliation recovers it.

The system

What it looks like inside

The everyday panel: issue, look up and export invoices, manage customers, products and stock, and schedule the invoices that repeat. The interface is in Spanish.

Sistemas MDQ home with total invoiced, number of invoices, ARCA status and the latest invoices
Home: total invoiced, invoices issued, ARCA connection status and the latest documents.
Invoice list with the VAT ledger export as PDF, Excel and ARCA TXT, filters and the CAE of each invoice
Invoices with their CAE and the period export: VAT ledger as PDF and Excel, ARCA's digital ledger TXT and a report.
Last step of issuing an invoice with three products, net amount, VAT and total
Issuing in four steps: type, customer, items and a summary with net, VAT and total before requesting the CAE.
Detail of an approved type A invoice with CAE, CAE expiry date, items and totals
Each invoice in detail: CAE and its expiry, items, totals and the PDF to download.
Customer list with tax ID, company name, VAT status and address
Customers with their tax ID and VAT status, which determines whether a type A or B invoice applies.
Product list with code, price, VAT rate, stock, minimum stock and location, with two products below minimum in red
Products with price, VAT rate, minimum stock and location: anything below minimum shows in red.
Stock screen with inbound, outbound and adjustments per product, and the movements tab
Stock with inbound, outbound and adjustments, plus the full movement history.
Weekly, biweekly and monthly scheduled invoices with their next issue date and status
Scheduled invoices: frequency, next issue date, pause, and the history of sends.

Screenshots come from the demo’s fictitious company with a simulated ARCA: no data belongs to real customers and the invoices have no tax validity.

How it's built

Engineering for a system that talks to the tax authority

  • One certificate per company, encrypted.

    Each company issues with its own ARCA certificate. The private key is stored encrypted with AES-256-GCM — never in plain text in the database.

  • Idempotent issuance.

    Every issuance request carries its own key: a retry after a dropped connection returns the same invoice instead of issuing another one.

  • Nightly reconciliation against ARCA.

    Every night it compares what was issued with what ARCA has on record and recovers what's missing: invoices issued elsewhere, or a CAE that never got saved.

  • Built to integrate.

    The same issuance the screens use is available through a REST API: another system invoices with its own key and gets the authorized document back.

What it's built with

Node.js with Express and TypeScript on the backend, MySQL with Prisma, and React with Vite, Tailwind and shadcn/ui on the frontend. The ARCA integration is direct SOAP against WSAA and WSFEv1, and PDFs are generated with PDFKit.

  • Node.js
  • Express
  • TypeScript
  • Prisma
  • MySQL
  • React
  • Vite
  • Tailwind
  • shadcn/ui
  • ARCA WSAA + WSFEv1
  • PDFKit