API & Integration Spec
Erstelle Echtzeit-Workflows und integriere deine Logistics-Desk direkt in Warenwirtschaftssysteme (ERP), Shopify oder No-Code-Plattformen wie Zapier und Make.
Authentication
Alle API-Routen unter `/api/v1` sind geschützt. Du kannst dich entweder über einen klassischen Bearer-Token im Authorization-Header oder über einen benutzerdefinierten Header autorisieren.
Webhook Security
Wenn du einen Webhook mit einem `secret_token` registrierst, signiert der Dispatcher jede Anfrage. So stellst du sicher, dass Aufrufe wirklich von unserem System stammen.
Signatur-Validierung (Beispiel Node.js)
const crypto = require('crypto');
const signature = req.headers['x-webhook-signature'];
const expectedSignature = crypto
.createHmac('sha256', SECRET_TOKEN)
.update(JSON.stringify(req.body))
.digest('hex');
if (signature === expectedSignature) {
// Payload ist authentisch
}| Event Name | Triggered When |
|---|---|
| fabric.completed | Stoffrolle wird fertig beschriftet und QR-Code generiert. |
| fabric.discarded | Stoffrolle wird wegen schlechter Qualität o.ä. verworfen. |
| fabric.bulk_created | Massen-Import wird erfolgreich abgeschlossen. |
| fabric.bulk_updated | Massen-Update von Attributen wird durchgeführt. |
List Catalog Fabrics
Retrieve a paginated and filterable list of fabrics in the inventory catalog.
| Name | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Max records (default: 100, max: 500) (e.g. 50) |
| offset | integer | No | Pagination offset (default: 0) (e.g. 100) |
| status | string | No | Filter by: pending, completed, discarded (e.g. completed) |
| q | string | No | Search term for name or QR ID (e.g. Linen) |
curl -X GET "https://your-app.com/api/v1/fabrics?status=completed&limit=10" \ -H "Authorization: Bearer my-secret-api-key"
{
"data": [
{
"id": "8a7b6c5d-4e3d-2c1b-0a9f-8e7d6c5b4a3f",
"qr_code_id": "FABRIC-8A7B6C5D",
"name": "Indigo Herringbone Linen",
"status": "completed",
"color": "Indigo",
"pattern": "Herringbone",
"material": "Linen",
"created_at": "2026-06-12T17:42:05Z",
"assets": {
"image_url": "https://supabase-storage/fabric-images/fabric_123.jpg"
}
}
],
"pagination": { "limit": 100, "offset": 0, "count": 24 }
}Retrieve Single Fabric
Fetch detailed fabric roll specifications by its unique QR code ID.
| Name | Type | Required | Description |
|---|---|---|---|
| qrCodeId | string | Yes | Unique scannable code ID (e.g. FABRIC-8A7B6C5D) |
curl -X GET "https://your-app.com/api/v1/fabrics/FABRIC-8A7B6C5D" \ -H "x-api-key: my-secret-api-key"
{
"data": {
"id": "8a7b6c5d-4e3d-2c1b-0a9f-8e7d6c5b4a3f",
"qr_code_id": "FABRIC-8A7B6C5D",
"name": "Indigo Herringbone Linen",
"status": "completed",
"color": "Indigo",
"pattern": "Herringbone",
"material": "Linen",
"created_at": "2026-06-12T17:42:05Z",
"session": { "id": "uuid-lobby-code", "code": "XYZ-LOBBY" },
"assets": { "image_url": "https://storage/swatch.jpg" }
}
}Bulk Import Fabrics
Batch insert newly arrived fabrics (inserts status as "pending" for tagging).
curl -X POST "https://your-app.com/api/v1/fabrics/bulk" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-secret-api-key" \
-d '[{"image_url": "https://pic.jpg", "name": "Bulk Silk"}]'[
{
"image_url": "https://storage/swatch1.jpg",
"name": "Initial roll name 1",
"color": "Red"
},
{
"image_url": "https://storage/swatch2.jpg",
"name": "Initial roll name 2"
}
]{
"success": true,
"count": 2,
"data": [
{ "id": "uuid-1", "qr_code_id": "FABRIC-ABC12345", "status": "pending" },
{ "id": "uuid-2", "qr_code_id": "FABRIC-XYZ98765", "status": "pending" }
]
}Bulk Update Fabrics
Update attributes (name, status, color, pattern, material, etc.) for multiple fabric records in one batch.
curl -X PATCH "https://your-app.com/api/v1/fabrics/bulk" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-secret-api-key" \
-d '[{"id": "uuid-1", "name": "New Name"}]'[
{
"id": "8a7b6c5d-4e3d-2c1b-0a9f-8e7d6c5b4a3f",
"name": "Updated Linen",
"color": "Soft Indigo",
"status": "completed"
},
{
"id": "1e2f3a4b-5c6d-7e8f-9a0b-1c2d3e4f5a6b",
"status": "discarded",
"rejection_reason": "Out of stock"
}
]{
"success": true,
"count": 2,
"data": [
{ "id": "8a7b6c5d...", "name": "Updated Linen", "status": "completed" },
{ "id": "1e2f3a4b...", "status": "discarded" }
]
}Verify Connection
Einfacher Verbindungstest zur Verifizierung des API-Schlüssels für Zapier/Make.com.
curl -X GET "https://your-app.com/api/v1/integration/test" \ -H "x-api-key: my-secret-api-key"
{
"authenticated": true,
"message": "Connection successful. Fabric inventory API is ready.",
"environment": "production",
"info": {
"system": "Real-Time Fabric Inventory",
"api_version": "v1"
},
"team": {
"id": "team-uuid",
"name": "Munich Logistics Hub"
}
}Register Webhook
Subscribe a URL endpoint to real-time events triggered inside the warehouse.
curl -X POST "https://your-app.com/api/v1/webhooks" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer my-secret-api-key" \
-d '{"target_url": "https://erp.com", "events": ["*"]}'{
"target_url": "https://your-erp.com/webhooks/fabric",
"secret_token": "my-secret-signing-key",
"events": ["fabric.completed", "fabric.discarded"]
}{
"data": {
"id": "webhook-subscription-uuid",
"target_url": "https://your-erp.com/webhooks/fabric",
"secret_token": "my-secret-signing-key",
"events": ["fabric.completed", "fabric.discarded"],
"active": true,
"created_at": "2026-06-12T19:00:00Z"
}
}