Need a simple way to confirm a customer’s purchase before unlocking your digital product? The gumroad license key verification API lets you check whether a license key is valid directly from your app or website, helping you offer a smooth, reliable experience.
In this guide, you’ll learn the basics of sending a verification request and handling the result. With a few straightforward steps, you can automate license checks, protect your product, and give customers quick access to what they’ve purchased.
What You Need Before Using the Gumroad License Key Verification API
Before you connect a purchase check to your app, make sure you can identify the right product and understand what Gumroad returns. Getting these details straight first helps prevent false rejections and keeps sensitive credentials out of your customer-facing code.
Get your product ID and API access
Start by locating the product ID for the Gumroad product whose licenses you want to check. You can find product information in your Gumroad account or retrieve it through the API; make sure you use the ID, not just the product name or storefront URL, because names and links are not reliable identifiers.
The verification request is sent to Gumroad’s HTTPS endpoint, https://api.gumroad.com/v2/licenses/verify, with the product ID and submitted license key. The verification endpoint does not require a seller access token, so don’t add one unnecessarily or expose other private API credentials in browser-side code. Send requests from a trusted server when possible, and consult Gumroad’s API documentation if your integration also uses authenticated endpoints.
Before building the full flow, confirm that your server can make an outbound HTTPS request and safely read the response. Keep the product ID in configuration rather than scattering it through your code, especially if you sell several products.
Once the request can reach the correct product, the next step is knowing how to interpret the purchase information it returns. A successful response is useful, but your app should also consider the customer’s current entitlement.
Understand license keys and purchase details
A license key is associated with a particular purchase and product. Your request should pair the customer’s submitted key with the matching product ID; checking a key against another product can produce an invalid result even when the customer has purchased something from you.
Gumroad’s response can include a success status and purchase details such as the product, buyer, and license usage count. Use the status to determine whether the key was recognized, then review relevant purchase fields—such as whether the purchase was refunded or disputed—before granting access. Valid key and active entitlement are not always the same thing.
- Ask customers to paste the key exactly as provided, and trim accidental spaces before sending it.
- Decide whether each verification should increase the key’s usage count; only enable that behavior if it fits your license policy.
- Return a clear message for invalid, refunded, or otherwise ineligible purchases without revealing unnecessary buyer details.
How to Verify Gumroad License Keys Using the API
Once you’ve decided which purchases qualify for access, the verification flow becomes a simple handoff: your app sends the submitted key to Gumroad, then applies your own eligibility rules to the result. The important part is to make that check reliable without exposing customer data or treating every recognized key as automatically eligible.
Start by building a server-side request with the product and key you’ve already identified. The following steps cover the request format, the fields worth checking, and practical responses for common edge cases.
Send a verification request
Send a POST request to https://api.gumroad.com/v2/licenses/verify using form-encoded data. Include the product ID and the customer’s license key; the API does not require a seller access token for this endpoint.
For example, your server can submit these fields:
productid— the Gumroad product ID associated with the key.licensekey— the key entered by the customer, trimmed of accidental leading or trailing spaces.incrementusescount— an optional setting that controls whether this check increases the key’s usage count. Set it according to your licensing policy.
Keep the request on your server rather than calling Gumroad directly from browser code. That gives you a place to validate input, apply rate limits, and return only the access decision your app needs.
Interpret the API response
A response should guide your decision, not replace it. Check the top-level success value first, then inspect the returned purchase details before granting access.
When a key is recognized, fields may describe the purchase and its status. Depending on your product’s rules, check indicators such as refund or dispute status, along with usage information. Avoid sending buyer names, email addresses, or the full response to the customer when a simple outcome will do.
- Recognized and eligible: grant the access your product promises.
- Recognized but ineligible: explain the next step, such as contacting support.
- Unclear or unavailable: fail safely and let the customer retry rather than granting access based on an uncertain result.
Handle invalid, refunded, or already-used keys
Not every failed check means the customer did something wrong. A typo, a key linked to another product, a refund, or a usage limit can each call for a different response.
Keep messages specific but discreet: ask customers to recheck the key for a likely mismatch, and direct them to support if the purchase appears refunded or disputed in error. If your policy limits activations, compare the reported usage with that limit; a nonzero count alone does not prove misuse. A helpful retry option and a support route can resolve legitimate access issues without weakening your checks.
Build a Reliable Gumroad License Key Verification API Workflow
A purchase check is only one part of a dependable access flow. What happens when someone pastes a key with an extra space, or Gumroad takes too long to respond? A little care around the verification step can make the experience clearer for customers and easier to support.
Good input handling prevents avoidable failures before a request is sent. It also helps ensure the result shown to a customer is understandable without exposing private purchase details.
Validate user input and display clear results
Trim leading and trailing spaces from the submitted key, reject empty values, and set a reasonable length limit before contacting Gumroad. These simple checks reduce needless requests while preserving the key’s actual characters; avoid changing its case or removing internal characters unless your implementation confirms that is appropriate.
Once the response arrives, map it to a small set of customer-facing outcomes rather than displaying raw API data. For example:
- Access granted: the key is recognized and meets your eligibility rules.
- Check the key: the submitted value may be mistyped or associated with another product.
- Could not verify: a temporary connection or service issue prevented a reliable decision.
Keep buyer information and the full response out of the page. A brief message and a support route are usually more useful than technical details.
Clear feedback is helpful, but it should be backed by a safe request path. The following safeguards help keep customer data and your application stable when something goes wrong.
Protect credentials and manage errors
Although the verification endpoint does not require a seller access token, protect any other API credentials your application uses. Store secrets in server-side environment configuration, never in browser scripts or public repositories, and restrict access to production settings.
Handle network failures, timeouts, and unexpected response formats separately from a key that Gumroad explicitly does not recognize. Use a bounded timeout and avoid granting access when the result is uncertain. Log enough to diagnose issues—such as a timestamp and error category—but do not log full license keys or unnecessary buyer data.
Before customers depend on the workflow, try the ordinary path and the less common cases. A short test plan can reveal confusing messages, accidental usage-count changes, or errors that only appear when the service is unavailable.
Test the integration before launch
Use a controlled product and purchase scenario where possible, and verify that the product ID, submitted key, and optional usage-count setting match your intended policy. Confirm that one successful check produces the right access decision and that repeated checks behave as expected.
Also test invalid input, refunded or otherwise ineligible purchases, slow responses, and malformed or unavailable API responses. Check the complete customer journey on both desktop and mobile, including the retry and support paths. A small pre-launch checklist makes the gumroad license key verification API easier to maintain:
- Confirm valid and invalid outcomes are distinct.
- Ensure uncertain results never grant access automatically.
- Verify logs, error messages, and usage-count behavior.
Make License Verification Simple, Secure, and Reliable
The Gumroad license key verification API gives you a straightforward way to confirm purchases and manage access. A dependable setup goes beyond checking whether a key is recognized: it also applies your eligibility rules, handles unusual or unavailable responses safely, and gives customers clear next steps.
With careful input validation, server-side request handling, and a few tests before launch, you can protect your product while making access easier for legitimate buyers. Build the workflow around your licensing policy, and you’ll have a smoother experience for both your customers and your support team.