> For the complete documentation index, see [llms.txt](https://docs.ohalee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ohalee.com/products/obsidian-license/marketplace-automation.md).

# Marketplace Automation

You don't have to create a license per sale. Each developer connects their **own** marketplace integration from the dashboard — there is no shared/global secret. A purchase auto-issues a key; a refund/chargeback auto-revokes it.

## BuiltByBit

1. **Map the product** — set its **BuiltByBit resource ID** on the product (Products dialog).
2. **Connect** — open **Integrations → Connect BuiltByBit**. This generates your private **webhook URL** and **secret** (both resettable). Requires a plan with marketplace integrations enabled.
3. **Create the webhook on BuiltByBit** (Webhooks → Create):
   * Trigger **Purchase**, Template **Custom**, Method **POST**, Content type **application/json**.
   * URL = your **webhook URL** — the exact per-tenant URL is shown in your dashboard (`https://license.ohalee.com/api/v1/webhook/builtbybit/<your-id>`).
   * Body — your **secret** goes in the `secret` field:

     ```json
     {
       "event": "purchase",
       "resourceId": "{resource_id}",
       "userId": "{user_id}",
       "buyerName": "{username}",
       "secret": "<your secret>"
     }
     ```

The server auto-creates the license (idempotent per buyer + product, scoped to your products).

{% hint style="info" %}
BuiltByBit has no purchase-id placeholder, so a sale is identified by `{user_id}` + `{resource_id}`.
{% endhint %}

## Voxel (formerly Polymart)

**Voxel** (voxel.shop) is supported the same way from the **Integrations** page — connect it, map the product, and create the webhook.

## Custom webhook

A generic custom-webhook platform covers anywhere else you sell.

## Delivering the key to buyers

Link buyers to **`https://license.ohalee.com/redeem`** from your resource's purchase instructions — they enter their **BuiltByBit user ID** (from their profile URL) and get their key to paste into `config.yml`.

> Set an **Ultimate API token** on the Integrations page and the server will DM the key to the buyer automatically (no redeem step).

## Customer-facing pages

Besides `/redeem`, buyers have:

| Page                  | What it does                                                           |
| --------------------- | ---------------------------------------------------------------------- |
| `/redeem`             | Enter marketplace user ID → get the license key.                       |
| `/status`             | License status by key.                                                 |
| `/portal`             | Status + free a seat themselves when migrating servers (rate-limited). |
| `/trial?product=<id>` | Claim a self-serve trial when a product has trials enabled.            |

All four pick up your **custom branding** (name, accent, logo, support link) from the Account page.
