Инструменты пользователя

Инструменты сайта

  • ru

ChangeSubscriptionEndDate

Параметры

НазваниеТипОписание
montSubscriptionIdstringИдентификатор подписки
endDateDateTime?новая дата окончания действия подписки(в формате DateTime, если дата есть, или пустая строка)

Возвращаемое значение

ТипОписание
SubscriptionContractМодель подписки

Описание

Метод используется для изменения даты окончания подписки. В указанную дату, в конце дня(по московскому времени), подписка будет заблокирована. Если передать в качестве второго параметра значение “null”, то подписка будет автоматически продляться, и её срок действия не будет ограничен.

Ответом метода является полный объект подписки, в котором указано её состояние после вызова метода. Для того, чтобы изменения прошли успешно, новая дата окончания должна быть не раньше дня вызова метода, а подписка должна быть в состоянии “Активна”.

Возможные ошибки

КодТекст ошибки
30Операция не может быть выполнена, попробуйте позже
62Дата автостопа не может быть меньше текущей
74Подписка с указанным кодом не найдена
90Подписка находится в незавершенном состоянии

Пример для XmlOverHttp

запрос

POST https://sandbox.mont.ru/Version2/Service/B2BServiceV2Xml.svc/ChangeSubscriptionEndDate

<?xml version="1.0" encoding="utf-8" ?>
<ChangeSubscriptionEndDate>
  <montSubscriptionId>SUB-001054</montSubscriptionId>
  <endDate>2016-04-05T13:21:28.003</endDate>
</ChangeSubscriptionEndDate>

или

<?xml version="1.0" encoding="utf-8" ?>
<ChangeSubscriptionEndDate>
 <montSubscriptionId>SUB-001054</montSubscriptionId>
 <endDate></endDate>
</ChangeSubscriptionEndDate>

ответ

<?xml version="1.0" encoding="utf-8"?>
<ChangeSubscriptionEndDateResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ChangeSubscriptionEndDateResult>
    <Data>
      <SubscriptionId>SUB-001054</SubscriptionId>
      <DateCreated>2015-08-26T13:28:29.357</DateCreated>
      <StateId>1</StateId>
      <StartDate>2015-09-09T13:43:07.223</StartDate>
      <ActiveTill>2016-04-05T00:00:00</ActiveTill>
      <MontSubscriberId>00000000-0000-0000-0000-000000000000</MontSubscriberId>
      <Quantity>3</Quantity>
      <PartNum>cloud-o365pp</PartNum>
      <SubscriptionUrl>/test/625cb90c-183e-4102-96a4-545f4cd95b89</SubscriptionUrl>
      <BundleId xsi:nil="true"/>
      <Periods>
        <SubscriptionPeriodContract>
          <StartDate>2015-09-09T13:43:07.237</StartDate>
          <StopDate xsi:nil="true"/>
          <Seats>3</Seats>
          <DateCreated>2015-08-26T13:28:29.357</DateCreated>
          <PartNum>cloud-o365pp</PartNum>
        </SubscriptionPeriodContract>
      </Periods>
      <Events>
        <SubscriptionEventContract>
          <DateCreated>2015-09-09T13:43:07.243</DateCreated>
          <StatusId>1</StatusId>
          <PreviousStatusId>4</PreviousStatusId>
          <SubscriptionStopDate xsi:nil="true"/>
          <PreviousSubscriptionEndDate xsi:nil="true"/>
          <Quantity>3</Quantity>
          <PreviousQuantity>3</PreviousQuantity>
          <PartNum>cloud-o365pp</PartNum>
          <PreviousPartNum>cloud-o365pp</PreviousPartNum>
          <IsError>false</IsError>
          <MontSystemId>1</MontSystemId>
          <SubscriptionNum>SUB-001054</SubscriptionNum>
          <ResellerName>testme</ResellerName>
        </SubscriptionEventContract>
        <SubscriptionEventContract>
          <DateCreated>2016-04-03T17:11:08.2873665+03:00</DateCreated>
          <StatusId>1</StatusId>
          <PreviousStatusId>1</PreviousStatusId>
          <SubscriptionStopDate>2016-04-05T00:00:00</SubscriptionStopDate>
          <PreviousSubscriptionEndDate xsi:nil="true"/>
          <Quantity>3</Quantity>
          <PreviousQuantity>3</PreviousQuantity>
          <PartNum>cloud-o365pp</PartNum>
          <PreviousPartNum>cloud-o365pp</PreviousPartNum>
          <IsError>false</IsError>
          <MontSystemId>0</MontSystemId>
          <SubscriptionNum>SUB-001054</SubscriptionNum>
          <ResellerName>testme</ResellerName>
        </SubscriptionEventContract>
      </Events>
      <Source>1</Source>
      <ResellerName>testme</ResellerName>
      <ResellerPrice>7500</ResellerPrice>
      <ResellerCurrency>RUR</ResellerCurrency>
    </Data>
    <IsError>false</IsError>
    <ErrorText/>
    <ErrorCode>0</ErrorCode>
    <Errors/>
  </ChangeSubscriptionEndDateResult>
</ChangeSubscriptionEndDateResponse>

Пример для SOAP

запрос

POST https://sandbox.mont.ru/Version2/Service/B2BServiceV2.svc

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IB2BServiceV2/ChangeSubscriptionEndDate</a:Action>
    <a:ReplyTo>
      <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <a:To s:mustUnderstand="1">https://sandbox.mont.ru/Version2/Service/B2BServiceV2.svc</a:To>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <o:UsernameToken>
        <o:Username>username</o:Username>
        <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</o:Password>
      </o:UsernameToken>
    </o:Security>
  </s:Header>
  <s:Body>
    <ChangeSubscriptionEndDate xmlns="http://tempuri.org/">
      <montSubscriptionId>123</montSubscriptionId>
      <endDate>2015-08-19T13:21:28.003</endDate>
    </ChangeSubscriptionEndDate>
  </s:Body>
</s:Envelope>

ответ

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1">http://tempuri.org/IB2BServiceV2/ChangeSubscriptionEndDate</a:Action>
    <ActivityId CorrelationId="384ab82e-2d4c-40b0-811a-4a4ca2bf5636" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">f0b148c5-fb74-4e21-94ba-1c95f8d5bd76</ActivityId>
    <a:RelatesTo>urn:uuid:17ee9f5b-2680-4337-abce-c8d39006503a</a:RelatesTo>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <u:Timestamp u:Id="_0">
        <u:Created>2015-09-23T13:12:13.550Z</u:Created>
        <u:Expires>2015-09-23T13:17:13.550Z</u:Expires>
      </u:Timestamp>
    </o:Security>
  </s:Header>
  <s:Body>
    <ChangeQuantityOfSubscriptionResponse xmlns="http://tempuri.org/">
      <ChangeQuantityOfSubscriptionResult xmlns:b="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts.Responses" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <b:Data xmlns:c="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts">
          <c:ActiveTill>2015-09-19T00:00:00</c:ActiveTill>
          <c:BundleId i:nil="true"/>
          <c:DateCreated>2015-08-19T13:15:48.677</c:DateCreated>
          <c:Events>
            <c:SubscriptionEventContract>
              <c:DateCreated>2015-08-19T13:16:48.917</c:DateCreated>
              <c:ErrorText i:nil="true"/>
              <c:IsError>false</c:IsError>
              <c:MontSystemId i:nil="true"/>
              <c:PartNum>Sub1</c:PartNum>
              <c:PreviousPartNum>Sub1</c:PreviousPartNum>
              <c:PreviousQuantity>10</c:PreviousQuantity>
              <c:PreviousStatusId>4</c:PreviousStatusId>
              <c:PreviousSubscriptionEndDate>2015-09-19T00:00:00</c:PreviousSubscriptionEndDate>
              <c:Quantity>10</c:Quantity>
              <c:ResellerName>testme</c:ResellerName>
              <c:StatusId>1</c:StatusId>
              <c:SubscriptionNum>SUB-001035</c:SubscriptionNum>
              <c:SubscriptionStopDate>2015-09-19T00:00:00</c:SubscriptionStopDate>
            </c:SubscriptionEventContract>
			...
            <c:SubscriptionEventContract>
              <c:DateCreated>2015-08-19T13:21:28.003</c:DateCreated>
              <c:ErrorText i:nil="true"/>
              <c:IsError>false</c:IsError>
              <c:MontSystemId i:nil="true"/>
              <c:PartNum>Sub1</c:PartNum>
              <c:PreviousPartNum>Sub1</c:PreviousPartNum>
              <c:PreviousQuantity>10</c:PreviousQuantity>
              <c:PreviousStatusId>1</c:PreviousStatusId>
              <c:PreviousSubscriptionEndDate>2015-09-19T00:00:00</c:PreviousSubscriptionEndDate>
              <c:Quantity>10</c:Quantity>
              <c:ResellerName>testme</c:ResellerName>
              <c:StatusId>6</c:StatusId>
              <c:SubscriptionNum>SUB-001035</c:SubscriptionNum>
              <c:SubscriptionStopDate>2015-09-19T00:00:00</c:SubscriptionStopDate>
            </c:SubscriptionEventContract>
          </c:Events>
          <c:MontSubscriberId>76bc02e3-c74c-4fee-ad13-b97a3b49b57d</c:MontSubscriberId>
          <c:ParentSubscriptionId i:nil="true"/>
          <c:PartNum>Sub1</c:PartNum>
          <c:Periods>
            <c:SubscriptionPeriodContract>
              <c:DateCreated>2015-08-19T13:15:48.677</c:DateCreated>
              <c:PartNum>Sub1</c:PartNum>
              <c:Seats>10</c:Seats>
              <c:StartDate>2015-08-19T13:16:48.897</c:StartDate>
              <c:StopDate>2015-08-19T13:22:03.173</c:StopDate>
            </c:SubscriptionPeriodContract>
          </c:Periods>
          <c:ProductName>TestSubscription1</c:ProductName>
          <c:Quantity>10</c:Quantity>
          <c:RegistrationProfile xmlns:d="http://schemas.datacontract.org/2004/07/WebStore2.B2B.Version2.Contracts.Subscriber">
            <d:ActivationDate>2015-08-06T11:49:17.403</d:ActivationDate>
            <d:IsActivated>true</d:IsActivated>
            <d:Login i:nil="true"/>
            <d:Password i:nil="true"/>
            <d:RegFields>
              <d:RegItemContract>
                <d:ClientVisible>true</d:ClientVisible>
                <d:FieldName>DomainPrefix</d:FieldName>
                <d:FieldTitle/>
                <d:FieldValue>Develop66</d:FieldValue>
              </d:RegItemContract>
              ...
              <d:RegItemContract>
                <d:ClientVisible>false</d:ClientVisible>
                <d:FieldName>VendorUniqKey</d:FieldName>
                <d:FieldTitle/>
                <d:FieldValue>Develop66</d:FieldValue>
              </d:RegItemContract>
            </d:RegFields>
            <d:Supplier>CREST</d:Supplier>
          </c:RegistrationProfile>
          <c:ResellerName>testme</c:ResellerName>
          <c:Source>0</c:Source>
          <c:StartDate>2015-08-19T13:16:48.833</c:StartDate>
          <c:StateId>7</c:StateId>
          <c:SubscriptionId>SUB-001035</c:SubscriptionId>
          <c:SubscriptionItems>
            <c:SubscriptionItemContract>
              <c:CreateDate>2015-08-19T13:15:48.677</c:CreateDate>
              <c:PartNum>Sub1</c:PartNum>
              <c:ResourceUrl>/test/d88947ad-4480-4594-836f-5f6f47948d78</c:ResourceUrl>
              <c:SeatQuantity>10</c:SeatQuantity>
            </c:SubscriptionItemContract>
          </c:SubscriptionItems>
          <c:SubscriptionUrl>/test/d88947ad-4480-4594-836f-5f6f47948d78</c:SubscriptionUrl>
          <c:VendorName>Microsoft</c:VendorName>
        </b:Data>
        <b:ErrorCode>0</b:ErrorCode>
        <b:ErrorText i:nil="true"/>
        <b:Errors/>
        <b:IsError>false</b:IsError>
      </ChangeQuantityOfSubscriptionResult>
    </ChangeQuantityOfSubscriptionResponse>
  </s:Body>
</s:Envelope>