e-invoicing

Mapping

Mapping converts XML documents from one format to another using the Transform endpoint, allowing documents to be mapped to the required format before compliance processing.

The Transform operation converts one or more XML or XHTML input documents to a different output format. The particular transformation to apply is identified by name, and the name also determines the required input format. The result is always a single output document. Multiple input documents can be provided when the target format requires data that is not available in a single source document.

Sovos sets up the transformations available to your configuration and they depend on your contract. Contact Sovos Support to confirm which transformation names are active for your implementation. For the integration steps, see Transform a document through the API.

Supported transformations

Country Transform name Purpose
Italy PDF_fatturapa_v1.2 Converts a FatturaPA B2G document to PDF
PDF_fatturaordinaria_v1.2 Converts a Fattura Ordinaria document to PDF
ITRC_to_PDF Converts a Ricevuta di Consegna document to PDF
cXML_to_FatturaPA_005 Converts a cXML document to the FatturaPA format
FatturaPA_to_cXML_005 Converts a FatturaPA document to cXML
India SCI_to_GST Converts the Sovos Canonical Invoice (SCI) format to the JSON structure required for clearance in India
Germany xRechnungPortrait Converts the xRechnung format to a portrait PDF
xRechnungLandscape Converts the xRechnung format to a landscape PDF
N/A cXML_to_SCI Converts a cXML document to the Sovos Canonical Invoice (SCI) format
XHTML_to_PDF_PORTRAIT Converts any XHTML document to a portrait PDF

Transform a document through the API

Before transforming a document:

The Transform operation converts one or more XML documents to a different format. The transformation to apply is identified by name and also determines the required input format. The result is always a single output document. Multiple input documents can be provided when the target format requires data that is not available in a single source document.

  1. Build the Transform request with the transformation name and the input document or documents.

    Request type tas:TransformRequest extends tac:TrustArchiveRequest.

    Element Type Cardinality Description
    Transform xs:string 1 The name of the transformation to apply. See Supported transformations.
    InputDocuments tas:InputDocuments 1 The input document or documents to transform. Each document is provided as a Base64-encoded string.

    Example request:

    CODE
    <Transform
      xmlns="http://www.trustweaver.com/trustarchive/storage/v1">
      <Request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <TransactionId
          xmlns="http://www.trustweaver.com/trustarchive/common/v1"
          >3311b...</TransactionId>
        <Transform>DEFAULT</Transform>
        <InputDocuments>
          <InputDocument>ABCD1234</InputDocument>
        </InputDocuments>
      </Request>
    </Transform>
  2. Send the request to the storage service endpoint using HTTPS with client certificate authentication.
  3. Retrieve the transformed document from the TransformResponse.

    Result type: tas:TransformResult.

    Element Type Description
    OutputDocument xs:base64Binary The transformed document, encoded in Base64

    Example response:

    CODE
    <TransformResponse
      xmlns="http://www.trustweaver.com/trustarchive/storage/v1">
      <Result xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <OutputDocument>ABCD1234</OutputDocument>
      </Result>
    </TransformResponse>

The document has been transformed. The OutputDocument element contains the result as a Base64-encoded string.

For error codes returned by this operation, see Storage service error codes.