License verification API
Check license keys from your own software. Public, rate-limited, no API key required.
Products sold through CodeToCoin come with license keys in the form `CTC-XXXXX-XXXXX-XXXXX-XXXXX`. Your software can check a key with a single request.
Verify a key
```
POST https://codetocoin.com/api/v1/licenses/verify
Content-Type: application/json
{ "product": "your-product-slug", "key": "CTC-ABCDE-…", "activate": false }
```
Set `activate` to `true` the first time a key is used on a machine; each activation counts towards the license's limit (3 by default).
Responses
```
200 { "valid": true, "activations": 1, "max_activations": 3, "expires_at": null }
200 { "valid": false, "reason": "not_found" | "revoked" | "expired" | "activation_limit" }
400 { "error": "…" }
429 { "error": "…" } // 60 requests per minute per IP
```
Good practice
- Check the key when your software starts, and cache a valid answer for a while so your users are not blocked when they are offline.
- Show a clear message for each `reason`, with a link to where the buyer can manage their license.
- Keys are stored hashed: a verification never reveals other keys or buyer details.
You can revoke or restore a key at any time from Monetization → License management.