Swagger UI is loading. If it does not appear, use the embedded OpenAPI JSON below.
{
"openapi": "3.0.3",
"info": {
"title": "CodingRepo License API",
"version": "1.0.0",
"description": "Public API for checking, activating, and deactivating CodingRepo product license keys issued after purchase. Suspended or revoked licenses return invalid\/blocked responses."
},
"servers": [
{
"url": "https:\/\/codingrepo.com\/wp-json",
"description": "CodingRepo"
}
],
"paths": {
"\/codingrepo\/v1\/license\/activate": {
"post": {
"summary": "Activate a license on a website",
"description": "Activates the license for website_url. If the same license is already active on another site, the earlier site is replaced by this activation.",
"operationId": "activateLicense",
"tags": [
"Licenses"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseActivationRequest"
},
"example": {
"username": "buyer_username",
"license_code": "CR-ABCDE-ABCDE-ABCDE-ABCDE",
"website_url": "https:\/\/customer-site.example",
"product_id": 9048
}
},
"application\/x-www-form-urlencoded": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseActivationRequest"
}
}
}
},
"responses": {
"200": {
"description": "License activation result. Invalid lookups intentionally return HTTP 200 with success=false.",
"content": {
"application\/json": {
"schema": {
"oneOf": [
{
"$ref": "#\/components\/schemas\/LicenseActivationSuccess"
},
{
"$ref": "#\/components\/schemas\/LicenseApiFailure"
}
]
},
"examples": {
"activated": {
"summary": "Activated license",
"value": {
"success": true,
"active": true,
"message": "License activated.",
"customer_username": "buyer_username",
"site_url": "https:\/\/customer-site.example",
"site_host": "customer-site.example",
"previous_site_url": "",
"license": {
"order_id": 9139,
"product_id": 9048,
"product_title": "Legitsquare Boards Plugin",
"order_status": "completed",
"purchase_date": "2026-05-24T10:30:00+00:00",
"license_code": "CR-ABCDE-ABCDE-ABCDE-ABCDE",
"active_site_url": "https:\/\/customer-site.example",
"active_site_host": "customer-site.example",
"activated_at": "2026-06-06 03:35:00",
"deactivated_at": ""
}
}
},
"reassigned": {
"summary": "Activated and replaced earlier site",
"value": {
"success": true,
"active": true,
"message": "License activated.",
"customer_username": "buyer_username",
"site_url": "https:\/\/new-site.example",
"site_host": "new-site.example",
"previous_site_url": "https:\/\/old-site.example"
}
},
"invalid": {
"summary": "Invalid license or website",
"value": {
"success": false,
"message": "License could not be found for this user."
}
}
}
}
}
},
"429": {
"description": "Rate limit exceeded.",
"headers": {
"X-RateLimit-Limit": {
"description": "Maximum requests allowed during the configured window.",
"schema": {
"type": "integer"
}
},
"X-RateLimit-Remaining": {
"description": "Remaining requests in the current window.",
"schema": {
"type": "integer"
}
},
"Retry-After": {
"description": "Seconds until another request should be attempted.",
"schema": {
"type": "integer"
}
}
},
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseApiFailure"
},
"example": {
"success": false,
"message": "Too many license API requests. Try again later."
}
}
}
}
}
}
},
"\/codingrepo\/v1\/license\/deactivate": {
"post": {
"summary": "Deactivate a license from a website",
"description": "Deactivates the license only when website_url matches the currently active site for that license.",
"operationId": "deactivateLicense",
"tags": [
"Licenses"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseActivationRequest"
},
"example": {
"username": "buyer_username",
"license_code": "CR-ABCDE-ABCDE-ABCDE-ABCDE",
"website_url": "https:\/\/customer-site.example",
"product_id": 9048
}
},
"application\/x-www-form-urlencoded": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseActivationRequest"
}
}
}
},
"responses": {
"200": {
"description": "License deactivation result. A website mismatch returns HTTP 200 with success=false.",
"content": {
"application\/json": {
"schema": {
"oneOf": [
{
"$ref": "#\/components\/schemas\/LicenseDeactivationSuccess"
},
{
"$ref": "#\/components\/schemas\/LicenseApiFailure"
}
]
},
"examples": {
"deactivated": {
"summary": "Deactivated license",
"value": {
"success": true,
"active": false,
"message": "License deactivated.",
"customer_username": "buyer_username",
"site_url": "https:\/\/customer-site.example"
}
},
"not_active_for_site": {
"summary": "Website did not match active site",
"value": {
"success": false,
"active": true,
"message": "License is not active for this website.",
"customer_username": "buyer_username",
"site_url": "https:\/\/different-site.example"
}
}
}
}
}
},
"429": {
"description": "Rate limit exceeded.",
"headers": {
"X-RateLimit-Limit": {
"description": "Maximum requests allowed during the configured window.",
"schema": {
"type": "integer"
}
},
"X-RateLimit-Remaining": {
"description": "Remaining requests in the current window.",
"schema": {
"type": "integer"
}
},
"Retry-After": {
"description": "Seconds until another request should be attempted.",
"schema": {
"type": "integer"
}
}
},
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseApiFailure"
},
"example": {
"success": false,
"message": "Too many license API requests. Try again later."
}
}
}
}
}
}
},
"\/codingrepo\/v1\/license\/status": {
"post": {
"summary": "Check license status",
"description": "Returns status=valid when the submitted username and license_code match a purchased CodingRepo product license. This endpoint does not activate or deactivate a website.",
"operationId": "checkLicenseStatus",
"tags": [
"Licenses"
],
"requestBody": {
"required": true,
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseStatusRequest"
},
"example": {
"username": "buyer_username",
"license_code": "CR-ABCDE-ABCDE-ABCDE-ABCDE",
"product_id": 9048
}
},
"application\/x-www-form-urlencoded": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseStatusRequest"
}
}
}
},
"responses": {
"200": {
"description": "License status result. Invalid lookups intentionally return HTTP 200 with status=invalid.",
"content": {
"application\/json": {
"schema": {
"oneOf": [
{
"$ref": "#\/components\/schemas\/LicenseStatusSuccess"
},
{
"$ref": "#\/components\/schemas\/LicenseStatusFailure"
}
]
},
"examples": {
"valid": {
"summary": "Valid license",
"value": {
"success": true,
"valid": true,
"status": "valid",
"active": true,
"message": "License is valid.",
"customer_username": "buyer_username",
"license": {
"order_id": 9139,
"product_id": 9048,
"product_title": "Legitsquare Boards Plugin",
"order_status": "completed",
"purchase_date": "2026-05-24T10:30:00+00:00",
"license_code": "CR-ABCDE-ABCDE-ABCDE-ABCDE",
"active_site_url": "https:\/\/customer-site.example",
"active_site_host": "customer-site.example",
"activated_at": "2026-06-06 03:35:00",
"deactivated_at": ""
}
}
},
"invalid": {
"summary": "Invalid license",
"value": {
"success": false,
"valid": false,
"status": "invalid",
"message": "License could not be found for this user."
}
}
}
}
}
},
"429": {
"description": "Rate limit exceeded.",
"headers": {
"X-RateLimit-Limit": {
"description": "Maximum requests allowed during the configured window.",
"schema": {
"type": "integer"
}
},
"X-RateLimit-Remaining": {
"description": "Remaining requests in the current window.",
"schema": {
"type": "integer"
}
},
"Retry-After": {
"description": "Seconds until another request should be attempted.",
"schema": {
"type": "integer"
}
}
},
"content": {
"application\/json": {
"schema": {
"$ref": "#\/components\/schemas\/LicenseApiFailure"
},
"example": {
"success": false,
"message": "Too many license API requests. Try again later."
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"LicenseStatusRequest": {
"type": "object",
"required": [
"username",
"license_code"
],
"properties": {
"username": {
"type": "string",
"description": "Buyer WordPress username. Buyer email is also accepted by the current endpoint.",
"example": "buyer_username"
},
"license_code": {
"type": "string",
"description": "License key shown on the buyer Downloads page.",
"example": "CR-ABCDE-ABCDE-ABCDE-ABCDE"
},
"product_id": {
"type": "integer",
"description": "Optional CodingRepo product\/listing ID. When supplied, the license must match this product.",
"example": 9048
}
}
},
"LicenseActivationRequest": {
"type": "object",
"required": [
"username",
"license_code",
"website_url"
],
"properties": {
"username": {
"type": "string",
"description": "Buyer WordPress username. Buyer email is also accepted by the current endpoints.",
"example": "buyer_username"
},
"license_code": {
"type": "string",
"description": "License key shown on the buyer Downloads page.",
"example": "CR-ABCDE-ABCDE-ABCDE-ABCDE"
},
"website_url": {
"type": "string",
"format": "uri",
"description": "Required website URL for the installation using this license. Only one website can be active per license at a time.",
"example": "https:\/\/customer-site.example"
},
"product_id": {
"type": "integer",
"description": "Optional CodingRepo product\/listing ID. When supplied, the license must match this product.",
"example": 9048
}
}
},
"LicenseStatusSuccess": {
"type": "object",
"required": [
"success",
"valid",
"status",
"active",
"message",
"customer_username",
"license"
],
"properties": {
"success": {
"type": "boolean",
"example": true
},
"valid": {
"type": "boolean",
"example": true
},
"status": {
"type": "string",
"enum": [
"valid"
],
"example": "valid"
},
"active": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "License is valid."
},
"customer_username": {
"type": "string",
"example": "buyer_username"
},
"license": {
"$ref": "#\/components\/schemas\/LicenseRecord"
}
}
},
"LicenseStatusFailure": {
"type": "object",
"required": [
"success",
"valid",
"status",
"message"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"valid": {
"type": "boolean",
"example": false
},
"status": {
"type": "string",
"enum": [
"invalid"
],
"example": "invalid"
},
"license_status": {
"type": "string",
"enum": [
"suspended",
"revoked"
],
"example": "suspended"
},
"message": {
"type": "string",
"example": "License could not be found for this user."
}
}
},
"LicenseActivationSuccess": {
"type": "object",
"required": [
"success",
"active",
"message",
"customer_username",
"site_url",
"site_host",
"license"
],
"properties": {
"success": {
"type": "boolean",
"example": true
},
"active": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "License activated."
},
"customer_username": {
"type": "string",
"example": "buyer_username"
},
"site_url": {
"type": "string",
"format": "uri",
"example": "https:\/\/customer-site.example"
},
"site_host": {
"type": "string",
"example": "customer-site.example"
},
"previous_site_url": {
"type": "string",
"example": "https:\/\/old-site.example"
},
"license": {
"$ref": "#\/components\/schemas\/LicenseRecord"
}
}
},
"LicenseDeactivationSuccess": {
"type": "object",
"required": [
"success",
"active",
"message",
"customer_username",
"site_url",
"license"
],
"properties": {
"success": {
"type": "boolean",
"example": true
},
"active": {
"type": "boolean",
"example": false
},
"message": {
"type": "string",
"example": "License deactivated."
},
"customer_username": {
"type": "string",
"example": "buyer_username"
},
"site_url": {
"type": "string",
"format": "uri",
"example": "https:\/\/customer-site.example"
},
"license": {
"$ref": "#\/components\/schemas\/LicenseRecord"
}
}
},
"LicenseRecord": {
"type": "object",
"properties": {
"order_id": {
"type": "integer",
"example": 9139
},
"product_id": {
"type": "integer",
"example": 9048
},
"product_title": {
"type": "string",
"example": "Legitsquare Boards Plugin"
},
"order_status": {
"type": "string",
"example": "completed"
},
"purchase_date": {
"type": "string",
"format": "date-time"
},
"license_code": {
"type": "string",
"example": "CR-ABCDE-ABCDE-ABCDE-ABCDE"
},
"active_site_url": {
"type": "string",
"format": "uri",
"example": "https:\/\/customer-site.example"
},
"active_site_host": {
"type": "string",
"example": "customer-site.example"
},
"activated_at": {
"type": "string",
"example": "2026-06-06 03:35:00"
},
"deactivated_at": {
"type": "string",
"example": ""
},
"license_status": {
"type": "string",
"enum": [
"active",
"suspended",
"revoked"
],
"example": "active"
}
}
},
"LicenseApiFailure": {
"type": "object",
"required": [
"success",
"message"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"active": {
"type": "boolean",
"example": false
},
"license_status": {
"type": "string",
"enum": [
"suspended",
"revoked"
],
"example": "suspended"
},
"message": {
"type": "string",
"example": "License could not be found for this user."
}
}
}
}
}
}