Renew/Upgrade/Downgrade Plan
This endpoint adds/renews/upgrades/downgrades the billing plans associated with a group. All documents processed in that group will count towards the selected billing plan regardless of the number of workflows being used.
Document Processing Impact: When upgrading/downgrading plans, use the purge parameter to decide what happens to documents that were on hold due to processing limits. Choose process to release them or delete to remove them permanently.
POST Parameters
| Parameter | Required | Value | Description |
|---|---|---|---|
api_key | {key} | An API key that has access to the resource you want to query for | |
group_id | {integer} | The group that the billing plan is to be applied to. Required if applying the plan to a sub-group. | |
plan_id | {integer} | The plan to be applied to the group. | |
purge | - delete - process | Decide what to do with the documents placed on hold due to the processing limit being met as they can be released as part of renewal/upgrade. |
Response Information
| Element | Description |
|---|---|
<status> | An integer (200) as to whether the operation succeeded. |
<message> | Additional information about the operation. If the <result> was false this will provide brief information about the <error_code> as well as additional supplemental information about the specific query. |
<id> | Plan id used. |
<plan_name> | |
<plan_type> | Monthly or annual. |
<allowed_documents> | The maximum number of documents allowed to be processed during the “plan_type”. |
<used_documents> | The number of documents used at the time of the request. |
<price> | |
<start_date> | |
<expiry_date> |
Example
Sample Request
POST https://api-app.xtracta.com/v1/billings/update HTTP/1.1 api_key=123&group_id=123&plan_id=111
Sample Response
<?xml version="1.0" encoding="UTF-8"?> <billings_response> <status>200</status> <message>The new billing plan is assigned successfully</message> <plan> <id>1111</id> <plan_name>Test Plan</plan_name> <plan_type>Monthly</plan_type> <allowed_documents>1000</allowed_documents> <used_documents>0</used_documents> <price>500</price> <start_date>2018-03-27T01:11:18+00:00</start_date> <expiry_date>2018-04-27T02:11:17+00:00</expiry_date> </plan> </billings_response>
Schema Definition
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:simpleType name="ConfidenceType">
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value=""/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
<xs:complexType name="PlanType">
<xs:sequence>
<xs:element name="id" type="xs:positiveInteger"/>
<xs:element name="plan_name" type="xs:string"/>
<xs:element name="plan_type" type="xs:string"/>
<xs:element name="allowed_documents" type="xs:nonNegativeInteger"/>
<xs:element name="used_documents" type="xs:nonNegativeInteger"/>
<xs:element name="price" type="xs:decimal"/>
<xs:element name="start_date" type="xs:string"/>
<xs:element name="expiry_date" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="billings_response">
<xs:complexType>
<xs:sequence>
<xs:element name="status" type="xs:positiveInteger" minOccurs="0"/>
<xs:element name="message" type="xs:string"/>
<xs:element name="plan" type="PlanType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>