<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.canadapost.ca/ws/shipment-v4" xmlns="http://www.canadapost.ca/ws/shipment-v4" elementFormDefault="qualified">
    <xsd:include schemaLocation="common.xsd"/>

    <xsd:element name="shipment" type="ShipmentType"/>

    <xsd:element name="shipment-info" type="ShipmentInfoType"/>

    <xsd:element name="shipment-details" type="ShipmentDetailsType"/>

    <xsd:element name="shipments" type="ShipmentsType" />

    <xsd:element name="shipment-price" type="ShipmentPriceType" />

    <xsd:element name="shipment-cc-receipt" type="ShipmentReceiptType" />

    <xsd:element name="groups" type="GroupsType" />

 	<xsd:complexType name="GroupsType">
		<xsd:sequence>
			<xsd:element name="group" type="GroupType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

     <xsd:complexType name="GroupType">
		<xsd:all>
			<xsd:element name="group-id" type="GroupIDType"/>
            <xsd:element ref="link" />
		</xsd:all>
	 </xsd:complexType>


    <xsd:complexType name="ShipmentPriceType">
		<xsd:all>
			<xsd:element name="service-code" type="ServiceCodeType"/>
			<xsd:element name="base-amount" type="CostTypeNonZero"/>
			<xsd:element name="priced-options" type="PricedOptionsType" minOccurs="0"/>
			<xsd:element name="adjustments" type="AdjustmentsType" minOccurs="0"/>
			<xsd:element name="pre-tax-amount" type="CostTypeAllowsZero"/>
			<xsd:element name="gst-amount" type="CostTypeAllowsZero"/>
			<xsd:element name="pst-amount" type="CostTypeAllowsZero"/>
			<xsd:element name="hst-amount" type="CostTypeAllowsZero"/>
			<xsd:element name="due-amount" type="CostTypeAllowsZero"/>
			<xsd:element name="service-standard" type="ServiceStandardType"/>
			<xsd:element name="rated-weight">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:decimal">
                        <xsd:minExclusive value="0"/>
                        <xsd:maxInclusive value="999.999"/>
                        <xsd:fractionDigits value="3"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
		</xsd:all>
	</xsd:complexType>

    <xsd:complexType name="ServiceStandardType">
		<xsd:all>
			<xsd:element name="am-delivery" type="xsd:boolean"/>
			<xsd:element name="guaranteed-delivery" type="xsd:boolean"/>
			<xsd:element name="expected-transmit-time" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="xsd:integer">
						<xsd:minInclusive value="0"/>
						<xsd:maxInclusive value="99"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element name="expected-delivery-date" type="xsd:date" minOccurs="0"/>
		</xsd:all>
	</xsd:complexType>

    <xsd:complexType name="PricedOptionsType">
		<xsd:sequence>
			<xsd:element name="priced-option" type="PricedOptionType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

    <xsd:complexType name="PricedOptionType">
		<xsd:all>
			<xsd:element name="option-code" type="xsd:normalizedString"/>
			<xsd:element name="option-price" minOccurs="0" type="CostTypeAllowsNegative" />
		</xsd:all>
	</xsd:complexType>

    <xsd:complexType name="AdjustmentsType">
		<xsd:sequence>
			<xsd:element name="adjustment" type="AdjustmentType" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

    <xsd:complexType name="AdjustmentType">
		<xsd:all>
			<xsd:element name="adjustment-code" type="xsd:normalizedString"/>
			<xsd:element name="adjustment-amount" type="CostTypeAllowsNegative"/>
		</xsd:all>
	</xsd:complexType>

    <xsd:complexType name="ShipmentsType">
        <xsd:sequence>
            <xsd:element ref="link" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="ShipmentInfoType">
        <xsd:all>
            <xsd:element name="shipment-id" type="ShipmentIDType"/>
            <xsd:element name="shipment-status" type="ShipmentStatusType"/>
            <xsd:element name="tracking-pin" type="TrackingPINType" minOccurs="0"/>
            <xsd:element name="return-tracking-pin" type="TrackingPINType" minOccurs="0"/>
            <xsd:element name="po-number" type="PoNumberType" minOccurs="0"/>
            <xsd:element ref="links"/>
        </xsd:all>
    </xsd:complexType>

    <!-- group-id and transmit-shipment are mutually exclusive -->
    <xsd:element name="groupIdOrTransmitShipment" abstract="true" />
    <xsd:element name="group-id" type="GroupIDType" substitutionGroup="groupIdOrTransmitShipment"/>
    <xsd:element name="transmit-shipment" type="xsd:boolean" fixed="true" substitutionGroup="groupIdOrTransmitShipment"/>

    <xsd:complexType name="ShipmentType">
        <xsd:all>
            <xsd:element ref="groupIdOrTransmitShipment" />
            <xsd:element name="requested-shipping-point" type="PostalCodeType"/>
            <xsd:element name="expected-mailing-date" type="xsd:date" minOccurs="0"/>
            <xsd:element name="delivery-spec" type="DeliverySpecType"/>
            <xsd:element name="return-spec" type="ReturnSpecType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>


    <xsd:complexType name="DeliverySpecType">
        <xsd:all>
            <xsd:element name="service-code" type="ServiceCodeType"/>
            <xsd:element name="sender" type="SenderType"/>
            <xsd:element name="destination" type="DestinationType"/>
            <xsd:element name="options" minOccurs="0">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="option" type="OptionType" maxOccurs="20"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="parcel-characteristics" type="ParcelCharacteristicsType"/>
            <xsd:element name="notification" type="NotificationType" minOccurs="0"/>
            <xsd:element name="print-preferences" type="PrintPreferencesType" minOccurs="0"/>
            <xsd:element name="preferences" type="PreferencesType"/>
            <xsd:element name="references" type="ReferencesType" minOccurs="0"/>
            <xsd:element name="customs" type="CustomsType" minOccurs="0"/>
            <xsd:element name="settlement-info" type="SettlementInfoType"/>
            <xsd:element name="cod-remittance" minOccurs="0">
                <xsd:complexType>
                    <xsd:all>
                        <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
                        <xsd:element name="company" type="CompanyNameType"/>
                        <xsd:element name="address-details" type="DomesticAddressDetailsType"/>
                    </xsd:all>
                </xsd:complexType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>



    <xsd:complexType name="CustomsType">
        <xsd:all>
            <xsd:element name="currency">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="3"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="conversion-from-cad"  minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:decimal">
                        <xsd:minExclusive value="0"/>
                        <xsd:maxInclusive value="999.999999"/>
                        <xsd:fractionDigits value="6"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="reason-for-export">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="3"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="other-reason" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="additional-customs-info" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="sku-list">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="item" type="SkuType" maxOccurs="500"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="SkuType">
        <xsd:all>
            <xsd:element name="customs-number-of-units">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:positiveInteger">
                        <xsd:minInclusive value="1"/>
                        <xsd:maxInclusive value="9999"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="customs-description">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="sku" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="hs-tariff-code" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:pattern value="\d{4}(\.\d{2}(\.\d{2}(\.\d{2})?)?)?"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="unit-weight">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:decimal">
                        <xsd:minExclusive value="0"/>
                        <xsd:maxInclusive value="99.999"/>
                        <xsd:fractionDigits value="3"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="customs-value-per-unit">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:decimal">
                        <xsd:minExclusive value="0"/>
                        <xsd:maxInclusive value="99999.99"/>
                        <xsd:fractionDigits value="2"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="country-of-origin" type="CountryCodeType" minOccurs="0"/>
            <xsd:element name="province-of-origin" type="ProvinceType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="SenderType">
        <xsd:all>
            <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
            <xsd:element name="company" type="CompanyNameType"/>
            <xsd:element name="contact-phone" type="PhoneNumberType" maxOccurs="1"/>
            <xsd:element name="address-details" type="AddressDetailsType"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="DestinationType">
        <xsd:all>
            <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
            <xsd:element name="company" type="CompanyNameType" minOccurs="0"/>
            <xsd:element name="additional-address-info" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="client-voice-number" type="PhoneNumberType" minOccurs="0"/>
            <xsd:element name="address-details" type="DestinationAddressDetailsType"/>
        </xsd:all>
    </xsd:complexType>
     <xsd:complexType name="RecipientAddressType">
        <xsd:all>
            <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
            <xsd:element name="company" type="CompanyNameType" minOccurs="0"/>
            <xsd:element name="additional-address-info" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="client-voice-number" type="PhoneNumberType" minOccurs="0"/>
            <xsd:element name="address-details" type="DestinationAddressDetailsType"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ReturnSpecType">
        <xsd:all>
            <xsd:element name="service-code" type="ServiceCodeType"/>
            <xsd:element name="return-recipient" type="ReturnRecipientType"/>
            <xsd:element name="return-notification" type="EmailType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ReturnRecipientType">
        <xsd:all>
            <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
            <xsd:element name="company" type="CompanyNameType" minOccurs="0"/>
            <xsd:element name="address-details" type="DomesticAddressDetailsType"/>
        </xsd:all>
    </xsd:complexType>

	<xsd:complexType name="DomesticAddressDetailsType">
	  <xsd:all>
            <xsd:element name="address-line-1">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="address-line-2" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="city">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="40"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="prov-state" type="ProvinceType"/>
            <xsd:element name="postal-zip-code" type="PostalCodeType"/>
        </xsd:all>
	</xsd:complexType>

    <xsd:complexType name="AddressDetailsType">
        <xsd:all>
            <xsd:element name="address-line-1">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="address-line-2" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="city">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="40"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="prov-state" type="ProvinceStateOrInternationalType"/>
            <xsd:element name="country-code" type="CountryCodeType"/>
            <xsd:element name="postal-zip-code" type="PostalCodeOrZipOrInternationalType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="DestinationAddressDetailsType">
        <xsd:all>
            <xsd:element name="address-line-1">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="address-line-2" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="44"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="city" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="40"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="prov-state" type="ProvinceStateOrInternationalType" minOccurs="0"/>
            <xsd:element name="country-code" type="CountryCodeType"/>
            <xsd:element name="postal-zip-code" type="PostalCodeOrZipOrInternationalType" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="OptionType">
        <xsd:all>
            <xsd:element name="option-code">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="10"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="option-amount" type="CostTypeNonZero" minOccurs="0"/>
            <xsd:element name="option-qualifier-1"  type="xsd:boolean" minOccurs="0"/>
            <xsd:element name="option-qualifier-2" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="12"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ParcelCharacteristicsType">
        <xsd:all>
            <xsd:element name="weight">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:decimal">
                        <xsd:minExclusive value="0"/>
                        <xsd:maxInclusive value="999.999"/>
                        <xsd:fractionDigits value="3"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="dimensions" minOccurs="0">
                <xsd:complexType>
                    <xsd:all>
                        <xsd:element name="length" type="DimensionMeasurementType"/>
                        <xsd:element name="width" type="DimensionMeasurementType"/>
                        <xsd:element name="height" type="DimensionMeasurementType"/>
                    </xsd:all>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="unpackaged" type="xsd:boolean" minOccurs="0"/>
            <xsd:element name="mailing-tube" type="xsd:boolean" minOccurs="0"/>
            <xsd:element name="oversized" type="xsd:boolean" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="NotificationType">
        <xsd:all>
            <xsd:element name="email" type="EmailType"/>
            <xsd:element name="on-shipment" type="xsd:boolean"/>
            <xsd:element name="on-exception" type="xsd:boolean"/>
            <xsd:element name="on-delivery" type="xsd:boolean"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="PrintPreferencesType">
        <xsd:all>
            <xsd:element name="output-format" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="8.5x11"/>
                        <xsd:enumeration value="4x6"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="PreferencesType">
        <xsd:all>
            <xsd:element name="show-packing-instructions" type="xsd:boolean"/>
            <xsd:element name="show-postage-rate" type="xsd:boolean" minOccurs="0"/>
            <xsd:element name="show-insured-value" type="xsd:boolean" minOccurs="0"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ReferencesType">
        <xsd:all>
            <xsd:element name="cost-centre" type="CostCentreIDType" minOccurs="0"/>
            <xsd:element name="customer-ref-1" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="35"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="customer-ref-2" minOccurs="0">
                <xsd:simpleType>
                    <xsd:restriction base="xsd:normalizedString">
                        <xsd:maxLength value="35"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="SettlementInfoType">
        <xsd:all>
            <xsd:element name="paid-by-customer" type="CustomerIDType" minOccurs="0"/>
            <xsd:element name="contract-id" type="ContractIDType" minOccurs="0"/>
            <xsd:element name="intended-method-of-payment" type="MethodOfPaymentType"/>
        </xsd:all>
    </xsd:complexType>

    <xsd:simpleType name="CostCentreIDType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:maxLength value="30"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="EmailType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:pattern value="(['_A-Za-z0-9-]+)(\.['_A-Za-z0-9-]+)*@([A-Za-z0-9-]+)(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,5})"/>
            <xsd:maxLength value="60"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="CompanyNameType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="44"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ContactNameType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:maxLength value="44"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="GroupIDType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="32"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="TrackingPINType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:minLength value="11"/>
            <xsd:maxLength value="16"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ShipmentIDType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:maxLength value="32"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="ShipmentStatusType">
        <xsd:restriction base="xsd:normalizedString">
            <xsd:maxLength value="14"/>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:complexType name="ShipmentDetailsType">
        <xsd:all>
            <xsd:element name="shipment-status" type="ShipmentStatusType"/>
            <xsd:element name="final-shipping-point" type="PostalCodeType"/>
            <xsd:element name="tracking-pin" type="TrackingPINType" minOccurs="0"/>
            <xsd:element name="po-number" type="PoNumberType" minOccurs="0"/>
            <!--
                Redefine ShipmentType locally without the requested-shipping-point element because it is mandatory
                in the create shipment request but removed from the shipment details response.

                <xsd:element name="shipment-detail" type="ShipmentType"/>
            -->
            <xsd:element name="shipment-detail">
                <xsd:complexType>
                    <xsd:all>
                        <xsd:element ref="groupIdOrTransmitShipment" />
                        <xsd:element name="expected-mailing-date" type="xsd:date" minOccurs="0"/>
                        <xsd:element   name="delivery-spec">
                        <xsd:complexType>
                            <xsd:all>
                                <xsd:element name="service-code" type="ServiceCodeType"/>
                                <xsd:element name="sender" type="SenderType"/>
                                <xsd:element name="destination" type="DestinationType"/>
                                <xsd:element name="recipient" type="RecipientAddressType" minOccurs="0"/>
                                <xsd:element name="options" minOccurs="0">
                                    <xsd:complexType>
                                        <xsd:sequence>
                                            <xsd:element name="option" type="OptionType" maxOccurs="20"/>
                                        </xsd:sequence>
                                    </xsd:complexType>
                                </xsd:element>
                                <xsd:element name="parcel-characteristics" type="ParcelCharacteristicsType"/>
                                <xsd:element name="notification" type="NotificationType" minOccurs="0"/>
                                <xsd:element name="print-preferences" type="PrintPreferencesType" minOccurs="0"/>
                                <xsd:element name="preferences" type="PreferencesType"/>
                                <xsd:element name="references" type="ReferencesType" minOccurs="0"/>
                                <xsd:element name="customs" type="CustomsType" minOccurs="0"/>
                                <xsd:element name="settlement-info" type="SettlementInfoType"/>
                                <xsd:element name="cod-remittance" minOccurs="0">
                                    <xsd:complexType>
                                        <xsd:all>
                                            <xsd:element name="name" type="ContactNameType" minOccurs="0"/>
                                            <xsd:element name="company" type="CompanyNameType"/>
                                            <xsd:element name="address-details" type="DomesticAddressDetailsType"/>
                                        </xsd:all>
                                    </xsd:complexType>
                                </xsd:element>
                            </xsd:all>
                        </xsd:complexType>
                        </xsd:element>
                        <xsd:element name="return-spec" type="ReturnSpecType" minOccurs="0"/>
                    </xsd:all>
                </xsd:complexType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>

    <xsd:complexType name="ShipmentReceiptType">
        <xsd:all>
            <xsd:element name="cc-receipt-details">
                <xsd:complexType>
                    <xsd:all>
                        <xsd:element name="merchant-name">
                            <xsd:simpleType>
                                <xsd:restriction base="xsd:normalizedString">
                                    <xsd:maxLength value="44" />
                                </xsd:restriction>
                            </xsd:simpleType>
                        </xsd:element>
                        <xsd:element name="merchant-url">
                            <xsd:simpleType>
                                <xsd:restriction base="xsd:normalizedString">
                                    <xsd:maxLength value="60" />
                                </xsd:restriction>
                            </xsd:simpleType>
                        </xsd:element>
                        <xsd:element name="name-on-card" type="CcNameType" minOccurs="0"/>
                        <xsd:element name="auth-code" type="CcAuthorizationCodeType" />
                        <xsd:element name="auth-timestamp" type="xsd:dateTime" />
                        <xsd:element name="card-type" type="CcType" />
                        <xsd:element name="charge-amount" type="CcAuthorizationAmountType" />
                        <xsd:element name="currency" type="CurrencyType" />
                        <xsd:element name="transaction-type">
                            <xsd:simpleType>
                                <xsd:restriction base="xsd:normalizedString">
                                    <xsd:maxLength value="44" />
                                </xsd:restriction>
                            </xsd:simpleType>
                        </xsd:element>
                    </xsd:all>
                </xsd:complexType>
            </xsd:element>
        </xsd:all>
    </xsd:complexType>
</xsd:schema>
