Business Policies
Retrieve and display the organisation’s saved business policies with the DOM Package
Business policies come from Settings → Business Policies in the Tiquo dashboard. The DOM Package reads the saved policies belonging to the organisation that owns your Website SDK public key. Customer sign-in is not required; the Website SDK must be enabled and your website domain must be allowed in its configuration.
Find a policy ID
Open a policy's … menu in Business Policies and select Copy ID.
| Built-in policy | ID |
|---|---|
| Refund Policy | refund-policy |
| Privacy Policy | privacy-policy |
| Terms of Service | terms-of-service |
Custom policies use their existing stable IDs. Copy the ID from the policy menu rather than deriving it from the title. Renaming a custom policy does not change its ID or break an existing integration.
Retrieve policies
Use an initialized Tiquo instance from Setup:
const { policies } = await tiquo.getPolicies();
const terms = await tiquo.getPolicy('terms-of-service');getPolicies() returns an object containing a policies array. Each entry has the
exported TiquoBusinessPolicy shape:
interface TiquoBusinessPolicy {
id: string;
title: string;
content: string;
}Policies with empty or whitespace-only content are omitted. getPolicy(id) returns
the matching policy or null if the ID is unknown or the policy has no content.
These methods fetch saved policy data on each call.
Display a policy
Add a dedicated container to your page:
<div id="terms"></div>Then pass the element and copied policy ID to displayPolicy():
const container = document.getElementById('terms');
if (container) {
try {
const policy = await tiquo.displayPolicy(container, 'terms-of-service');
if (!policy) container.textContent = 'This policy is not available.';
} catch {
container.textContent = 'Unable to load this policy. Please try again.';
}
}displayPolicy(element, id) returns the policy or null. It replaces the
container's contents using textContent and sets white-space: pre-wrap to
preserve line breaks. HTML or Markdown in a policy is displayed as plain text.
An unknown or empty policy clears the container.
You can also use getPolicy() to render the title and content in your own UI.
Render content as text rather than inserting it as HTML.
Errors
A non-success HTTP response rejects with TiquoAuthError, code
GET_POLICIES_FAILED, and the response's statusCode. Network errors also reject
the promise. Handle failures in your UI and call the method again to retry.
For websites using the hosted script, see Hosted Package business policies.