<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cns="http://www.iata.org/IATA/2015/00/2022.1/IATA_PaymentClearanceCommonTypes" elementFormDefault="qualified" targetNamespace="http://www.iata.org/IATA/2015/00/2022.1/IATA_PaymentClearanceCommonTypes" version="1.0">
  <xs:complexType name="ClearanceCancellationResponseType">
    <xs:annotation>
      <xs:documentation>used by the clearance cancellation for the delivery of funds from one party - payer- to another party - the payee - to fulfil contractual obligations, i.e. commitment between the two parties.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element maxOccurs="1" minOccurs="1" name="ClearanceID" type="cns:ClearanceID_Type">
        <xs:annotation>
          <xs:documentation>this is an identifier generated by the party requesting the clearance that uniquely identifies the clearance transaction. It provides the necessary link for financial audit connecting the sale to the financial records. This field is required because no other existing data elements could be used by the financial systems or could provide unique identification. The identifier is globally unique for the settlement by design.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="FailureReasonCode" type="cns:FailureReasonCodeType">
        <xs:annotation>
          <xs:documentation>describe the reason why a request for clearance cannot be performed and effectively the clearance is rejected or the requested action, such as cancelling the clearance, failed. 
 In IATA_PaymentClearanceRS message if Status Code has value RJCTD then Failure Reason Code is required.
 In IATA_PaymentClearanceCancellationRS message if StatusCode has value different from CNCLD then FailureReasonCode is required.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="1" name="StatusCode" type="cns:ClearanceStatusCodeType">
        <xs:annotation>
          <xs:documentation>the progress of the individual transaction within the funds clearing process. Transaction is first acknowledged, then in process, then settled or could have status 'clawback', 'partially settled', 'final settlement' or 'write off'.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="ClearanceID_Type">
    <xs:annotation>
      <xs:documentation>Clearance identifier is a character string managed by a carrier.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:pattern value="([0-9]{7}[A-Za-z0-9]{8})"/>
      <xs:length value="15"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ClearanceStatusCodeType">
    <xs:annotation>
      <xs:documentation>Clearance Status code is a character string of letters and numbers.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:pattern value="[A-Za-z0-9]{5}"/>
      <xs:length value="5"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="CodeType">
    <xs:annotation>
      <xs:documentation>A code is a character string of letters, numbers, special characters (except escape sequences), and symbols.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:maxLength value="35"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="DateTimeType">
    <xs:annotation>
      <xs:documentation>A date time identifies a date and time of day to various common resolutions: year, month, week, day, hour, minute, second, and fraction of second.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:dateTime"/>
  </xs:simpleType>
  <xs:complexType name="ErrorType">
    <xs:annotation>
      <xs:documentation>Contains information related to errors detected during processing of the preceding request.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element maxOccurs="1" minOccurs="0" name="Code" type="cns:CodeType">
        <xs:annotation>
          <xs:documentation>The code corresponding to the processing error as defined by PADIS 9321.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="DescText" type="cns:TextType">
        <xs:annotation>
          <xs:documentation>Free text description of the provided error.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="ErrorID" type="cns:ID_Type">
        <xs:annotation>
          <xs:documentation>Unique identifier for this error instance.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="LangCode" type="cns:CodeType">
        <xs:annotation>
          <xs:documentation>Language code associated with the error response.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="OwnerName" type="cns:ProperNameType">
        <xs:annotation>
          <xs:documentation>The name of the organization owning the error codelist.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="StatusText" type="cns:TextType">
        <xs:annotation>
          <xs:documentation>Document processing status. Recommended values are NotProcessed, Incomplete, Complete, Unknown.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="TagText" type="cns:TextType">
        <xs:annotation>
          <xs:documentation>Identifies the tag/XPath which relates to the provided Error.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="TypeCode" type="cns:CodeType">
        <xs:annotation>
          <xs:documentation>Uses a bilaterally agreed set of values to indicate the error type. The validating XSD can expect to accept values that it has not been explicitly coded for and process them by using Type = 'unknown'.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="URL" type="cns:URI_Type">
        <xs:annotation>
          <xs:documentation>Link to an online description of the provided Error.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="FailureReasonCodeType">
    <xs:annotation>
      <xs:documentation>Character string of letters and numbers to describe the reason why a request cannot be performed or an action failed.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:pattern value="[A-Za-z0-9]{7}"/>
      <xs:length value="7"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:complexType name="IATA_PayloadStandardAttributesType">
    <xs:annotation>
      <xs:documentation>The IATA_PayloadStdAttributes defines the standard attributes that appear on the root element for all IATA payloads.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element maxOccurs="1" minOccurs="0" name="AltLangID" type="cns:ID_Type">
        <xs:annotation>
          <xs:documentation>Identifies the alternate language for a customer or message. The human language is identified by ISO 639 codes.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="CorrelationID" type="cns:ID_Type">
        <xs:annotation>
          <xs:documentation>Allow end-to-end correlation of log messages with the corresponding Web service message throughout the processing of the Web service message.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="EchoTokenText" type="cns:TextType">
        <xs:annotation>
          <xs:documentation>A reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message MUST include an echo token with an identical value.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="PrimaryLangID" type="cns:ID_Type">
        <xs:annotation>
          <xs:documentation>Identifies the primary language preference for the message. The human language is identified by ISO 639 codes.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="RetransmissionInd" type="cns:IndType">
        <xs:annotation>
          <xs:documentation>When true, indicates the message is being re-sent after a failure. It is recommended that this attribute is used (i.e., set to true) only when a message is retransmitted.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="SeqNumber" type="cns:NumberType">
        <xs:annotation>
          <xs:documentation>Used to identify the sequence number of the transaction as assigned by the sending system; allows for an application to process messages in a certain order or to request a resynchronization of messages in the event that a system has been off-line and needs to retrieve messages that were missed.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="Timestamp" type="cns:DateTimeType">
        <xs:annotation>
          <xs:documentation>Indicates the creation date and time of the message in UTC.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="TrxID" type="cns:ID_Type">
        <xs:annotation>
          <xs:documentation>A unique identifier to relate all messages within a transaction (e.g. this would be sent in all request and response messages that are part of an on-going transaction).</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="TrxStatusCode" type="cns:CodeType">
        <xs:annotation>
          <xs:documentation>This indicates where this message falls within a sequence of messages.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element maxOccurs="1" minOccurs="0" name="VersionNumber" type="cns:NumberType">
        <xs:annotation>
          <xs:documentation>For all IATA versioned messages, the version of the message is indicated by a decimal value.</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:simpleType name="ID_Type">
    <xs:annotation>
      <xs:documentation>An identifier is a character string used to uniquely identify one instance of an object within an identification scheme that is managed by an agency.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:maxLength value="35"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="IndType">
    <xs:annotation>
      <xs:documentation>An indicator is a list of two mutually exclusive Boolean values that express the only possible states of a property.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:boolean"/>
  </xs:simpleType>
  <xs:simpleType name="NumberType">
    <xs:annotation>
      <xs:documentation>A mathematical number that is assigned or is determined by calculation.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal"/>
  </xs:simpleType>
  <xs:simpleType name="ProperNameType">
    <xs:annotation>
      <xs:documentation>BDT with value constraints for proper, regular names (e.g. Individual Surname, Individual First Name, Company Name, etc.).</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:token">
      <xs:minLength value="1"/>
      <xs:maxLength value="64"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TextType">
    <xs:annotation>
      <xs:documentation>Text is a character string such as a finite set of characters generally in the form of words of a language.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <xs:simpleType name="URI_Type">
    <xs:annotation>
      <xs:documentation>A string of characters used to identify a resource. Such identification enables interaction with representations of the resource over a network, typically the World Wide Web, using specific protocols.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:anyURI"/>
  </xs:simpleType>
</xs:schema>