<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns="http://www.posti.com/wms/postiwmsxml/OutStockMovementInventory/2016/1" 
	targetNamespace="http://www.posti.com/wms/postiwmsxml/OutStockMovementInventory/2016/1" 
	elementFormDefault="qualified" attributeFormDefault="unqualified">

	<xs:element name="ChangeInventories">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="ChangeInventory" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="ChangeInventory">
		<xs:complexType>
			<xs:all>
				<xs:element name="MetaData" type="ctMetaDataType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="FromSupply" type="ctSupplyType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="ToSupply" type="ctSupplyType" minOccurs="0" maxOccurs="1"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="ctMetaDataType">
		<xs:annotation>
			<xs:documentation>Contains information about message.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="ReceiverOrganizationId" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Code of the organization to whom the stock movement is sent to (principal identifier).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Language" type="stStringMaxLength2Type" use="optional">
			<xs:annotation>
				<xs:documentation>Language code of the stock movement in two-letter ISO 639-1 format, e.g. FI.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ExternalUserId" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Identifier of the principal in external system (OVT code, EDI ID).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DocumentType" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Name of the document. This should be OutStockMovementInventory.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CreationDateTime" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Date and time of stock movement creation.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="MessageIdentifier" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>In outgoing message from Posti, Posti generates the unique identifier.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctSupplyType">
		<xs:annotation>
			<xs:documentation>Supply details.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Tag" type="ctTagType" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="UnitOfMeasure" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The unit of measure for this inventory item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ShipNode" type="stStringMaxLength24Type" use="optional">
			<xs:annotation>
				<xs:documentation>The unique identifier for the ship node. The number of Posti warehouse.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ShipByDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Latest shipment date. If ShipByDate is later than BestBeforeDate then this is expiration date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="SegmentType" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The segment type of the inventory.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Segment" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The segment of the inventory.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReasonText" type="stStringMaxLength255Type" use="optional">
			<xs:annotation>
				<xs:documentation>The description of the reason for this inventory audit.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReasonCode" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The code of the reason for this inventory audit.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Quantity" type="stDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>Quantity of the supply.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ProductClass" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>The product class for this inventory item. Product group and Inventory Status describe the type of inventory. E.g. Inventory that consists of invalid goods which are not valuated with total value.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemID" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The identifier for this inventory item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InventoryStatus" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Inventory status. Product group and Inventory Status describe the type of inventory. E.g. Inventory that consists of invalid goods which are not valuated with total value.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="AdjustmentType" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Adjustment type.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctTagType">
		<xs:annotation>
			<xs:documentation>Tag information.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Extn" type="ctExtnType" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="ManufacturingDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Manufacturing date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotNumber" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Lot number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute1" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute2" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute3" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctExtnType">
		<xs:annotation>
			<xs:documentation>More details on tags.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="ExtnIncubationDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Ready for use date after manufacturing date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ExtnBestBeforeDate" type="xs:date" use="optional">
			<xs:annotation>
				<xs:documentation>Best before date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:simpleType name="stStringMaxLength2Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 2 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="2"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength10Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 10 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="10"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength24Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 24 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="24"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength40Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 40 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="40"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength255Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 255 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stDecimal14Dig4FractType">
		<xs:annotation>
			<xs:documentation>Decimal with maximum of 14 total digits and 4 fraction digits.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="14"/>
			<xs:fractionDigits value="4"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
