Shop & Products·6 min read·

How do I connect Keygen to issue software license keys automatically?

Paste your Keygen account ID and API token and each purchase of a licensed product issues a real Keygen key on the order, suspended if you refund it.

The Keygen connector issues a real software license key the moment someone buys a licensed product — no manual key generation, no spreadsheet of used codes.

Installing the plugin and the general troubleshooting checklist are shared by every integration; they are written once in the shared integrations guide. What follows is specific to Keygen.

Step 1 — Gather your Keygen details

In Keygen you need three things. Your Account ID (or account slug) is under Account Settings. An API token comes from Tokens; use a product or admin token that is allowed to create licenses. And Keygen's Policies define what a license permits, such as seat limits, expiry and entitlements, so note the ID of each policy you want to issue from.

Step 2 — Fill in the Keygen panel

Open Admin → Plugins → Keygen and enter the Account ID and API token. Then set the Default policy ID, which is used for any product that has no mapping of its own. The Issue license keys on purchase switch starts on, so you do not need to enable anything. Click Save Settings.

Step 3 — Map specific products to policies (optional)

If different products need different license terms — a Pro tier with more seats, a time-limited trial policy — fill in Product → policy mapping with a JSON object that pairs each VeloCMS product ID with a Keygen policy ID. You can read a product's ID from its edit URL under Admin → Products. Anything not listed falls back to the default policy.

{
  "<VeloCMS product ID>": "<Keygen policy ID for the Pro tier>",
  "<another product ID>": "<Keygen policy ID for the trial>"
}

A mapping that is not valid JSON is rejected when you save, with the message that it must be a valid JSON object.

Test Connection issues a real license

Keygen has no lightweight ping, so Test Connection creates an actual license named VeloCMS Connection Test on your default policy. It needs the default policy ID to be saved first and uses the saved settings, not what is typed. Revoke that license in your Keygen dashboard afterwards.

What happens on purchase

  • Only line items on digital or license products get a key. Physical products in the same order are ignored.
  • Each qualifying item gets its own license, created under the product's mapped policy or the default one, and named with the order ID and the buyer's email so you can find it in Keygen.
  • The issued key is attached to that order item and appears on the buyer's order-status page next to their download.
  • An item that already holds a key is skipped, so replaying an order never issues a second key.

License issuance never blocks or delays order fulfillment. If Keygen is unreachable, only the license-key step fails. A product with neither a mapped policy nor a default policy is skipped on purpose, because issuing a key under the wrong policy would be worse than issuing none.

Refunds suspend the license

When you refund an order, VeloCMS suspends the licenses that were issued for it in Keygen. A license that Keygen reports as already gone or already suspended counts as done. VeloCMS suspends rather than deletes, so you can still see the license in Keygen. Any failure is listed under Admin → Integrations → Sync activity against that order.

Disconnecting

Turn off Issue license keys on purchase or clear the API token to stop issuing new licenses. Keys already issued keep working in Keygen, because switching the connector off does not revoke them; only a refund processed while the connector is active suspends a license.