Filtering is the way a request XML packet indicates the object (one or several reseller accounts) to which an operation is to be applied. Parameters nested in the filter node are called filtering rule.

The filter node is presented by the ResellerSelectionFilter complex type (reseller.xsd). This data type is structured as follows:

image 60418

  • The id node is optional. It specifies the reseller ID. Data type: id_type (common.xsd).
  • The login node is optional. It specifies the reseller login. Data type: string.
  • The guid node is optional. It specifies the reseller GUID. Data type: none.
  • The all node is optional. It is used for applying an operation for all resellers. Data type: none.
  • The external-id node is optional. It specifies a reseller GUID in the Panel components (for example, Business Manager). Data type: string.

Several resellers can be filtered either by their IDs or by their logins with one filter node, mixing the id and login nodes within the same filter node is prohibited.

The following packet removes three reseller accounts specified by their id:

<packet version="1.6.0.0">
<reseller>
<del>
   <filter>
      <id>24</id>
      <id>25</id>
      <id>27</id>
   </filter>
</del>
</reseller>
</packet>

The following packet is identical except it specifies reseller accounts by name:

<packet version="1.6.0.0">
<reseller>
<del>
   <filter>
      <login>JohnDoe</login>
      <login>JaneDoe</login>
      <login>RichardRoe</login>
   </filter>
</del>
</reseller>
</packet>

The following packet removes all reseller accounts:

<packet version="1.6.0.0">
<reseller>
<del>
   <filter>
      <all/>
   </filter>
</del>
</reseller>
</packet>

The following packet is invalid as both the id node and the login node are used in the same filter:

<packet version="1.6.0.0">
<reseller>
<del>
   <filter>
      <login>JohnDoe</login>
      <id>25</id>
      <login>RichardRoe</login>
   </filter>
</del>
</reseller>
</packet>

To fix this problem, use two different <del> sections:

<packet version="1.6.0.0">
<reseller>
<del>
   <filter>
      <login>JohnDoe</login>
      <login>RichardRoe</login>
   </filter>
</del>
<del>
   <filter>
      <id>25</id>
   </filter>
</del>
</reseller>
</packet>