facturama

Facturama Multiemisor PAC adapter.

Facturama seals and stamps from a JSON payload (CSD must already be uploaded). Pre-signed XML stamp is not supported by their public Multiemisor API.

Supported TipoDeComprobante: I, E, T, P (Pagos 2.0), N (Nómina 1.2).

Docs: https://apisandbox.facturama.mx/guias

satcfdi.pacs.facturama.cfdi_to_facturama_payload(cfdi: CFDI) dict[source]

Map a satcfdi CFDI (typically unsigned) to Facturama Multiemisor JSON.

class satcfdi.pacs.facturama.Facturama(username: str, password: str, environment=Environment.PRODUCTION)[source]

Bases: PAC

Facturama Multiemisor API adapter.

Facturama is a billing platform that seals+stamps via Multiemisor; CSD files must be uploaded first (see upload_csd()).

Documentation: https://apisandbox.facturama.mx/guias/api-multi/proceso-facturacion

RFC = None
property host: str
upload_csd(rfc: str, certificate: bytes, key: bytes, password: str | bytes) dict[source]

Upload issuer CSD required before Multiemisor issue().

delete_csd(rfc: str) None[source]
get_csd(rfc: str) dict[source]
list_cfdis(*, keyword: str | None = None, status: str = 'all') list[dict][source]

List Multiemisor CFDIs (optionally filtered by keyword / UUID).

find_id_by_uuid(uuid: str) str[source]

Resolve Facturama document Id from a stamped CFDI UUID.

issue(cfdi: CFDI, accept: Accept = <Accept.XML: 1>) Document[source]

Seal and stamp via Facturama Multiemisor.

The local CFDI does not need to be signed; Facturama seals with the uploaded CSD for the issuer RFC.

stamp(cfdi: CFDI, accept: Accept = <Accept.XML: 1>) Document[source]

Operation to request sealed CFDI be stamped by PAC :param accept: :param cfdi: :return: document_id and bytes of stamped xml

recover(document_id: str, accept: Accept = <Accept.XML: 1>) Document[source]
Parameters:
  • accept

  • document_id

Returns:

recover_by_uuid(uuid: str, accept: Accept = <Accept.XML: 1>) Document[source]
cancel(cfdi: CFDI, reason: CancelReason, substitution_id: str = None, signer: Signer = None, document_id: str = None) CancelationAcknowledgment[source]

Cancel a Multiemisor CFDI.

Resolves Facturama Id from document_id or from the CFDI UUID (Complemento.TimbreFiscalDigital.UUID) via find_id_by_uuid().