
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns="http://www.posti.com/wms/postiwmsxml/InReturnOrder/2016/1" 
	targetNamespace="http://www.posti.com/wms/postiwmsxml/InReturnOrder/2016/1" 
	elementFormDefault="qualified" attributeFormDefault="unqualified">
           
	<xs:element name="Order">
		<xs:complexType>
			<xs:all>
				<xs:element name="MetaData" type="ctMetaDataType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="OrderLines" type="ctOrderLinesType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="Instructions" type="ctInstructionsType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="PersonInfoShipTo" type="ctPersonInfoShipToType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="PersonInfoBillTo" type="ctPersonInfoBillToType" minOccurs="1" maxOccurs="1"/>
				<xs:element name="AdditionalAddresses" type="ctAdditionalAddressesType" minOccurs="0" maxOccurs="1"/>
				<xs:element name="References" type="ctReferencesType" minOccurs="0" maxOccurs="1"/>
			</xs:all>
			<xs:attribute name="ShipNode" type="stStringMaxLength24Type" use="optional">
				<xs:annotation>
					<xs:documentation>Ship node to which the return order line will be received.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ReqDeliveryDate" type="xs:dateTime" use="optional">
				<xs:annotation>
					<xs:documentation>The requested delivery date.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="OrderType" type="stStringMaxLength20Type" use="optional">
				<xs:annotation>
					<xs:documentation>The order classification code.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="FreightTerms" type="stStringMaxLength40Type" use="optional">
				<xs:annotation>
					<xs:documentation>Freight term of the order.</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="DerivedFromOrderNo" type="stStringMaxLength10Type" 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>Principal's return order number.</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="SourceOrganizationId" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Code for the organization that sends the return order message, provided by Posti (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 order 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 sender ID).</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DocumentType" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Name of the document. This should be InReturnOrder.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="CreationDateTime" type="xs:dateTime" use="required">
			<xs:annotation>
				<xs:documentation>Date and time of return order creation.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="MessageIdentifier" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Identifier of the message which is unique at least in the scope of message sender.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctOrderLinesType">
		<xs:annotation>
			<xs:documentation>List of order lines.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="OrderLine" type="ctOrderLineType" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ctOrderLineType">
		<xs:annotation>
			<xs:documentation>Order line details.</xs:documentation>
		</xs:annotation>
		<xs:all>
			<xs:element name="Item" type="ctItemType" minOccurs="1" maxOccurs="1"/>
			<xs:element name="Extn" type="ctOrderLine_ExtnType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="References" type="ctReferencesType" minOccurs="0" maxOccurs="1"/>
			<xs:element name="OrderLineInvAttRequest" type="ctOrderLineInvAttRequestType" minOccurs="0" maxOccurs="1"/>
		</xs:all>
		<xs:attribute name="CustomerLinePONo" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>Principal's return order line number.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="SerialNo" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>Requested serial number of the item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="OrderedQty" type="stNonNegDecimal14Dig4FractType" use="required">
			<xs:annotation>
				<xs:documentation>The quantity of the line item that is being returned.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReqDeliveryDate" type="xs:dateTime" use="optional">
			<xs:annotation>
				<xs:documentation>Requested delivery date.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ReturnReason" type="stStringMaxLength40Type" use="required">
			<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:complexType>

	<xs:complexType name="ctItemType">
		<xs:annotation>
			<xs:documentation>Item 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="ProductClass" type="stStringMaxLength10Type" use="optional">
			<xs:annotation>
				<xs:documentation>The product class. This field is used as an inventory identifier.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemID" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>The identifier for the item. The item ID, UOM and product class form the unique inventory identifier for an order line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ItemDesc" type="stStringMaxLength500Type" use="optional">
			<xs:annotation>
				<xs:documentation>Description for the item.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctOrderLine_ExtnType">
		<xs:annotation>
			<xs:documentation>More information about the 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="ctOrderLineInvAttRequestType">
		<xs:annotation>
			<xs:documentation>OrderLineInvAttRequestType</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Extn" type="ctExtnType" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="LotNumber" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The lot number that has been specified in the order line.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctExtnType">
		<xs:annotation>
			<xs:documentation>More details on OrderLineInvAttRequestType.</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="ctInstructionsType">
		<xs:annotation>
			<xs:documentation>List of instructions.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="Instruction" type="ctInstructionType" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ctInstructionType">
		<xs:annotation>
			<xs:documentation>Instructions.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="InstructionType" type="stStringMaxLength10Type" use="required">
			<xs:annotation>
				<xs:documentation>Name of the pre-defined instruction type.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="InstructionText" type="stStringMaxLength4000Type" use="optional">
			<xs:annotation>
				<xs:documentation>Free-form text indicating any additional information related to the instruction type.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctPersonInfoShipToType">
		<xs:annotation>
			<xs:documentation>ShipTo address details.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ctPersonInfoType">
				<xs:attribute name="City" type="stStringMaxLength35Type" use="required">
					<xs:annotation>
						<xs:documentation>The city in the address.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="Country" type="stStringMaxLength40Type" use="required">
					<xs:annotation>
						<xs:documentation>The country in the address. We recommend usage of 2 byte ISO Country Codes.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="ctPersonInfoBillToType">
		<xs:annotation>
			<xs:documentation>BillTo address details.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ctPersonInfoType">
				<xs:attribute name="City" type="stStringMaxLength35Type" use="optional">
					<xs:annotation>
						<xs:documentation>The city in the address.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="Country" type="stStringMaxLength40Type" use="required">
					<xs:annotation>
						<xs:documentation>The country in the address. We recommend usage of 2 byte ISO Country Codes.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="ctPersonInfoType">
		<xs:annotation>
			<xs:documentation>Address details.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="FirstName" type="stStringMaxLength64Type" use="optional">
			<xs:annotation>
				<xs:documentation>The first name of the person. If last name and first name are not used in separate fields, then both names are written in the FirstName field.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="LastName" type="stStringMaxLength64Type" use="optional">
			<xs:annotation>
				<xs:documentation>The last name of the person. This is used only if person’s first name and last name are used separately.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Company" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The company this person is associated with. In case of company name is known it is written here.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="ZipCode" type="stStringMaxLength35Type" use="optional">
			<xs:annotation>
				<xs:documentation>The zip code in the address.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="AddressLine1" type="stStringMaxLength70Type" use="optional">
			<xs:annotation>
				<xs:documentation>The address line 1 field.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="AddressLine2" type="stStringMaxLength70Type" use="optional">
			<xs:annotation>
				<xs:documentation>The address line 2 field.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="AddressLine3" type="stStringMaxLength70Type" use="optional">
			<xs:annotation>
				<xs:documentation>The address line 3 field.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="DayPhone" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The day time phone at which the person or organization referred to in the address can be called.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="OtherPhone" type="stStringMaxLength40Type" use="optional">
			<xs:annotation>
				<xs:documentation>The alternate phone number at which the person or a predesignated employee of the organization referred to in the address can be called.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="EmailId" type="stStringMaxLength150Type" use="optional">
			<xs:annotation>
				<xs:documentation>The email address at which the person or a predesignated employee of the organization referred to in the address can be contacted.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctAdditionalAddressesType">
		<xs:annotation>
			<xs:documentation>List of additional addresses.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="AdditionalAddress" type="ctAdditionalAddressType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ctAdditionalAddressType">
		<xs:annotation>
			<xs:documentation>Additional address details.</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="PersonInfo" type="ctAddAddress_PersonInfoType" minOccurs="1" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="AddressType" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>Identifies the type of address. Part of unique key.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>

	<xs:complexType name="ctAddAddress_PersonInfoType">
		<xs:annotation>
			<xs:documentation>Address details.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="ctPersonInfoType">
				<xs:attribute name="City" type="stStringMaxLength35Type" use="optional">
					<xs:annotation>
						<xs:documentation>The city in the address.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="Country" type="stStringMaxLength40Type" use="optional">
					<xs:annotation>
						<xs:documentation>The country in the address. We recommend usage of 2 byte ISO Country Codes.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
				<xs:attribute name="PersonId" type="stStringMaxLength35Type" use="optional">
					<xs:annotation>
						<xs:documentation>The unique identifier for a person.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="ctReferencesType">
		<xs:annotation>
			<xs:documentation>List of 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 details.</xs:documentation>
		</xs:annotation>
		<xs:attribute name="Name" type="stStringMaxLength40Type" use="required">
			<xs:annotation>
				<xs:documentation>The name of the reference.</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="Value" type="stStringMaxLength254Type" use="optional">
			<xs:annotation>
				<xs:documentation>Free-form text associated with the reference name.</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="stStringMaxLength20Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 20 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="20"/>
		</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="stStringMaxLength35Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 35 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="35"/>
		</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="stStringMaxLength64Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 64 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="64"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength70Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 70 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="70"/>
		</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="stStringMaxLength150Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 150 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="150"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength254Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 254 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="254"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength500Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 500 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="500"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="stStringMaxLength4000Type">
		<xs:annotation>
			<xs:documentation>String with maximum length of 4000 characters.</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:maxLength value="4000"/>
		</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>