Data Archives

This article provides information needed to understand how NP Retail exports to .xml archives, how these .xml archives must be secured, and how you can validate that they have not been tampered with.

Period Archives

You must periodically monitor closed monthly periods on the Workshift Summary page and export these to an archive file stored on a secure media i.e. usb keys in a safe. You create archives by using the archive button on Workshift Summary list. Note that Business Central SaaS already has multiple levels of database backup on the data as it’s all stored inside the ERP platform maintained by Microsoft. This includes geo-redundant backups. For more information, see their docs

Archive Validation

To ensure integrity of exported archives, all .xml archives are signed with the same certificate as all POS event signings.

The XMLDSIG canonicalization method is XML-C14N 1.0, and the signing is done via RSA & SHA256 as all the other POS event signings. If you reach out to NaviPartner we can supply you with a .cer certificate file that includes the public key of the cert used by a specific customer. NaviPartner also provides a powershell script that can be downloaded from and executed to validate both the schema of the XML file and the signature validity: Archive Validation Script.

The script depends on powershell core which can be downloaded and installed from the following link

The script must be placed inside a folder together with the 3 files needed for verification:

  • archive.xml
  • schema.xsd
  • certificate.cer

The schema file that archives adhere to can be downloaded at Archive Schema.

The 3 files must be named exactly like above. See image for example.

Script Execution

Archive Structure

The overall structure of the archive is as follows:

<Archive>
    <GrandPeriod>
        <ArchiveSignature/>
        <SystemEntryNo/>
        <SequentialID/>
        <FromDate/>
        <ToDate/>
        <GrandTotal/>
        <PerpetualAbsoluteGrandTotal/>
        <PerpetualGrandTotal/>
        <PeriodGrandTotalSignature/>

        <Tickets/>        

        <Duplicates/>        

        <GrandTotals/>        

        <JET/>        
    </GrandPeriod>

    <Signature/>    
</Archive>

The first segment is a header for the monthly grand period that is archived, followed by lists of all the events signed in that period. After the GrandPeriod element there is a Signature element that contains the XML signature for the file, making it tamper-proof.

See the schema file linked above for an in-depth overview of all XML elements in each of the 4 event type sections (tickets, duplicates, grandtotals, and JET).

XML Tags

List of archive tags, with french name and description

TagFrench Name
ArchiveArchive
GrandPeriodPériode majeure
ArchiveSignatureSignature d’archive
SystemEntryNoNuméro d’entrée système
SequentialIDID séquentiel
FromDateDe la date
ToDateÀ la date
GrandTotalTotal général
PerpetualAbsoluteGrandTotalTotal absolu perpétuel
PerpetualGrandTotalTotal perpétuel
PeriodGrandTotalSignatureSignature du total de la période
TicketsBillets
TicketBillet
DocumentTypeType de document
TicketSignatureSignature du billet
SalesLineLigne de vente
TaxLineLigne de taxe
PaymentLineLigne de paiement
TypeType
ExchangeRateTaux de change
IssuedGenericVoucherBons génériques émis
AppliedGenericVoucherBons génériques appliqués
IssuedCouponCoupons émis
AppliedCouponCoupons appliqués
RelatedInfoInformations connexes
DuplicatesDuplicatas
DuplicateDuplicata
IDID
FiscalDocumentNumberNuméro de document fiscal
ReprintNumberNuméro de réimpression
DuplicateSignatureSignature du duplicata
RelatedInfoInformations connexes
GrandTotalsTotals généraux
GrandTotalTotal général
PerpetualAbsoluteGrandTotalTotal absolu perpétuel
PerpetualGrandTotalTotal perpétuel
GrandTotalSignatureSignature du total général
JETJET
JETEntryEntrée JET
JETSignatureSignature JET
SystemEntryKeyClé d’entrée système
DocumentNumberNuméro de document
NoOfPrintsNombre d’impressions
SalespersonCodeCode du vendeur
POSCodeCode POS
DateDate
TimeHeure
OperationTypeType d’opération
NoOfSalesLinesNombre de lignes de vente
TotalInclTaxTotal TTC
TotalExclTaxTotal HT
LineNoNuméro de ligne
ProductCodeCode de produit
ProductLabelLibellé du produit
QuantityQuantité
TaxIdentifierIdentifiant de taxe
TaxRateTaux de taxe
UnitPriceInclTaxPrix unitaire TTC
DiscountCodeCode de réduction
DiscountPercentagePourcentage de réduction
DiscountAmountMontant de réduction
TotalExclTaxTotal HT
TotalInclTaxTotal TTC
BaseQuantityQuantité de base
UnitOfMeasureCodeCode de l’unité de mesure
CreatedCréé
DescriptionDescription
AmountMontant
CurrencyDevise
CurrencyAmountMontant en devise
ExchangeRateTaux de change
CreatedAtCréé à
SoftwareVersionVersion du logiciel
StoreNameNom du magasin
StoreName2Nom du magasin 2
StoreAddressAdresse du magasin
StoreAddress2Adresse du magasin 2
StorePostCodeCode postal du magasin
StoreCityVille du magasin
StoreCountryPays du magasin
IntraCommVATIdentifierIdentifiant de TVA intracommunautaire
SalespersonNameNom du vendeur
UserCodeCode d’utilisateur
GrandTotalTypeType de total général
SequenceNumberNuméro de séquence
AdditionalInfoInformations supplémentaires

Legacy

Prior to the fiscal version 11 of NPRetail, the archive files were not signed and they followed a different schema. The old schema can be downloaded from Old Archive Schema.

Prior to the fiscal version 21.6 of NPRetail, the archive files followed a different schema that can be downloaded here: Old Archive Schema.