Case · a Kip-Up product

The receipt leaves the system and the tax office accepts it

In Peru a sale is only complete once SUNAT, the tax office, accepts the receipt, and each receipt has three calendar days to get there. Kuantera builds the document, signs it and sends it, and it is written from scratch, with no middleman.

What it looks like

Fifteen seconds from an empty screen to a filed receipt: you pick the customer, add a line and submit, and the server signs and sends it. The status updates on its own.

An actual run against the tax office's test environment: receipt B001-16 goes out for S/ 36.00, sits «in the queue», and at the end SUNAT answers code 0, accepted. The system stores the official acknowledgement, the signed XML and the PDF.

How it works inside

A Peruvian electronic receipt is a UBL 2.1 XML with a digital signature inside it, wrapped in a ZIP and sent over SOAP. No third-party library does that here: it is written in the project, in packages/sunat, because that code decides whether the document is valid or gets rejected over one misplaced figure.

Each business issues under its own name. Every receipt is signed with the digital certificate and tax-office credentials of the business issuing it, never mine or the agency's, because for SUNAT the issuer is that business. Issuing on behalf of others with your own credentials would mean registering as an electronic service provider, which is a different business with a different liability.

Sending doesn't block the sale. The API accepts the receipt, numbers it and returns it right away; a separate worker delivers it to SUNAT and retries when the service is down, which happens more often than you'd expect. So the panel shows each receipt's actual state: queued, sent, accepted, observed or rejected.

Each company sees only its own data, and the database itself enforces that: the tables use row-level security and the role the API connects with cannot bypass it. If a query forgets to filter by company, it returns nothing instead of another company's rows.

What it is and what it isn't

It's tested against the tax office's test environment: invoices, receipts, credit and debit notes, withholding and service charge. What hasn't happened yet is issuing with a real taxpayer ID in production, and I won't call it finished until that happens.

One thing I learned while preparing this case: when plastic bags are involved, SUNAT rejects the document if the number of bags doesn't match the quantity on the line. I ran into it while issuing, and it's filed as a bug with its XML attached.

Do you issue tax receipts and fight your invoicing tool?

Systems that file receipts with the tax office themselves, without copying data into another screen and without depending on a third party for that step.

Let's talk →