API Documentation
Integrate PackComply's AI-driven packaging compliance auditing into your systems. Automate PPWR compliance checks, retrieve audit results, and streamline your workflow.
Overview
The PackComply API enables you to programmatically access our AI-driven packaging compliance auditing system. Our API helps you ensure your products meet EU Packaging & Packaging Waste Regulation (PPWR) requirements across all EU member states.
Key Features
- • Automated Compliance Auditing: AI-powered analysis of packaging data against PPWR requirements
- • Multi-country Support: Compliance checking for all 27 EU member states
- • Multilingual Support: Documentation and reports in multiple EU languages
- • Real-time Results: Get audit results and compliance certificates instantly
- • Issue Tracking: Detailed supplier fix tickets for non-compliant items
- • Webhook Notifications: Real-time notifications when audits complete
API Access Requirements
API access is available for Professional and Enterprise plan subscribers only. Your API keys are available in your dashboard at app.packcomply.com.
Authentication
PackComply uses API key authentication. Include your API key in the Authorization
header of all requests.
Getting Your API Key
- Log in to your PackComply dashboard at app.packcomply.com
- Navigate to Settings → API Keys
- Click "Generate New API Key"
- Copy and securely store your API key
Authentication Header
Authorization: Bearer YOUR_API_KEY_HERE
Example Authentication
cURL
curl -X GET "https://api.packcomply.com/api/v1/audits" \ -H "Authorization: Bearer pc_live_abc123..." \ -H "Content-Type: application/json"
JavaScript (fetch)
const response = await fetch('https://api.packcomply.com/api/v1/audits', { method: 'GET', headers: { 'Authorization': 'Bearer pc_live_abc123...', 'Content-Type': 'application/json' } });
API Endpoints
All API endpoints are versioned and use the base URL: https://api.packcomply.com/api/v1/
/api/v1/uploads
Upload packaging data for compliance auditing. Supports CSV and JSON formats.
Request Headers
Authorization: Bearer YOUR_API_KEY Content-Type: application/json
Request Body
{ "name": "Q1 2024 Product Audit", "description": "Quarterly compliance check for new products", "format": "json", // or "csv" "data": [ { "sku": "PROD-001", "product_name": "Eco-Friendly Food Container", "material_type": "biodegradable_plastic", "weight_grams": 45, "dimensions": { "length_mm": 150, "width_mm": 100, "height_mm": 50 }, "target_countries": ["DE", "FR", "NL", "IT"], "packaging_components": [ { "component": "primary_container", "material": "PLA", "percentage": 80 }, { "component": "label", "material": "paper", "percentage": 20 } ] } ] }
Response
{ "upload_id": "upload_abc123", "status": "completed", "name": "Q1 2024 Product Audit", "total_items": 1, "created_at": "2024-01-15T10:30:00Z", "file_url": "https://api.packcomply.com/uploads/upload_abc123" }
/api/v1/audits
Run a compliance audit on uploaded packaging data.
Request Body
{ "upload_id": "upload_abc123", "audit_name": "Q1 2024 PPWR Compliance Check", "target_regulations": ["PPWR", "DE_VerpackG"], "options": { "generate_certificates": true, "create_supplier_tickets": true, "languages": ["en", "de", "fr"] } }
Response
{ "audit_id": "audit_xyz789", "status": "processing", "upload_id": "upload_abc123", "audit_name": "Q1 2024 PPWR Compliance Check", "total_items": 1, "created_at": "2024-01-15T10:35:00Z", "estimated_completion": "2024-01-15T10:37:00Z" }
/api/v1/audits/:audit_id
Retrieve the results of a completed compliance audit.
Response
{ "audit_id": "audit_xyz789", "status": "completed", "audit_name": "Q1 2024 PPWR Compliance Check", "summary": { "total_items": 1, "compliant_items": 0, "non_compliant_items": 1, "compliance_rate": "0%" }, "completed_at": "2024-01-15T10:37:00Z", "results": [ { "sku": "PROD-001", "status": "non_compliant", "compliance_score": 45, "issues_count": 3, "certificate_url": null, "supplier_ticket_url": "https://app.packcomply.com/tickets/ticket_def456" } ], "certificates_generated": 0, "supplier_tickets_created": 1 }
/api/v1/audits/:audit_id/issues
Get detailed compliance issues and recommendations for specific audit results.
Response
{ "audit_id": "audit_xyz789", "issues": [ { "sku": "PROD-001", "issue_id": "issue_001", "severity": "high", "regulation": "PPWR Article 6", "country": "DE", "description": "Packaging material composition exceeds allowed plastic content threshold", "recommendation": "Reduce plastic content to max 70% or switch to approved bio-based alternative", "supplier_action_required": true, "deadline": "2024-07-01T00:00:00Z" }, { "sku": "PROD-001", "issue_id": "issue_002", "severity": "medium", "regulation": "PPWR Article 11", "country": "FR", "description": "Missing required recycling instructions on packaging", "recommendation": "Add French recycling symbols and disposal instructions", "supplier_action_required": true, "deadline": "2024-03-01T00:00:00Z" } ] }
Webhooks
Webhooks allow you to receive real-time notifications when audit processes complete. This enables you to automatically trigger downstream processes without polling our API.
Setting Up Webhooks
Configure webhooks in your PackComply dashboard or programmatically via the API:
/api/v1/webhooks
Request Body
{ "url": "https://your-api.com/packcomply-webhook", "events": ["audit.completed", "audit.failed"], "secret": "your_webhook_secret_key" }
Webhook Events
audit.completed
Fired when a compliance audit successfully completes
audit.failed
Fired when a compliance audit fails due to an error
Example Webhook Payload
{ "event": "audit.completed", "audit_id": "audit_xyz789", "audit_name": "Q1 2024 PPWR Compliance Check", "status": "completed", "summary": { "total_items": 1, "compliant_items": 0, "non_compliant_items": 1, "compliance_rate": "0%" }, "completed_at": "2024-01-15T10:37:00Z", "webhook_id": "wh_abc123" }
Webhook Security
All webhook requests include a signature in the X-PackComply-Signature
header. Verify this signature using your webhook secret to ensure the request came from PackComply.
// Node.js webhook verification example const crypto = require('crypto'); function verifyWebhook(payload, signature, secret) { const expectedSignature = crypto .createHmac('sha256', secret) .update(payload) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(signature, 'hex'), Buffer.from(expectedSignature, 'hex') ); }
Error Handling
PackComply uses conventional HTTP response codes to indicate the success or failure of API requests.
HTTP Status Codes
Error Response Format
{ "error": { "type": "validation_error", "message": "Invalid request parameters", "details": [ { "field": "target_countries", "message": "Must be an array of valid ISO 3166-1 alpha-2 country codes" } ], "request_id": "req_abc123" } }
Common Error Types
validation_error
Request parameters are invalid or missing required fields
authentication_error
API key is invalid, expired, or missing
rate_limit_error
Too many requests made in a short time period
quota_exceeded_error
Monthly audit quota has been reached
Rate Limits & Quotas
To ensure fair usage and optimal performance, PackComply implements rate limits and monthly quotas based on your subscription plan.
Rate Limits
Professional Plan
100 requests/minuteSuitable for small to medium integrations
Enterprise Plan
1000 requests/minuteHigh-volume integrations and real-time processing
Monthly Quotas
Professional Plan
10,000 audits/monthEnterprise Plan
Unlimited auditsRate Limit Headers
All API responses include headers to help you track your current usage:
X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1642176000 X-Quota-Limit: 10000 X-Quota-Remaining: 9850 X-Quota-Reset: 1644768000
Security & Privacy
PackComply takes security and data privacy seriously. All API communications are encrypted and we follow industry best practices for data protection.
Security Features
TLS 1.3 Encryption
All API requests are encrypted in transit using TLS 1.3
API Key Rotation
Generate new API keys anytime and revoke old ones instantly
Webhook Signature Verification
All webhooks are signed with HMAC-SHA256 for authenticity
Data Encryption at Rest
All uploaded data is encrypted using AES-256 encryption
Data Retention
Uploaded packaging data: Retained for 90 days after upload
Audit results: Retained for 7 years for compliance record-keeping
API logs: Retained for 30 days for debugging and support
Compliance
Need Help?
Our technical team is here to help you integrate PackComply into your systems successfully.
Technical Support
Email: api-support@packcomply.com
Response time: 24 hours (Professional), 4 hours (Enterprise)