<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:documentation>Title: Export Coupon Usage Summary - request schema</xs:documentation>
    <xs:documentation>Provide summarised usage data for the supplied coupon in the supplied period.</xs:documentation>
    <xs:documentation>Version 1.0 : 2018-04-20.  Initial schema creation.</xs:documentation>
  </xs:annotation>
  <xs:element name="export">
    <xs:complexType>
      <xs:all>
        <xs:element minOccurs="0" maxOccurs="1" name="pagination">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="0" maxOccurs="1" name="page">
                <xs:annotation>
                  <xs:documentation>The page number of the page of results to be returned.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:integer">
                    <xs:minInclusive value="1" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="pagesize">
                <xs:annotation>
                  <xs:documentation>The number of items to be returned in a page.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:integer">
                    <xs:maxInclusive value="500" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:all>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" maxOccurs="1" name="filters">
          <xs:complexType>
            <xs:all>
              <xs:element minOccurs="1" maxOccurs="1" name="couponkey">
                <xs:annotation>
                  <xs:documentation>The unique coupon key assigned to the coupon.  The key is created automatically by Promo when creating your coupon.  To view the key navigate to the Coupon in the Promo Administration Portal.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:minLength value="1" />
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="couponname">
                <xs:annotation>
                  <xs:documentation>The name of the coupon to provide summarised usage data for.</xs:documentation>
                </xs:annotation>
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="1000" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="channels">
                <xs:annotation>
                  <xs:documentation>Where required, provide a list of channels to filter the summarised usage data for.</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                  <xs:sequence>
                    <xs:element minOccurs="0" maxOccurs="unbounded" name="channel" type="xs:string" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="year" type="xs:integer">
                <xs:annotation>
                  <xs:documentation>The year to provide summarised data for.  If omitted, the current year will be used.</xs:documentation>
                </xs:annotation>
              </xs:element>
              <xs:element minOccurs="0" maxOccurs="1" name="month" type="xs:integer">
                <xs:annotation>
                  <xs:documentation>The month to provide summarised data for.  If omitted, the current month will be used.</xs:documentation>
                </xs:annotation>
              </xs:element>
            </xs:all>
            <xs:attribute name="lowpriority" type="xs:boolean" use="optional">
              <xs:annotation>
                <xs:documentation>Flag for internal system use only</xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:all>
      <xs:attribute name="companykey" use="optional">
        <xs:annotation>
          <xs:documentation>The company key assigned to your company.  To view the company key navigate to Configuration / Manage Company.</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="200" />
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:anyAttribute processContents="skip" />
    </xs:complexType>
  </xs:element>
</xs:schema>