Open Billing UI

Endpoint:

This endpoint allows you to open the billing UI page to view through the API for a group based on the group API Key.

Information Circle

Pre-authenticated URL: This endpoint returns a temporary URL that provides direct access to the billing interface without requiring separate login credentials.

POST Parameters

ParameterRequiredValueDescription
api_key{key}An API key that has access to the resource you want to query for
purgedelete, processDecides what to do with any documents pending when altering the billing plan
expire{integer}A time in seconds for the expiry period of the pre-logged-in URL. Default is 600 (10 minutes), maximum is 259,200 (3 days)

Code Examples

The cURL, PHP, Python, Node.js, and C# examples call Xtracta from a trusted server. The React example calls an application-defined backend proxy so the API key is never exposed in browser code.

Warning

Store XTRACTA_API_KEY as a server-side environment variable. Never embed it in browser-delivered code.

curl --request POST 'https://api-app.xtracta.com/v1/billings/billing_ui' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'api_key=<API_KEY>' \
  --data-urlencode 'expire=600'

Sample Request

POST https://api-app.xtracta.com/v1/billings/billing_ui HTTP/1.1
api_key=123&expire=600

Sample Response

<?xml version="1.0" encoding="UTF-8"?>
<billings_response>
    <status>200</status>
    <message>The request has been successfully processed</message>
    <url>https://api-app.xtracta.com/v1/billings/index.html?t=dc51PzHjXgHBF.ZjapmmxZep_Gn9kkHs5tVSyRa0GE41Hs_9AN0GW9szsxplrnV_LbLqd0HStob7_rUj9.JMAsPnn0ZiQFXZ6_qpjxEoj9Yn0Dgk7CorJlEmJyQC6oBDNjW5CfqvwdI-</url>
    <expire>1522895794</expire>
</billings_response>

Schema Definition

Response Elements

ElementDescription
<status>A status code in response to the operation.
<message>Additional information about the operation – human readable.
<url>The URL which your user can open their browser with to view and process their billing information. Usually you would open a new browser window with this URL.
<expire>The time the URL will expire. This is expressed in UNIX time

Example

<?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: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="url" type="xs:anyURI" minOccurs="0"/>
      <xs:element name="expire" type="xs:nonNegativeInteger" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

</xs:schema>

Error Responses

For JSON and XML responses generated by this endpoint, the response is wrapped in billings_response and includes the HTTP status code and a message.

StatusMessageDescription
400expire must be natural number / expire must be greater than ... / expire must be less than ...Supply a positive expiry duration within the configured URL-expiry range.
400redirect must be '0' or '1'Use 0 to return the URL or 1 to redirect.
400group_id must be natural numberUse a positive integer group ID.
500Internal server error occurred. Please try again later or contact support@xtracta.comRetry and contact support with the request parameters and timestamp if it persists.
Information Circle

Authentication, permission, IP-access-control, and rate-limit failures can be returned before this endpoint processes the request. Confirm the API key and caller access first.