Falsehoods programmers believe about invoices

Nineteen assumptions about invoices that tax authorities in Mexico, Spain, Chile, Argentina, Brazil and France proved wrong while we built Cord.

Cord takes a sale from quote to payment to invoice in 12 countries. When we started, we expected payments to be the hard part. It was invoices. Each item below is an assumption our code made until a country’s rules proved otherwise.

The document

  1. An invoice is a PDF. In Mexico the invoice is an XML file, signed by the seller and stamped by a certifier that the tax authority (the SAT) authorized. The PDF is a printed representation with no legal weight of its own.
  2. An invoice exists once you save it. In Mexico, Argentina, Chile, Peru, Colombia and Brazil, it exists when the tax authority, or someone it authorized, accepts it. Until then you have a draft.
  3. A country has one kind of invoice. Brazil has one system for goods (the NF-e, authorized by each state) and another for services (the NFS-e), and the city sets the tax rate on a service. Argentina has invoice classes A, B and C, chosen from the VAT status of both the seller and the buyer.
  4. The invoice date is the only date that matters. In Germany the date of service is mandatory. If it’s the same as the invoice date, the invoice has to say so.
  5. You always know who the customer is. Spain and Argentina allow invoices to an unidentified consumer. Argentina, only below a set amount.

Numbers

  1. You pick your own invoice numbers. In Chile you download a signed file from the tax authority with the range of numbers you’re allowed to use. The range expires, and a number you used never comes back, even if that invoice was rejected.
  2. An invoice number is unique per account. It’s unique per tax ID and series. Two accounts with the same tax ID can’t share a series, or the authority sees one invoice where you have two.
  3. max(number) + 1 is fine. Not when two requests issue at once. We use a lease per sequence plus a unique index, because our Postgres driver talks over HTTP and can’t hold an advisory lock from one statement to the next.

Money

  1. The tax is the sum of the line taxes. Chile calculates VAT on the invoice’s net total. While we rounded per line, invoices in pesos often didn’t match: in a test with random amounts, 26% of two-line invoices and 47% of five-line ones.
  2. Every currency has cents. Amounts on a Chilean tax document are whole pesos. The yen has no minor unit, and the Kuwaiti dinar has three decimals. Math.round(amount * 100) charges a customer in Japan 100 times the price.
  3. A country has one sales tax. Quebec charges its 9.975% QST on top of the 5% federal GST. Spain charges IVA, except in the Canary Islands (IGIC) and in Ceuta and Melilla (IPSI). The US has no national rate: in Los Angeles the state rate is 7.25%, and the real one, with county, city and special districts, is about 9.5%.
  4. The exchange rate is whatever the ECB says. The European Central Bank doesn’t publish the Colombian, Chilean or Argentine peso, or the Peruvian sol. When no source has a rate, we stop and say so, because a guessed rate ends up on a legal document.

Changing your mind

  1. You can edit an invoice after you issue it. Under Spain’s Verifactu, every invoice record carries the SHA-256 hash of the previous one. A correction is a new record that points at the old one. We enforce it in Postgres with a trigger that blocks UPDATE and DELETE on signed records, so not even our own code can rewrite the chain.
  2. You can cancel an invoice. In Argentina, an invoice the authority approved can’t be voided: you issue a credit note. In Mexico, cancelling has a legal deadline and often needs the customer to accept it.
  3. Paid means done. In Mexico, if you invoiced before you got paid, every payment needs its own electronic receipt, due by the 5th of the following month. Under France’s reform, for services where VAT is due on payment, the payment itself gets reported.

Talking to the tax authority

  1. If the request timed out, send it again. A retry can create a second legal invoice. When we don’t get an answer, we never resend. We ask the authority what it has (in Argentina: the last number it authorized, then that invoice) and decide from there.
  2. The tax authority answers right away. Spain’s AEAT tells you how long to wait before your next submission. We chain the record when the invoice is issued and send it later from a queue, so their downtime never stops anyone from invoicing.
  3. If a batch is rejected, every invoice in it is wrong. It may be a single record. We split the batch in half until we isolate it.
  4. E-invoicing mandates are a Latin American thing. Since September 1, 2026, every company established in France has to be able to receive electronic invoices through an approved platform, and small companies start sending them in September 2027. Spain’s Verifactu was due in 2027; in October 2026 the government announced October 2028 instead, its fourth delay.

Why it matters

None of this is exotic. It is what invoicing looks like from the inside in any country that wants to see your invoices, and that list keeps growing.

Cord handles it so a business doesn’t have to: a quote the client approves and pays from one link, then the invoice in one click. Mexico’s CFDI is live, Spain’s Verifactu is in beta, and the other Latin American integrations are built but not live yet.

END OF ARTICLE

From proposal to payment. All in a single link.

Send a quote your client approves and pays from one link, with no account to create, then invoice it in one click. In 12 countries, with a free plan and no credit card.