# Invoice history

## Short description

The ERP Cache Invoice interface is used to keep a record of the invoices in the ERP system. The Invoices in the ERP Cache are used to show invoice history to the user.

## Delivery method

**Update Frequency**: Batch at least once a day\
**Incremental or complete set:** Incremental

**Filetype:** Zipped XML

**Filename: \[SHOPNAME]\_ErpCache\_Invoice**\_**\[INDEXNUMBER]\(**\_**\[SUBNUMBER])**.xml\
**Transport:** over FTPS, FTPS Vendisto server hosted by INTEGRACE, file will be placed on FTPS server by ERP party.

**Location within FTP root:** \ErpCache\\

## Structure XML

```markup
<?xml version="1.0" encoding="utf-8"?>
<Import>
    <ImportSettings>
        <Importer>ErpCache_Invoices</Importer>
        <Version>1.0</Version>
    </ImportSettings>
    <Invoices>
        <Invoice>
            <InvoiceNumber></InvoiceNumber>
            <AccountNumber></AccountNumber>
            <InvoiceDate></InvoiceDate>
            <DownloadablePdfUri></DownloadablePdfUri>
            <InvoicePdf></InvoicePdf>
            <TotalOutstanding></TotalOutstanding>
            <TotalPrice></TotalPrice>
        </Invoice>
    </Invoices>
</Import>
```



## Fields XML

**Import element:**

<table data-header-hidden><thead><tr><th width="176">Name</th><th>Description</th><th width="150">Type</th><th>Required/Optional</th></tr></thead><tbody><tr><td>Name</td><td>Description</td><td>Type</td><td>Required/Optional</td></tr><tr><td>ImportSettings</td><td>Container element for importsettings</td><td>Element</td><td>Required</td></tr><tr><td>Invoices</td><td>Container element for invoice data</td><td>Element</td><td>Required</td></tr></tbody></table>

**ImportSettings element:**

<table data-header-hidden><thead><tr><th width="183">Name</th><th width="183">Description</th><th width="181">Type</th><th>Required/Optional</th></tr></thead><tbody><tr><td>Name</td><td>Description</td><td>Type</td><td>Required/Optional</td></tr><tr><td>Importer</td><td>Name of the importer.<br>Should be ErpCache_Invoices.</td><td><p>Text,</p><p>default ErpCache_Invoices</p></td><td>Required</td></tr><tr><td>Version</td><td>Version of the import xml. To be used for backward compatibility issues.</td><td>Text,<br>default 1.0</td><td>Required</td></tr></tbody></table>

**Order element:**

<table data-header-hidden><thead><tr><th width="186">Name</th><th width="168">Description</th><th width="171">Type</th><th>Required/Optional</th></tr></thead><tbody><tr><td>Name</td><td>Description</td><td>Type</td><td>Required/Optional</td></tr><tr><td>InvoiceNumber</td><td>Invoice number</td><td>Text</td><td>Required</td></tr><tr><td>AccountNumber</td><td>Customer's account number</td><td>Text</td><td>Required</td></tr><tr><td>InvoiceDate</td><td>Invoice date</td><td>Date</td><td>Required</td></tr><tr><td>DownloadablePdfUri</td><td>A link to the Invoice document (PDF format) which will be generated by the ERP system</td><td>Uri</td><td>Optional</td></tr><tr><td>InvoicePdf</td><td>The PDF containing the invoice</td><td>Base64Binary</td><td>Optional</td></tr><tr><td>TotalOutstanding</td><td>The total outstanding amount of the invoice. Webservice falls back on Outstanding Item<br>-> TotalOutstanding if this value is null</td><td>Decimal</td><td>Optional</td></tr><tr><td>TotalPrice</td><td>The total price of the invoice</td><td>Decimal</td><td>Optional</td></tr></tbody></table>



**Types:**

| Type         | Values                                                           |
| ------------ | ---------------------------------------------------------------- |
| Date         | yyyy-MM-dd                                                       |
| Base64Binary | Base64 encoded equivalent of an array of 8-bit unsigned integers |
