For developers
Selling through your store: Tebex, BuiltByBit, Voxel Shop, Stripe
Connect the store you sell on to your workspace. When someone buys a linked product, Latch gives their account access to the script or bundle, and takes it back after a refund. For a checkout Latch doesn't connect to directly, use a custom webhook.
Store integrations are part of Pro and above. You keep selling on your store as before; Latch isn't a store and takes no cut of your sales. It only turns purchases into access.
Connect a store
In your workspace, open Manage › Stores and press the connect button next to your store (Tebex, BuiltByBit, Voxel Shop, Stripe or Custom webhook). Connecting, disconnecting and switching test mode need permission to change workspace settings; linking products and seeing orders need permission to manage access.
Test mode
A new connection starts in Test mode; press Go live when the setup works. In Test mode, purchases are recorded and matched to accounts but give no access. The request list shows which scripts and bundles each test purchase would give and which account it matched. Try the setup with a test purchase, then switch to Live.
Tebex setup
- 1In Tebex, open Developers › Webhooks › Endpoints, choose Add endpoint and paste the webhook URL from the Stores page.
- 2Select the events
payment.completed,payment.refunded,payment.dispute.opened,payment.dispute.won,payment.dispute.lostandrecurring-payment.ended. - 3Copy the secret Tebex shows for the endpoint and save it on the Stores page. Requests are rejected until a secret is saved.
- 4Click Validate in Tebex. The Stores page shows when the endpoint was validated.
- 5Under Products, link each Tebex package ID to a script or bundle.
latch_account to your packages. Buyers who fill in their account ID (like LA-7K2M-9QXD) get access on that account right away.BuiltByBit setup
BuiltByBit doesn't share buyers' emails, so each download carries a personal claim link instead. Two things are set up in the creator dashboard:
- 1Open Creator dashboard › Webhooks and create a webhook with the trigger [Resources] Purchase. Use the webhook URL from the Stores page, the content type
application/jsonand the body shown there. The body contains your secret. - 2Open Creator dashboard › Anti-piracy placeholders and create a placeholder with the placeholder URL and secret from the Stores page.
- 3Put the placeholder in a text file inside your download, for example
CLAIM.txt. When someone downloads, BuiltByBit asks Latch for that buyer's claim link and writes it into the file. - 4Under Products, link each resource ID to a script or bundle. For an add-on, use
addon:followed by its ID.
If you create a new secret on the Stores page, the old one stops working. Update it in both the webhook body and the placeholder.
A ready CLAIM.txt for your download (replace the placeholder with yours):
Thanks for your purchase.
This resource is protected by Latch. To get access:
1. Open your personal link: %%__YOUR_PLACEHOLDER__%%
2. Sign in to Latch or create a free account.
3. Download the resource from your Library and start your server with your license key.
The link is personal and works once. If it has expired, download the resource again later for a new one.
Install guide: https://heylatch.app/docs/install
Protected by Latch - https://heylatch.app
BuiltByBit's rules (5.2.2) require a resource that needs license activation to say so in its Dependencies tab. You can paste this:
Requires a free Latch account (https://heylatch.app). This resource is delivered and licensed through Latch: after buying, open the personal link in CLAIM.txt from your download to link the purchase to your Latch account, then download it from your Latch Library and start your server with your license key. The server checks its license with heylatch.app when it starts and while it runs.Voxel Shop setup
Voxel Shop (formerly Polymart) doesn't share buyers' emails either, so each download carries a personal claim link, like on BuiltByBit. The difference: refunds and chargebacks are reported too. Voxel Shop creates separate secrets for each product, so you enter them when you link the product.
- 1On Voxel Shop, open the product, choose Webhooks and add one with the webhook URL from the Stores page. Copy the webhook secret it shows.
- 2In the product's Security section, add a custom placeholder of type External API with the placeholder URL from the Stores page. Copy its API signing secret.
- 3Under Products, link the product ID to a script or bundle and enter both secrets. Entering secrets needs permission to change workspace settings.
- 4Put the placeholder in a text file inside your download, for example
CLAIM.txt, and mention the licensing in the product description. - 5Send a ping from the product's Webhooks page; the Stores page shows that it arrived.
Thanks for your purchase.
This resource is protected by Latch. To get access:
1. Open your personal link: %%__LATCH_CLAIM__%%
2. Sign in to Latch or create a free account.
3. Download the resource from your Library and start your server with your license key.
The link is personal and works once. If it has expired, download the resource again later for a new one.
Install guide: https://heylatch.app/docs/install
Protected by Latch - https://heylatch.app
Replace %%__LATCH_CLAIM__%% with the name of the placeholder you created. Text you can add to the product description:
This product is delivered and licensed through Latch (https://heylatch.app). After buying, open the personal link in CLAIM.txt from your download to link the purchase to a free Latch account, then download it from your Latch Library and start your server with your license key. The server checks its license with heylatch.app when it starts and while it runs.Stripe setup
- 1In the Stripe Dashboard, open Developers › Webhooks, add an endpoint with the URL from the Stores page and select these events:
checkout.session.completed,checkout.session.async_payment_succeeded,charge.refunded,charge.dispute.created,charge.dispute.closed,customer.subscription.deleted. - 2Save the endpoint's signing secret (
whsec_…) on the Stores page. - 3Under Products, link each Payment Link by its ID (
plink_…). If you create Checkout Sessions in your own code, set thelatch_productmetadata to a product key and link that key.
const session = await stripe.checkout.sessions.create({
mode: "payment",
line_items: [{ price: "price_123", quantity: 1 }],
client_reference_id: "LA-7K2M-9QXD", // the buyer's Latch account ID, if you have it
metadata: { latch_product: "pro-pack" },
success_url: "https://example.com/thanks",
})client_reference_id (a Payment Link takes ?client_reference_id=LA-7K2M-9QXD in its address). Access goes to that account. A partial refund doesn't end access; a full refund does.Custom webhook (your own checkout)
If you sell through PayPal, Gumroad or your own site, your checkout (or a tool like Zapier or n8n) sends Latch a signed request for each event. The Stores page gives you the URL and the signing secret. The signature is a Latch-Signature: t=<unix seconds>,v1=<hex> header, where v1 is the HMAC-SHA256 of t, a dot and the raw body, keyed with the secret. Requests more than 5 minutes off are rejected.
purchase: needsorder,products(the product keys you link) andbuyer.accountIdorbuyer.email. Optional:buyer.name, andsubscriptionfor subscriptions.refundandchargeback: needorder; the access that order gave ends.subscription_ended: needs thesubscriptionyou sent with the purchase.ping: tests the setup; Latch answers 200.
import { createHmac } from "node:crypto"
const body = JSON.stringify({
event: "purchase",
order: "A-1001",
products: ["pro-pack"],
buyer: { accountId: "LA-7K2M-9QXD", email: "buyer@example.com", name: "Alex" },
})
const t = Math.floor(Date.now() / 1000)
const v1 = createHmac("sha256", process.env.LATCH_STORE_SECRET).update(`${t}.${body}`).digest("hex")
await fetch("https://api.heylatch.app/integrations/custom/<connection>", {
method: "POST",
headers: { "Content-Type": "application/json", "Latch-Signature": `t=${t},v1=${v1}` },
body,
})How buyers are matched
- Account ID: the
latch_accountvariable on Tebex,client_reference_idon Stripe,buyer.accountIdon a custom webhook. When it's there, access goes to that account. - Verified email (Tebex, Stripe, custom webhook): otherwise Latch looks for an account with the same verified email.
- Claim link: if no account matches, Latch emails the buyer a link to sign in and link the purchase. BuiltByBit and Voxel Shop buyers open the link written into their download.
- A purchase can be linked to one Latch account. Once a buyer is linked, their later purchases go to the same account.
The Orders list shows each order's buyer and whether they're linked to a Latch account yet.
Purchased access is locked
Your team can't remove access a buyer got through a store: not on the Stores page, not on a script's Access tab, not through the API and not from a bundle. That way access can't be taken back after the money is paid. Purchased access is marked with the store's name on the Access tab and in a bundle's account list.
- A bundle someone bought through a store can't be deleted and its scripts can't be removed. Adding scripts is fine.
- The access only ends when the store reports a refund, chargeback or ended subscription, or when the Latch team ends it.
Refunds and ended orders
- Tebex and Stripe: refunds, chargebacks, opened disputes and ended subscriptions end the order and remove the access it gave. A won dispute restores it.
- Voxel Shop: when a purchase is removed after a refund or chargeback, the order ends.
- Custom webhook: the
refund,chargebackandsubscription_endedevents end the order. - BuiltByBit: refunds aren't reported to Latch. After you refund someone, open a support ticket with their BuiltByBit user and the Latch team ends the access their order gave.
- Wrong account: if a BuiltByBit claim link was used by someone else, for example through a leaked download, open a support ticket. The Latch team unlinks that account and the buyer links the right one with a new link.
- You can restore an ended order on the Stores page. When an order ends, access is only removed if no other active order covers the same script or bundle, and access you gave by hand isn't touched.
Products linked later
When you link a product, its earlier orders get access too. Removing a link takes back the access it gave, unless another active order covers it.
Disconnecting
Disconnecting stops Latch from accepting requests from that store and deletes its product links, orders and events. Access already given stays.