Skip to main content

Endpoint

POST https://api.gumroad.com/v2/licenses/verify
Verifies that a license key is valid for a given product. This endpoint can optionally increment a usage counter to track how many times a license has been verified. This is commonly used for software licensing to validate customer purchases.
This endpoint does not require authentication and can be called from your application without an access token.

Request Parameters

license_key
string
required
The license key to verify (typically found in the purchase receipt)
product_id
string
The unique identifier for your product. This parameter is recommended and may be required for products created after a certain date.
The product’s permalink (either unique or custom). Can be used instead of product_id.
increment_uses_count
boolean
default:"true"
Whether to increment the usage counter for this license. Set to false to verify without tracking usage.

Response Fields

success
boolean
Whether the license verification was successful
uses
integer
The number of times this license has been verified (with increment_uses_count=true)
purchase
object
Information about the purchase associated with this license
purchase.id
string
Encrypted purchase ID
purchase.product_name
string
Name of the product
purchase.product_id
string
Encrypted product ID
Full URL to the product page
purchase.short_product_id
string
Short unique identifier for the product
purchase.email
string
Email address of the purchaser
purchase.price
integer
Purchase price in cents
purchase.currency
string
Currency code (e.g., “usd”)
purchase.quantity
integer
Quantity purchased
purchase.created_at
string
Timestamp when the purchase was created
purchase.sale_timestamp
string
Timestamp of the sale
purchase.order_number
integer
Numeric order number
purchase.license_key
string
The license key (same as the verified key, or new key if rotated)
purchase.variants
string
Comma-separated list of variant options selected
purchase.custom_fields
array
Array of custom field responses from the purchase form
purchase.refunded
boolean
Whether the purchase has been refunded
purchase.chargebacked
boolean
Whether the purchase has been charged back
purchase.subscription_ended_at
string
If this is a subscription, when it ended
purchase.subscription_cancelled_at
string
If this is a subscription, when it was cancelled
purchase.subscription_failed_at
string
If this is a subscription, when the last payment failed
purchase.can_contact
boolean
Whether the customer agreed to be contacted

Examples

Verify a license with usage tracking

curl -X POST https://api.gumroad.com/v2/licenses/verify \
  -d "product_id=your-product-id" \
  -d "license_key=ABCD1234-EFGH5678-IJKL9012-MNOP3456"

Verify without incrementing usage

curl -X POST https://api.gumroad.com/v2/licenses/verify \
  -d "product_id=your-product-id" \
  -d "license_key=ABCD1234-EFGH5678-IJKL9012-MNOP3456" \
  -d "increment_uses_count=false"

Success Response

{
  "success": true,
  "uses": 1,
  "purchase": {
    "id": "encrypted_purchase_id",
    "product_name": "My Software",
    "product_id": "encrypted_product_id",
    "product_permalink": "https://gumroad.com/l/my-software",
    "short_product_id": "my-software",
    "email": "[email protected]",
    "price": 2999,
    "currency": "usd",
    "quantity": 1,
    "created_at": "2024-01-15T10:30:00Z",
    "sale_timestamp": "2024-01-15T10:30:00Z",
    "order_number": 123456,
    "license_key": "ABCD1234-EFGH5678-IJKL9012-MNOP3456",
    "variants": "",
    "custom_fields": [],
    "refunded": false,
    "chargebacked": false,
    "subscription_ended_at": null,
    "subscription_cancelled_at": null,
    "subscription_failed_at": null,
    "can_contact": true
  }
}

Error Responses

Invalid License Key (404)

{
  "success": false,
  "message": "That license does not exist for the provided product."
}

Disabled License (404)

{
  "success": false,
  "message": "This license key has been disabled."
}

Access Revoked (404)

{
  "success": false,
  "message": "Access to the purchase associated with this license has expired."
}

Missing product_id (500)

For products created after a certain date, the product_id parameter is required. If you receive this error, make sure to include the product_id in your request.
{
  "success": false,
  "message": "The 'product_id' parameter is required to verify the license for this product. Please set 'product_id' to 'your-product-id' in the request."
}

Common Use Cases

Software Activation

When a customer launches your software for the first time, call this endpoint to validate their license key. You can use the increment_uses_count parameter to track activations.

Periodic License Checks

For ongoing validation, set increment_uses_count=false to verify the license is still valid without inflating the usage counter.

Subscription Status

Check the subscription_ended_at, subscription_cancelled_at, and subscription_failed_at fields to determine if a subscription-based license is still active.

Build docs developers (and LLMs) love