Skip to content

Commit dbb0ac0

Browse files
committed
fix: Update license validation endpoint and parameter - Change endpoint from /licenses/validate to /licenses/verify - Change parameter from license_key to key to match API specification
1 parent 38825f0 commit dbb0ac0

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

licensechain/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,11 @@ async def validate_license(
431431
Returns:
432432
License validation result
433433
"""
434-
payload = {"license_key": license_key}
434+
# Use /licenses/verify endpoint with 'key' parameter to match API
435+
payload = {"key": license_key}
435436
if app_id:
436437
payload["app_id"] = app_id
437-
return await self._post("/licenses/validate", payload)
438+
return await self._post("/licenses/verify", payload)
438439

439440
async def revoke_license(
440441
self, license_id: str, reason: Optional[str] = None

licensechain/services/license_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def validate(self, license_key: str) -> bool:
4949
"""Validate a license key."""
5050
validate_not_empty(license_key, 'license_key')
5151

52-
response = self.api_client.post('/licenses/validate', {'license_key': license_key})
52+
# Use /licenses/verify endpoint with 'key' parameter to match API
53+
response = self.api_client.post('/licenses/verify', {'key': license_key})
5354
return response.get('valid', False)
5455

5556
def list_user_licenses(self, user_id: str, page: Optional[int] = None, limit: Optional[int] = None) -> Dict[str, Any]:

0 commit comments

Comments
 (0)