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

	<xs:element name="Receipts">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="Receipt" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="Receipt">
		<xs:complexType>
			<xs:all>
				<xs:element name="MetaData" type="ctMetaDataType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="ReceiptLines" type="ctReceiptLinesType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="Shipment" type="ctShipmentType" minOccurs="0" maxOccurs="1"/>
			</xs:all>
			<xs:attribute name="TrailerLPNNo" type="stStringMaxLength40Type" use="optional">
				<xs:annotation>
					<xs:documentation>The license plate number of the trailer.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ReceivingNode" type="stStringMaxLength24Type" use="optional">
				<xs:annotation>
					<xs:documentation>The receiving node.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ReceiptNo" type="stStringMaxLength40Type" use="optional">
				<xs:annotation>
					<xs:documentation>The unique key or business key, which by itself identifies a receipt along with ReceivingNode.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ReceiptDate" type="xs:dateTime" use="optional">
				<xs:annotation>
					<xs:documentation>The date when the receipt was started.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="EnterpriseCode" type="stStringMaxLength24Type" use="optional">
				<xs:annotation>
					<xs:documentation>The enterprise to which this receipt belongs. Principal's number in Posti WMS.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ArrivalDateTime" type="xs:dateTime" use="optional">
				<xs:annotation>
					<xs:documentation>The timestamp when the receipt arrived.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</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 return confirmation 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 return confirmation 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 OutReturnConfirmation.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CreationDateTime" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Date and time of return confirmation 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="ctReceiptLinesType">
		<xs:annotation>
			<xs:documentation>List of receipt lines.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="ReceiptLine" type="ctReceiptLineType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ctReceiptLineType">
		<xs:annotation>
			<xs:documentation>Receipt line details.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="Extn" type="ctExtnType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="OrderLine" type="ctOrderLineType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="ShipmentLine" type="ctShipmentLineType" minOccurs="0" maxOccurs="1"/>
		</xs:all>
		<xs:attribute name="UnitOfMeasure" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The unit of measure.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="SerialNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The serial number of the item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Quantity" type="stNonNegDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>The quantity of item on the receipt line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ProductClass" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>The product class of an item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="OrderNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The return order number in Posti WMS.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="PrimeLineNo" type="stNonNegInt5DigType" use="optional">
			<xs:annotation>
				<xs:documentation>The return order line number in Posti WMS.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotNumber" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The lot number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute1" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other lot attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute2" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other lot attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LotAttribute3" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Any other lot attribute.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemID" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The identifier of the item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InventoryStatus" type="stStringMaxLength2Type" use="optional">
			<xs:annotation>
				<xs:documentation>Inventory status after receiving.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DispositionCode" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The disposition code for the return line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctExtnType">
		<xs:annotation>
			<xs:documentation>More details on receipt line.</xs:documentation>
		</xs:annotation>
		<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:complexType name="ctOrderLineType">
		<xs:annotation>
			<xs:documentation>Order line details.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="Extn" type="ctOLine_ExtnType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Order" type="ctOrderType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="References" type="ctReferencesType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="Instructions" type="ctInstructionsType" minOccurs="0" maxOccurs="1"/>
		</xs:all>
		<xs:attribute name="OrderedQty" type="stNonNegDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>Quantity of item that could be returned from this line at its current status.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReturnReason" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The reason for returning the order line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReturnReasonLongDesc" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Long description of the return reason code.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReturnReasonShortDesc" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Short description of the return reason code.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DerivedFromOrderLineNo" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>Original sales order line number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CustomerLinePONo" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>Return order number of principal.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctOLine_ExtnType">
		<xs:annotation>
			<xs:documentation>More information about order line.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="ExtnCustomerSalesUOM" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Customer sales unit of measure.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ExtnCustomerSalesUOMConversion" type="stNonNegDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>Multiplier that can be used together with base unit quantity to gain quantity in sales unit.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctOrderType">
		<xs:annotation>
			<xs:documentation>Order details.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="Instructions" type="ctInstructionsType" minOccurs="0" maxOccurs="1"/>
		</xs:all>
		<xs:attribute name="DerivedFromOrderNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Original sales order number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CustomerPONo" type="stStringMaxLength100Type" use="optional">
			<xs:annotation>
				<xs:documentation>The return order number of principal.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctReferencesType">
		<xs:annotation>
			<xs:documentation>References.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Reference" type="ctReferenceType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ctReferenceType">
		<xs:annotation>
			<xs:documentation>Reference.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="Name" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Original sales order number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Value" type="stStringMaxLength254Type" use="optional">
			<xs:annotation>
				<xs:documentation>Original sales order number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctInstructionsType">
		<xs:annotation>
			<xs:documentation>List of Intructions.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Instruction" type="ctInstructionType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ctInstructionType">
		<xs:annotation>
			<xs:documentation>Intruction details.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="InstructionType" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The type of the Instruction.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InstructionText" type="stStringMaxLength254Type" use="optional">
			<xs:annotation>
				<xs:documentation>Free-form text associated with the instruction type.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctShipmentLineType">
		<xs:annotation>
			<xs:documentation>Shipment line details.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="UnitOfMeasure" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The unit of measure.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ShipmentLineNo" type="stNonNegInt5DigType" use="optional">
			<xs:annotation>
				<xs:documentation>The shipment line number is unique for a shipment.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Quantity" type="stNonNegDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>The shipment line original quantity.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ProductClass" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>The product class.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemID" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The identifier of the item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReceivedQuantity" type="stNonNegDecimal14Dig4FractType" use="optional">
			<xs:annotation>
				<xs:documentation>Quantity received for the shipment line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="ctShipmentType">
		<xs:annotation>
			<xs:documentation>Shipment details.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="ShipmentNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The shipment number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReceivingNode" type="stStringMaxLength24Type" use="optional">
			<xs:annotation>
				<xs:documentation>The node that receives the shipment.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ShipmentType" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The user-defined shipment type. This is used to indicate the composition of the shipment.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="BolNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Number of waybill.</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="stStringMaxLength100Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 100 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="100"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength254Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 100 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="254"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stNonNegInt5DigType">
		<xs:annotation>
			<xs:documentation>Non-negative integer with maximum of 5 total digits.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:integer">
			<xs:minInclusive value="0"/>
			<xs:totalDigits value="5"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stNonNegDecimal14Dig4FractType">
		<xs:annotation>
			<xs:documentation>Non-negative decimal with maximum of 14 total digits and 4 fraction digits.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:decimal">
			<xs:minInclusive value="0"/>
			<xs:totalDigits value="14"/>
			<xs:fractionDigits value="4"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
