In Bilagscan we always encourages our clients to use our API when creating the bridge between their system and Bilagscan. However, there are instances where this is not possible/optimal therefore we do also support integration via XML files. 

Working with XML files works like this:
  1. Invoice is sent to Bilagscan
  2. Data is extracted in Bilagscan
  3. When the invoice is finished, a new XML file will be uploaded to a SFTP server with all the relevant information AND the original invoice file. This means that one XML file will always only contain information on a single invoice. 
  4. The client can download the file and upload it to their system
A concrete example of the XML file and XML schema (xsd) can be found below.

Example of a Bilagscan XML file
<?xml version="1.0" encoding="UTF-8"?>
<Batches
	xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<Batch>
		<Id i:nil="true" />
		<Version>1.0</Version>
		<CreatedBy>Bilagscan</CreatedBy>
		<ReceiveTime>05-08-2019 10:29:50 AM</ReceiveTime>
		<Documents>
			<Id i:nil="true" />
			<Version i:nil="true" />
			<Type>invoice</Type>
			<OriginalFilename>4_1WAHE049_fl.pdf</OriginalFilename>
			<Filename>4_1WAHE049_fl.pdf</Filename>
			<Parties>
				<Party>
					<Type>buyer</Type>
					<Name>Some company</Name>
					<TaxRegistrationNumber></TaxRegistrationNumber>
					<Street>Vejnavn 12</Street>
					<PostalCode>1234</PostalCode>
					<City>city</City>
					<CountryName>DK</CountryName>
				</Party>
				<Party>
					<Type>supplier</Type>
					<Name>JOTUN DANMARK A/S</Name>
					<TaxRegistrationNumber>14163328</TaxRegistrationNumber>
					<Street>-</Street>
					<PostalCode>-</PostalCode>
					<City>-</City>
					<CountryName>DK</CountryName>
				</Party>
			</Parties>
			<HeaderFields>
				<HeaderField>
					<Name>country</Name>
					<Text>DK</Text>
				</HeaderField>
				<HeaderField>
					<Name>company_vat_reg_no</Name>
					<Text>14163328</Text>
				</HeaderField>
				<HeaderField>
					<Name>payment_date</Name>
					<Text>2018-05-28</Text>
				</HeaderField>
				<HeaderField>
					<Name>danish_industry_code</Name>
					<Text>467320</Text>
				</HeaderField>
				<HeaderField>
					<Name>total_amount_incl_vat</Name>
					<Text>1936.49</Text>
				</HeaderField>
				<HeaderField>
					<Name>company_name</Name>
					<Text>JOTUN DANMARK A/S</Text>
				</HeaderField>
				<HeaderField>
					<Name>voucher_number</Name>
					<Text>cd91417678</Text>
				</HeaderField>
				<HeaderField>
					<Name>invoice_date</Name>
					<Text>2018-04-24</Text>
				</HeaderField>
				<HeaderField>
					<Name>currency</Name>
					<Text>DKK</Text>
				</HeaderField>
				<HeaderField>
					<Name>total_vat_amount_scanned</Name>
					<Text>387.3</Text>
				</HeaderField>
				<HeaderField>
					<Name>total_amount_excl_vat</Name>
					<Text>1549.19</Text>
				</HeaderField>
				<HeaderField>
					<Name>voucher_type</Name>
					<Text>invoice</Text>
				</HeaderField>
			</HeaderFields>
			<Tables>
				<Table>
					<Type>LineItem

						<TableColumns>
							<TableColumn>
								<Name>quantity</Name>
								<Type>quantity</Type>
							</TableColumn>
							<TableColumn>
								<Name>description</Name>
								<Type>description</Type>
							</TableColumn>
							<TableColumn>
								<Name>amount</Name>
								<Type>amount</Type>
							</TableColumn>
							<TableColumn>
								<Name>unit_price</Name>
								<Type>unit_price</Type>
							</TableColumn>
							<TableColumn>
								<Name>description</Name>
								<Type>description</Type>
							</TableColumn>
							<TableColumn>
								<Name>amount</Name>
								<Type>amount</Type>
							</TableColumn>
							<TableColumn>
								<Name>quantity</Name>
								<Type>quantity</Type>
							</TableColumn>
							<TableColumn>
								<Name>unit_price</Name>
								<Type>unit_price</Type>
							</TableColumn>
						</TableColumns>
						<TableRows>
							<TabelRow>
								<ItemFields>
									<ItemField>
										<Name>quantity</Name>
										<Text>4</Text>
									</ItemField>
									<ItemField>
										<Name>description</Name>
										<Text>line description 1</Text>
									</ItemField>
									<ItemField>
										<Name>amount</Name>
										<Text>2000</Text>
									</ItemField>
									<ItemField>
										<Name>unit_price</Name>
										<Text>200</Text>
									</ItemField>
								</ItemFields>
							</TabelRow>
							<TabelRow>
								<ItemFields>
									<ItemField>
										<Name>description</Name>
										<Text>line description 2</Text>
									</ItemField>
									<ItemField>
										<Name>amount</Name>
										<Text>3000</Text>
									</ItemField>
									<ItemField>
										<Name>quantity</Name>
										<Text>10</Text>
									</ItemField>
									<ItemField>
										<Name>unit_price</Name>
										<Text>300</Text>
									</ItemField>
								</ItemFields>
							</TabelRow>
						</TableRows>
					</Type>
				</Table>
			</Tables>
		</Documents>
	</Batch>
</Batches>

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Batches">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Batch">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="Id" nillable="true"/>
              <xs:element type="xs:float" name="Version"/>
              <xs:element type="xs:string" name="CreatedBy"/>
              <xs:element type="xs:string" name="ReceiveTime"/>
              <xs:element name="Documents">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="Id" nillable="true"/>
                    <xs:element type="xs:string" name="Version" nillable="true"/>
                    <xs:element type="xs:string" name="Type"/>
                    <xs:element type="xs:string" name="OriginalFilename"/>
                    <xs:element type="xs:string" name="Filename"/>
                    <xs:element name="Parties">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Party" maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element type="xs:string" name="Type"/>
                                <xs:element type="xs:string" name="Name"/>
                                <xs:element type="xs:string" name="TaxRegistrationNumber"/>
                                <xs:element type="xs:string" name="Street"/>
                                <xs:element type="xs:short" name="PostalCode"/>
                                <xs:element type="xs:string" name="City"/>
                                <xs:element type="xs:string" name="CountryName"/>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="HeaderFields">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="HeaderField" maxOccurs="unbounded" minOccurs="0">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element type="xs:string" name="Name"/>
                                <xs:element type="xs:string" name="Text"/>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="Tables">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="Table">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="Type">
                                  <xs:complexType mixed="true">
                                    <xs:sequence>
                                      <xs:element name="TableColumns">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="TableColumn" maxOccurs="unbounded" minOccurs="0">
                                              <xs:complexType>
                                                <xs:sequence>
                                                  <xs:element type="xs:string" name="Name"/>
                                                  <xs:element type="xs:string" name="Type"/>
                                                </xs:sequence>
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                        </xs:complexType>
                                      </xs:element>
                                      <xs:element name="TableRows">
                                        <xs:complexType>
                                          <xs:sequence>
                                            <xs:element name="TabelRow" maxOccurs="unbounded" minOccurs="0">
                                              <xs:complexType>
                                                <xs:sequence>
                                                  <xs:element name="ItemFields">
                                                    <xs:complexType>
                                                      <xs:sequence>
                                                        <xs:element name="ItemField" maxOccurs="unbounded" minOccurs="0">
                                                          <xs:complexType>
                                                            <xs:sequence>
                                                              <xs:element type="xs:string" name="Name"/>
                                                              <xs:element type="xs:string" name="Text"/>
                                                            </xs:sequence>
                                                          </xs:complexType>
                                                        </xs:element>
                                                      </xs:sequence>
                                                    </xs:complexType>
                                                  </xs:element>
                                                </xs:sequence>
                                              </xs:complexType>
                                            </xs:element>
                                          </xs:sequence>
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>