Home|
API Referencev1.1
Control Center

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.

Method 1: Bearer TokenAuthorization: Bearer <YOUR_API_KEY>
Method 2: Custom API Headerx-api-key: <YOUR_API_KEY>

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 NameTriggered When
fabric.completedStoffrolle wird fertig beschriftet und QR-Code generiert.
fabric.discardedStoffrolle wird wegen schlechter Qualität o.ä. verworfen.
fabric.bulk_createdMassen-Import wird erfolgreich abgeschlossen.
fabric.bulk_updatedMassen-Update von Attributen wird durchgeführt.
API Playground & Reference

List Catalog Fabrics

Retrieve a paginated and filterable list of fabrics in the inventory catalog.

GET/api/v1/fabrics
Parameters
NameTypeRequiredDescription
limitintegerNoMax records (default: 100, max: 500) (e.g. 50)
offsetintegerNoPagination offset (default: 0) (e.g. 100)
statusstringNoFilter by: pending, completed, discarded (e.g. completed)
qstringNoSearch term for name or QR ID (e.g. Linen)
Request Sample
curl -X GET "https://your-app.com/api/v1/fabrics?status=completed&limit=10" \
  -H "Authorization: Bearer my-secret-api-key"
Response JSON
{
  "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.

GET/api/v1/fabrics/[qrCodeId]
Parameters
NameTypeRequiredDescription
qrCodeIdstringYesUnique scannable code ID (e.g. FABRIC-8A7B6C5D)
Request Sample
curl -X GET "https://your-app.com/api/v1/fabrics/FABRIC-8A7B6C5D" \
  -H "x-api-key: my-secret-api-key"
Response JSON
{
  "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).

POST/api/v1/fabrics/bulk
Request Sample
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"}]'
Payload Schema
[
  {
    "image_url": "https://storage/swatch1.jpg",
    "name": "Initial roll name 1",
    "color": "Red"
  },
  {
    "image_url": "https://storage/swatch2.jpg",
    "name": "Initial roll name 2"
  }
]
Response JSON
{
  "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.

PATCH/api/v1/fabrics/bulk
Request Sample
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"}]'
Payload Schema
[
  {
    "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"
  }
]
Response JSON
{
  "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.

GET/api/v1/integration/test
Request Sample
curl -X GET "https://your-app.com/api/v1/integration/test" \
  -H "x-api-key: my-secret-api-key"
Response JSON
{
  "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.

POST/api/v1/webhooks
Request Sample
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": ["*"]}'
Payload Schema
{
  "target_url": "https://your-erp.com/webhooks/fabric",
  "secret_token": "my-secret-signing-key",
  "events": ["fabric.completed", "fabric.discarded"]
}
Response JSON
{
  "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"
  }
}