Skip to content

Marketplace integrations ​

Connect the stores you sell on and every purchase gets its own SunLicense license, with no copy-pasting. Refunds and chargebacks revoke the license, ended subscriptions suspend it. Want your own rules for who gets a key? Let automations decide.

Open Integrations in the dashboard, pick a marketplace, choose which policy its products are sold as, and paste the URL and secret SunLicense gives you into the marketplace. Each guide below has the exact clicks.

MarketplaceHow the buyer gets the keyRefund → revokeGuide
BuiltByBitWritten into the jar they downloadManualBuiltByBit
Voxel Shop (Polymart)Written into the download✅ AutomaticVoxel Shop
SpigotMCYour plugin trades SpigotMC's injected buyer ID for the keyManualSpigotMC
TebexRedeem page (transaction ID)✅Tebex
GumroadGumroad's own key, from the receipt✅Gumroad
Lemon SqueezyLemon Squeezy's own key, from the receipt✅Lemon Squeezy
PayhipPayhip's own key, or the redeem page✅Payhip
Ko-fiRedeem page (transaction ID)—Ko-fi
itch.ioRedeem page (download link)—itch.io
StripeShown on the checkout success page✅Stripe
WooCommerceRedeem page (order number)✅WooCommerce
Envato (CodeCanyon, ThemeForest)Redeem page (purchase code)—Envato

Selling on Modrinth, CurseForge, Hangar or wordpress.org? Read Free platforms first: their rules limit what a license check may do.

How it works ​

  • One URL per connected store. It looks like https://api.sunlicense.com/api/v1/integrations/hooks/<token>. The token tells SunLicense whose store it is; every request is also checked against the marketplace's own signature or secret, so a leaked URL alone can't create licenses (except on Gumroad and SpigotMC, which don't sign; see their guides). Danger zone → New URL replaces it if it leaks.
  • Products map to policies. "Resource 12345 is sold as Premium (2 machines, lifetime)". Use * to send every product of the store to one policy. Purchases of unmapped products are logged and skipped.
  • One license per purchase. Re-downloads, renewals and redelivered webhooks find the same license. A buyer who was refunded and buys again gets a new one (revocation is permanent).
  • Keys from the marketplace. Gumroad, Lemon Squeezy and Payhip already email buyers a key. With Use the store's key on (the default), that exact key becomes the SunLicense key, so buyers use what is in their receipt.
  • Licenses show their source. A license page says via BuiltByBit; marketplace buyers without an email are named by their marketplace user ID (e.g. BuiltByBit user 4242).
  • Event log. Each integration page lists what the store sent and what SunLicense did: issued, existing, revoked, ignored (and why), rejected (bad signature) or failed (e.g. plan limit reached).

Let automations decide ​

By default an integration issues licenses automatically: every sale gets a license from the policy mapped to its product. On the Lite and Standard plans you can switch an integration to Let automations decide (integration page → Who issues licenses). Then SunLicense records each sale and starts your automations (dashboard → Automations) with the Marketplace purchase trigger, and nothing is issued until an automation's Issue license from purchase action does it. For example:

Marketplace purchase (store: BuiltByBit) → if purchase.productId == "12345" → Issue license from purchase with policy Premium

  • Re-downloads and repeated webhooks don't start it again. A buyer who was refunded and buys again starts it once more (Bought again is true).
  • Until a license is issued, downloads (BuiltByBit, Voxel Shop) get LICENSE-PENDING-DOWNLOAD-AGAIN-IN-A-MINUTE in place of the key, SpigotMC's plugin call answers 202 with {"status": "PENDING"}, and the redeem page asks the buyer to try again in a minute. Automations run within seconds, so the next download has the key.
  • Issue license from purchase issues to the buyer exactly as the integration would (same customer, the store's own key on Gumroad, Lemon Squeezy and Payhip), from the policy you pick or, left empty, the one mapped to the product. It emails the key when the buyer gave an address and the store doesn't send its own. A purchase that already has a license keeps it, so running it twice never issues twice.
  • Refunds, chargebacks and subscription ends still revoke or suspend the purchase's license in both modes, and start the Marketplace refund or subscription change trigger.
  • Product mappings become optional; keep them if your automations should use the mapped policy.
  • If your plan no longer includes automations, the integration issues automatically again from its mappings, so buyers aren't left without keys.

Both triggers also fire with Issue licenses automatically (the license already exists, in purchase.licenseId), for example to post a sale to Discord.

What each store sends to the trigger:

StoreBuyer emailPrice (purchase.amount)
BuiltByBit, Voxel Shop, SpigotMC——
Tebex✅Per package
Gumroad✅✅ (USD)
Lemon Squeezy✅With Use Lemon Squeezy's key off (order total)
Payhip✅—
Ko-fi✅The order's total
itch.io——
Stripe✅Checkout total
WooCommerce✅Per line
Envato—✅ (USD)

A missing value is empty text or 0 in conditions.

The redeem page ​

Stores that can't show our key to the buyer get a public page at https://app.sunlicense.com/redeem/<token>. Link it from your product page, receipt or download notes.

  • itch.io and Envato: the buyer pastes their download link or purchase code; SunLicense confirms it with the marketplace's API and issues the key.
  • Webhook stores (Tebex, Gumroad, Lemon Squeezy, Payhip, Ko-fi, WooCommerce): the buyer enters the order/transaction ID and the email they bought with. A wrong email gets the same answer as an unknown order.
  • Stripe: redirect Checkout to the page with ?session_id={CHECKOUT_SESSION_ID} and the key appears as soon as the payment is confirmed.

Keys are shown masked, with reveal and copy buttons.

Permissions ​

integrations.read lets a member see integrations and their event log; integrations.write lets them connect stores, change mappings and see secrets. Owners, Admins and Developers have both; Support and Viewers can read. See Team and roles.

Plan limits

Marketplace licenses count towards your plan's license limit. If the limit is reached the purchase is logged as failed and the store gets an error (most retry later); upgrade and it goes through.

API ​

Everything on the Integrations page is also in the Management API.

Send feedback

Found something broken, or have an idea? It goes straight to our board.

The first line becomes the title.
Images (optional, up to 5: paste, drop or capture)
Check each image before sending, and remove any that show something private.

We also receive this page's address and your browser version.

Ctrl Enter to send