Use the remove-subscription operation to detach an add-on plan from a subscription.

Request Packet Structure

A request XML packet that detaches an add-on from a subscription includes the remove-subscription operation node:

<packet version="1.6.3.0">
<webspace>
   <remove-subscription>
   ...
   </remove-subscription>
</webspace>
</packet>

The remove-subscription node (domain_input.xsd) has the following graphical representation:

image 66378

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies a filtering rule. For info on filters, refer to the Filters of Descriptors section. Data type: domainFilterType (domain_input.xsd).
  •  The plan-guid node is optional. It specifies the GUID of an add-on plan that will be added to the subscription. Data type: string.
  •  The plan-external-id node is optional. It specifies the ID of a service plan in the Panel components (for example, Business Manager). Data type: string.

Response Packet Structure

The remove-subscription node of the output XML packet is structured as follows:

image 66381

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the response retrieved from the server. Data type: ResultFilterType (plesk_common.xsd).
  • The status node is required. It specifies the execution status of the operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return the error code when the operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return the error message if the operation fails. Data type: string.
  • The filter-id node is optional. It is required if the operation succeeds. Returns either subscription name, subscription ID, customer name, or customer ID depending on a way of descriptor’s specification in the request packet. For info on filters, refer to the Filters of Descriptors section. Data type: anySimple.
  • The id node is optional. It is required if the operation succeeds. Returns the unique identifier of the subscription. Data type: integer.
  • The problems node is optional. It outputs conflicts that occur on attaching the add-on plan. Data type: string.

Samples

The request packet that removes an add-on plan with GUID cc982f71-48c3-479d-bc7b-59b97547e092 from a subscription with ID 8 looks as follows:

<packet version ="1.6.3.0">
<webspace>
   <remove-subscription>
      <filter>
         <id>8</id>
      </filter>
       <plan-guid>cc982f71-48c3-479d-bc7b-59b97547e092</plan-guid>
   </remove-subscription>
</webspace>
</packet>

Response (when you detach an add-on that requires Webmail and Horde):

<packet version="1.6.3.0">
  <webspace>
    <remove-subscription>
      <result>
        <status>ok</status>
        <filter-id>8</filter-id>
        <id>8</id>
        <problems>Description           Current Requested Allowed
Webmail (example.com) None    Horde IMP None</problems>
      </result>
    </remove-subscription>
  </webspace>
</packet>