A mock e-invoicing partner. It reads and writes UBL invoices and credit notes and holds them to their published rules, and it reads and writes the Peppol Invoice Response a buyer answers one with. Over HTTP it is a buyer that takes invoices in and answers them, and a supplier that sends them and takes the answers. One process is both, and two can be pointed at each other.
supplier ──Invoice (UBL)──▶ buyer held to 1,144 rules: valid, 201
◀──Response AP─── accepted
◀──Response PD─── paid
──BT-115 999.99──▶ buyer 422 BR-CO-16: the parts come to 1190.00
buyer ──Response UQ──▶ refused 409 OP-BR111-R004: nothing follows
a payment in full
Decimal made from the text as written, and making one from a float is a TypeError.not judged, not valid, while a rule that could apply to it is missing. Since 0.2.0 every rule that can apply to a document it takes is built, so the verdict waits for the day a specification publishes a rule before the mock has it.valid. A disagreement is a failure until the published rule shows the case to be wrong.409 and the rule. "force" sends it anyway, because a seller's system has to cope with a buyer who does, and the supplier takes such a response and ignores it, as the guide says it may.round nor half up. A rule that could not be computed has failed, as it would in a real validator.DOCTYPE, a specification it does not know: each is refused with a code and a sentence, not quietly held to the core alone.POST and the other party is a URL. Nothing happens with time, so each status after the first is asked for, and nothing is kept on disk.pip install mock-einvoice
mock-einvoice --port 8100
curl --data-binary @invoice.xml http://127.0.0.1:8100/invoices
Worked examples that use mock-einvoice: E-invoice.