Skip to content

Commit a4f3c05

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 a08aa1b commit a4f3c05

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,31 @@ client.setWebhookHandler((event, data) => {
160160
await client.startWebhookListener();
161161
```
162162

163+
## 📚 API Endpoints
164+
165+
All endpoints automatically use the `/v1` prefix when connecting to `https://api.licensechain.app`.
166+
167+
### Base URL
168+
- **Production**: `https://api.licensechain.app/v1`
169+
- **Development**: `https://api.licensechain.app/v1`
170+
171+
### Available Endpoints
172+
173+
| Method | Endpoint | Description |
174+
|--------|----------|-------------|
175+
| `GET` | `/v1/health` | Health check |
176+
| `POST` | `/v1/auth/login` | User login |
177+
| `POST` | `/v1/auth/register` | User registration |
178+
| `GET` | `/v1/apps` | List applications |
179+
| `POST` | `/v1/apps` | Create application |
180+
| `GET` | `/v1/licenses` | List licenses |
181+
| `POST` | `/v1/licenses/verify` | Verify license |
182+
| `GET` | `/v1/webhooks` | List webhooks |
183+
| `POST` | `/v1/webhooks` | Create webhook |
184+
| `GET` | `/v1/analytics` | Get analytics |
185+
186+
**Note**: The SDK automatically prepends `/v1` to all endpoints, so you only need to specify the path (e.g., `/auth/login` instead of `/v1/auth/login`).
187+
163188
## 📚 API Reference
164189

165190
### LicenseChain Client

src/services/license-service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ export class LicenseService {
8484
async validate(licenseKey: string): Promise<boolean> {
8585
validateNotEmpty(licenseKey, 'license_key');
8686

87-
const response = await this.client.post<{ valid: boolean }>('/licenses/validate', {
88-
license_key: licenseKey
87+
// Use /licenses/verify endpoint with 'key' parameter to match API
88+
const response = await this.client.post<{ valid: boolean }>('/licenses/verify', {
89+
key: licenseKey
8990
});
9091
return response.valid || false;
9192
}

0 commit comments

Comments
 (0)