ExCius (ExCius v0.3.2)

View Source

ExCius - A library for creating and parsing UBL 2.1 invoices compliant with Croatian e-Invoice (CIUS-2025) specification.

Summary

Functions

Extracts all attachments from the given UBL Invoice XML.

Extracts all attachments from the given UBL Invoice XML.

Checks if the given UBL Invoice XML is digitally signed.

Checks if the given UBL Invoice XML is digitally signed.

Functions

extract_attachments(xml)

Extracts all attachments from the given UBL Invoice XML.

Returns a list of attachment maps containing:

  • :id - The document reference ID
  • :type - Either :embedded or :external
  • :filename - The filename (for embedded attachments)
  • :mime_type - The MIME type (for embedded attachments)
  • :content - The decoded binary content (for embedded attachments)
  • :uri - The external URI (for external references)

Parameters

  • xml - UBL Invoice XML document as a string

Examples

iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> {:ok, attachments} = ExCius.extract_attachments(xml)
iex> length(attachments)
1

extract_attachments!(xml)

Extracts all attachments from the given UBL Invoice XML.

Returns a list of attachment maps. Raises on error.

Parameters

  • xml - UBL Invoice XML document as a string

Examples

iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> attachments = ExCius.extract_attachments!(xml)
iex> length(attachments)
1

generate_invoice(invoice_data)

info()

parse_invoice(xml)

round_trip_test(invoice_data)

signed!(xml)

Checks if the given UBL Invoice XML is digitally signed.

Returns true if signed, false otherwise. Raises on error.

Parameters

  • xml - UBL Invoice XML document as a string

Examples

iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> ExCius.signed!(xml)
true

signed?(xml)

Checks if the given UBL Invoice XML is digitally signed.

Returns {:ok, true} if the invoice contains a digital signature, {:ok, false} otherwise.

Parameters

  • xml - UBL Invoice XML document as a string

Examples

iex> xml = File.read!("priv/examples/signed_with_pdf.xml")
iex> ExCius.signed?(xml)
{:ok, true}

validate_invoice(invoice_data)

version()