История заказов

From PonyExpress API Wiki
Jump to: navigation, search

Запрос истории заказов

<?xml version="1.0" encoding="utf-8"?>
<Request xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="HistoryRequest">
  <Id>3</Id>  
  <DateFrom>2016-10-02T00:00:00+03:00</DateFrom>
  <DateTo>2016-11-03T00:00:00+03:00</DateTo>
  <StatusesMode>ByKey</StatusesMode>  <!--  Режим запроса статусов: ByKey (по-умолчанию, можно опустить) – статусы по ключу, ByContract – по всем заказам договора ключа запроса ->
</Request>

</Request>

Ответ на запрос истории заказов

<?xml version="1.0" encoding="utf-8"?>
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <RequestId>3</RequestId>  
  <OrderList>
    <Order>      
      <PerformersNumber>MOW-123243</PerformersNumber>      
      <ServiceList>
        <Service xsi:type="DeliveryService">
          <StatusList>
            <ServiceStatus xsi:type="DeliveryStatus">
              <Description>Picked up from client</Description>
              <Date>2016-11-01T09:37:19.3971808+03:00</Date>              
              <Code>PickedUp</Code>
              <Id>0</Id>            
            </ServiceStatus>
            <ServiceStatus xsi:type="DeliveryStatus">
              <Description>Debited to sender point hub</Description>
              <Date>2016-11-01T11:37:19.3971808+03:00</Date>              
              <Code>Debited</Code>
              <Id>0</Id>            
              </ServiceStatus>
            <ServiceStatus xsi:type="DeliveryStatus">
              <Description>Issued to last mile</Description>
              <Date>2016-11-01T11:37:19.3971808+03:00</Date>              
              <Code>OnLastMile</Code>
              <Id>0</Id>            
            </ServiceStatus>
            <ServiceStatus xsi:type="DeliveryStatus">
              <Description>Delivered</Description>
              <Date>2016-11-01T13:37:19.3971808+03:00</Date>              
              <Code>Delivered</Code>
              <Id>0</Id>            
            </ServiceStatus>
          </StatusList>          
          <Waybill>
            <Number>11-1111-1111</Number>          
          </Waybill>
        </Service>
        <Service xsi:type="SMSInfoService">
          <StatusList>
            <ServiceStatus xsi:type="SMSInfoStatus">
              <Description>SMS has been sent</Description>
              <Date>2016-11-01T11:47:19.3971808+03:00</Date>              
              <Code>Sent</Code>
            </ServiceStatus>
          </StatusList>
          <Mode>LastMile</Mode>
        </Service>
        <Service xsi:type="SMSInfoService">
          <StatusList>
            <ServiceStatus xsi:type="SMSInfoStatus">
              <Description>SMS has been sent</Description>
              <Date>2016-11-01T13:47:19.3971808+03:00</Date>              
              <Code>Sent</Code>
            </ServiceStatus>
          </StatusList>
          <Mode>Delivered</Mode>
        </Service>
        <Service xsi:type="SalesMediationService">
          <StatusList>
            <ServiceStatus xsi:type="SalesMediationStatus">
              <Description>Commodities have been sold. Lots: 1</Description>
              <Date>2016-11-01T13:47:19.3971808+03:00</Date>              
              <Code>Sold</Code>
              <LotList>
                <string>1</string>
              </LotList>
            </ServiceStatus>
            <ServiceStatus xsi:type="SalesMediationStatus">
              <Description>Commodities have been refused. Lots: 2</Description>
              <Date>2016-11-01T13:47:19.3971808+03:00</Date>              
              <Code>Refused</Code>
              <LotList>
                <string>2</string>
              </LotList>
            </ServiceStatus>
          </StatusList>        
        </Service>
      </ServiceList>
      <StatusList>
        <OrderStatus>
          <Description>Order has been received</Description>
          <Date>2016-10-31T08:37:19.3971808+03:00</Date>          
          <Code>Received</Code>
        </OrderStatus>
        <OrderStatus>
          <Description>Order has been updated</Description>
          <Date>2016-10-31T09:07:19.3971808+03:00</Date>          
          <Code>Updated</Code>
        </OrderStatus>
        <OrderStatus>
          <Description>Order is processing</Description>
          <Date>2016-10-31T09:37:19.3971808+03:00</Date>          
          <Code>Processing</Code>
        </OrderStatus>
      </StatusList>
    </Order>
  </OrderList>
  <MessageList>
    <ResponceMessage>
      <IsError>false</IsError>
      <Text>Request completed</Text>
    </ResponceMessage>
  </MessageList>
</Response>