Use the set-billing-info operation to save in the Plesk database the financial information displayed in Control Panel for specified subscriptions.

Request Packet Structure

A request XML packet that saves financial information for a subscription to Plesk database includes the set-billing-info operation node:

<packet>
<webspace>
   <set-billing-info>
   ...
   </set-billing-info>
</webspace>
</packet>

The set-billing-info node (type setBillingInfoInput, domain_input.xsd) has the following graphical representation:

image 66409

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 values node is required. It s pecifies the list of financial details you can set for a subscription. Data type: none. It contains nodes described next in this section. You should add at least one of the nodes to your packet.
  • The price node is optional. It specifies the subscription price. Data type: clientPriceInput. See the structure of this node below.
  • The currency node is required. A three-letter currency name that conforms to ISO 4217 (for example, USD). Data type: string.
  • The sum node is required. It specifies the parameter value. Data type: string.
  • The renewal-date node is optional. It specifies the next renewal date in format ISO 8601. Data type: string.
  • The cycle node is optional. It specifies the billing cycle duration in format ISO 8601. Data type: string.
  • The domain-store-url node is optional. When a user adds a domain in the Control Panel, they are offered to register these domain name. If the user agrees, they are redirected to a URL set by the domain-store-url node. This parameter is relevant only in case your Plesk is integrated with a billing solution other than Business Manager. For example, Odin Business Automation Standard. Data type: string.
  • The cert-store-url node is optional. When a user adds an SSL/TLS certificate in the Control Panel, they are offered to purchase the certificate. If the user agrees, they are redirected to a URL set by the cert-store-url node. This parameter is relevant only in case your Plesk is integrated with a billing solution other than Business Manager. For example, Odin Business Automation Standard. Data type: string.

Response Packet Structure

The set-billing-info node of the output XML packet is structured as follows:

image 66412

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.

Samples

The following packet requests to save to Plesk database the subscription price, billing cycle (1 month), and next renewal date.

<packet>
  <webspace>
    <set-billing-info>
      <filter>
        <external-id>0c1bd35a-1abe-42da-b98c-e4af6d87c94d</external-id>
      </filter>
      <values>
        <price>
          <currency>USD</currency>
          <sum>10.00</sum>
        </price>
        <renewal-date>2010-12-22T14:33:12+0600</renewal-date>
        <cycle>P1MT</cycle>
      </values>
    </set-billing-info>
  </webspace>
</packet>

A response from the server can look as follows.

<packet version="1.6.3.0">
  <webspace>
    <set-billing-info>
      <result>
        <status>ok</status>
        <filter-id>9</filter-id>
        <id>9</id>
      </result>
    </set-billing-info>
  </webspace>
</packet>