tefacturo MCP by usefulapi

v1.3.0
io.usefulapi/tefacturo Checked 8 hours ago Published 12 days ago

Read SUNAT status, XML, PDF and CDR; emit invoices, receipts, notes and voids in tefacturo.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

tefacturo_get_status Get document status

Get the three states of one issued document: SUNAT answer (estadoSunat), declaration (estadoComprobante) and mail delivery (estadoEntrega), with the declaration text. Use it before a document is sent again. Read-only.

ParameterTypeDescription
numero *integerCorrelative number of the document.
serie *stringSeries of the document, for example FFA2. Invoices start with F, receipts with B.
tipoComprobante *stringDocument type: 01 invoice, 03 receipt (boleta), 07 credit note, 08 debit note.

tefacturo_get_xml Get document XML

Get the signed UBL XML of one issued document. The reply holds xmlFirma, the XML in base64, and hashCode (may be null). Read-only.

ParameterTypeDescription
numero *integerCorrelative number of the document.
serie *stringSeries of the document, for example FFA2. Invoices start with F, receipts with B.
tipoComprobante *stringDocument type: 01 invoice, 03 receipt (boleta), 07 credit note, 08 debit note.

tefacturo_get_pdf Get document PDF

Get the printed PDF of one issued document, as a base64 string (decode it to a .pdf file). Read-only.

ParameterTypeDescription
numero *integerCorrelative number of the document.
serie *stringSeries of the document, for example FFA2. Invoices start with F, receipts with B.
tipoComprobante *stringDocument type: 01 invoice, 03 receipt (boleta), 07 credit note, 08 debit note.

tefacturo_get_cdr Get SUNAT receipt (CDR)

Get the SUNAT receipt (CDR) of one document as a base64 ZIP that holds an XML answer from SUNAT. The CDR proves SUNAT accepted the document. Read-only.

ParameterTypeDescription
numero *integerCorrelative number of the document.
serie *stringSeries of the document, for example FFA2. Invoices start with F, receipts with B.
tipoComprobante *stringDocument type: 01 invoice, 03 receipt (boleta), 07 credit note, 08 debit note.

tefacturo_preview_document Preview a document

Render a PDF preview of a document from its JSON, without a number and without a SUNAT filing (the tool sets datosDocumento.numero to 0). Use it to check the layout before tefacturo_emit_invoice. Read-only. Returns base64Pdf.

ParameterTypeDescription
documentType *stringWhich document the preview shows.
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…

tefacturo_emit_invoice Emit an invoice (files with SUNAT)

SUNAT FILING, IRREVERSIBLE: files a new invoice (factura, type 01) with SUNAT for this login's RUC. The numero must be new: check the series with tefacturo_get_status first. Use tefacturo_preview_document to check the layout first. Use the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's RUC; the tool sets it and rejects another RUC.

ParameterTypeDescription
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…

tefacturo_emit_receipt Emit a receipt (files with SUNAT)

SUNAT FILING, IRREVERSIBLE: files a new receipt (boleta de venta, type 03) for a consumer with SUNAT, through the daily summary. The numero must be new: check the series with tefacturo_get_status first. Use the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's RUC; the tool sets it and rejects another RUC.

ParameterTypeDescription
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…

tefacturo_emit_credit_note Emit a credit note (files with SUNAT)

SUNAT FILING, IRREVERSIBLE: files a credit note (nota de crédito, type 07) that adjusts an earlier invoice or receipt. The payload must name the original document in comprobanteAjustado and a motivo. Use the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's RUC; the tool sets it and rejects another RUC.

ParameterTypeDescription
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…

tefacturo_emit_debit_note Emit a debit note (files with SUNAT)

SUNAT FILING, IRREVERSIBLE: files a debit note (nota de débito, type 08) that adds a charge to an earlier invoice or receipt. The payload must name the original document in comprobanteAjustado and a motivo. Use the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's RUC; the tool sets it and rejects another RUC.

ParameterTypeDescription
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…

tefacturo_void_documents Void documents (files with SUNAT)

SUNAT FILING, IRREVERSIBLE: sends a voiding summary (resumen de baja) that cancels issued invoices or receipts. The payload holds fechaGeneracion, fechaDocumentoBaja and resumenBajaItemList (serie, numero, tipoComprobante 01 or 03, motivo). SUNAT processes it later: check it with tefacturo_get_status. Use the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's RUC; the tool sets it and rejects another RUC.

ParameterTypeDescription
payload *objectUse the same JSON as the tefacturo docs for this document (close2u, datosDocumento, detalleDocumento, emisor, receptor, informacionAdicional). The emisor.numeroDocumentoIdentidad must be this login's…