Skip to content

What your application does

AEAT’s rules apply to your whole invoicing system, which AEAT calls a SIF (sistema informático de facturación). The library is one part of it. Your system as a whole has to meet the rules, and its maker signs a statement saying it does (a declaración responsable).

  • Number invoices, and never reuse a number, even for a cancelled or test invoice.
  • Link each new record to the previous one, in one database transaction. See Linking records.
  • Save each record before you send it, and save AEAT’s reply and receipt as soon as they arrive.
  • Send each record when you issue the invoice, not in a batch at the end of the day.
  • Retry with the same record after a failure, and look records up when a result is unclear. See AEAT’s reply.

See Your invoicing system (SIF) for when you need more than one installation.

  • Give each installation its own NumeroInstalacion, and never reuse it for the same seller, even after reinstalling.
  • If you run a service for many businesses, set IndicadorMultiplesOT to "S" for a user who has more than one business set up, including inactive ones. Base it on that user, not on how many customers your service has.
  • Don’t create records for drafts or quotes. A draft becomes an invoice, with a record and a QR code, only when you issue it.
  • Don’t delete an issued invoice. Cancel it with a cancellation record.
  • Lay out the invoice, including the QR code. See QR codes.
  • Keep the invoices themselves, as your accounting rules require.
  • If you send on behalf of other businesses, hold their authorisation.
  • Let a tax inspector reach the tax data they need, without exposing anything else.
  • Decide whether AEAT’s rules apply to a business, or which tax codes fit a sale.
  • Support the no-send mode (NO VERI*FACTU), where your system keeps and signs the records itself instead of sending each one to AEAT. It doesn’t sign records or keep an event log.

Read the project’s provenance and disclaimer before relying on any example here as a complete design.