Embed snippet
Drop one <script> tag on any page and turn any button into a PAID checkout
trigger. No framework required.
Install
Add the script to the bottom of <body> on any page where you want PAID checkout:
<script async src="https://paid.trustfabric.ai/v1/embed.js"></script>
Declarative usage
Attach data-paid-checkout to any element and PAID will turn it into a checkout
trigger. The element's attributes describe the charge.
<button data-paid-checkout
data-account="acct_yourmerchantid"
data-amount="4999"
data-currency="usd"
data-sku="pro-plan">
Pay $49.99
</button>
<script async src="https://paid.trustfabric.ai/v1/embed.js"></script>Supported attributes
| Attribute | Type | Required | Description |
|---|---|---|---|
data-paid-checkout | flag | yes | Marks the element as a PAID checkout trigger. |
data-account | string | yes | Your merchant account ID (find it in Dashboard → API Key). |
data-amount | integer (cents) | yes | Charge amount, in the smallest unit of the currency. |
data-currency | ISO 4217 | yes | Currency code, e.g. usd. |
data-sku | string | no | Your product SKU, returned on the webhook. |
data-customer-email | no | Pre-fill on the checkout page. | |
data-success-url | URL | no | Redirect on success. Defaults to current page with ?paid=ok. |
data-mode | redirect | modal | no | Default is modal. |
Programmatic usage
For dynamic prices or A/B experiments, call paid.checkout() directly:
// Programmatically open PAID checkout.
// Load the embed script first — it attaches window.Paid (it is not
// an ES module and there is no npm package):
// <script async src="https://paid.trustfabric.ai/v1/embed.js"></script>
const paid = window.Paid("acct_yourmerchantid");
document.getElementById("buy").addEventListener("click", async () => {
await paid.checkout({
amount: 4999,
currency: "usd",
sku: "pro-plan",
onSuccess: (result) => console.log("paid", result),
onCancel: () => console.log("cancelled"),
});
});Configuration via the account ID
The data-account value is a public identifier for your merchant account. It can
only create sessions on your account, and cannot read or modify any other data. Find it in Dashboard → API Key, in the account summary card.
Never put a
sk_live_… secret key in browser code. Use data-account for
the embed, and authenticate with the secret key only from your server.