Appearance
Error Codes
Reference for all error codes returned by the PackEdge API.
HTTP Status Codes
| Status | Meaning |
|---|---|
200 | Success |
400 | Bad request — invalid parameters or business logic error |
401 | Unauthorized — invalid or missing authentication |
403 | Forbidden — valid auth but insufficient permissions |
404 | Not found — resource doesn't exist |
429 | Too many requests — rate limit exceeded |
500 | Internal server error |
Error Response Format
All errors return a JSON response with an error field:
json
{
"error": "License has expired"
}Some endpoints also return valid: false for validation failures:
json
{
"valid": false,
"error": "License has expired"
}License Errors
Validation Errors
| Error | Description |
|---|---|
Invalid public_key | Product public key not found |
License key not found | License doesn't exist |
License has expired | License past expiration date |
License is suspended | License temporarily disabled |
License is revoked | License permanently disabled |
Activation Errors
| Error | Description |
|---|---|
License seat limit reached | All seats in use |
License is suspended | Cannot activate suspended license |
License has expired | Cannot activate expired license |
Domain is required | Missing domain parameter |
Deactivation Errors
| Error | Description |
|---|---|
Activation not found | No activation for this domain |
Domain or activation_id required | Missing identifier |
Product Errors
| Error | Description |
|---|---|
Product not found | Invalid product slug |
Product is not active | Product in draft or archived state |
Download Errors
| Error | Description |
|---|---|
Release not found | Invalid release ID |
Invalid or expired license | License cannot access downloads |
Product does not manage releases | Release distribution disabled |
Webhook Errors
| Error | Description |
|---|---|
Invalid signature | Webhook signature verification failed |
Webhook not found | Invalid webhook ID |
Handling Errors
PHP Example
php
$response = wp_remote_post($url, $args);
if (is_wp_error($response)) {
// Network error
error_log('Network error: ' . $response->get_error_message());
return;
}
$code = wp_remote_retrieve_response_code($response);
$body = json_decode(wp_remote_retrieve_body($response), true);
if ($code !== 200) {
$error = $body['error'] ?? 'Unknown error';
switch ($error) {
case 'License has expired':
// Handle expired license
break;
case 'License seat limit reached':
// Handle seat limit
break;
default:
error_log('API error: ' . $error);
}
}JavaScript Example
javascript
try {
const response = await fetch(url, options);
const data = await response.json();
if (!response.ok) {
switch (data.error) {
case 'License has expired':
// Handle expired
break;
case 'License seat limit reached':
// Handle seat limit
break;
default:
console.error('API error:', data.error);
}
}
} catch (error) {
console.error('Network error:', error);
}