API-Referenz

Next Commerce API

REST-API für Hersteller und Händler. Produkte importieren, Händler verwalten, Bestellungen verarbeiten und GPSR-Compliance steuern.

Base URL https://portal.next-commerce.io
📖

Übersicht

🏭 Hersteller-API
Produkte, Händler, Webhooks, Compliance / GPSR
🏪 Händler-API
Inventar, Zuweisungen, Stripe-Auszahlungen
🔒 Session-Cookie
NextAuth.js. Öffentliche Widget-Endpunkte: kein Auth.
📦 application/json
Standard. Ausnahmen als multipart/form-data markiert.
⚙️

Konventionen

FeldHinweisBeispiel
PreiseInteger · Cent2500 = 25.00 EUR
LänderISO 3166-1 alpha-2DE, AT, CH
ZeitstempelISO 86012026-04-17T10:30:00Z
SKUEindeutig je HerstellerbrandId + sku
Pagination Envelope
{
  "success": true,
  "data": [...],
  "pagination": {
    "page": 1, "limit": 30, "totalCount": 142,
    "hasNextPage": true, "hasPreviousPage": false
  }
}
🔑

Authentifizierung

Session-Cookie via NextAuth.js

ℹ️
Session-Cookie: Alle Dashboard-APIs benötigen einen gültigen Session-Cookie. Öffentliche Endpunkte (Widget, Checkout) sind auth-frei.
POST/api/auth/register
POST/api/auth/callback/credentials
POST/api/auth/forgot-password
GET/api/auth/verify-email?token=xxx
📦

Hersteller — Produkte

role: BRAND

GET/api/brand/products?page=1&limit=30
POST/api/brand/products
GET/api/brand/products/:id
POST/api/brand/products/bulk-import
POST/api/brand/products/bulk-assign
POST/api/brand/products/activate
🤝

Hersteller — Händler

role: BRAND

GET/api/brand/dealers?productId=xxx
PATCH/api/brand/dealers/countries
POST/api/brand/dealers/:dealerId/assign-products
POST/api/brand/invitations
🔔

Hersteller — Webhooks

role: BRAND

💡
Webhooks senden POST bei Bestellereignissen. Retry-Backoff: 1 min → 5 min → 30 min → 2 Std → 24 Std.
POST/api/brand/webhooks
🛡️

Hersteller — Compliance / GPSR

role: BRAND · ListingShield

ℹ️
Compliance kaskadiert: Hersteller → Kategorie → Produkt. Produktwerte überschreiben Kategorie-Werte.
GET/api/brand/compliance/company
POST/api/brand/compliance/categories
GET/api/brand/products/:id/compliance
POST/api/brand/compliance/invite-dealer
📦

Händler — Inventar

role: DEALER

POST/api/dealer/inventory
PUT/api/dealer/inventory/:id
DELETE/api/inventory/:id
📋

Händler — Zuweisungen

role: DEALER

GET/api/dealer/assignments?status=PENDING
POST/api/dealer/assignments/:id/accept
DELETE/api/dealer/assignments/:id
🛒

Händler — Bestellungen

role: DEALER

POST/api/dealer/orders/refund
💰

Händler — Stripe

role: DEALER

💡
Händler erhalten ihre Marge via Stripe Split-Payment automatisch bei Kaufabschluss.
POST/api/dealer/stripe/onboarding-link
📡

Webhook Events

EventWann
order.createdBestellung erstellt, Zahlung ausstehend
order.confirmedZahlung erfolgreich
order.fulfilledVersandt
Webhook Payload
{
  "event": "order.created",
  "timestamp": "2026-04-17T10:30:00Z",
  "data": {
    "orderId": "order_id", "orderCode": "ORD-12345",
    "grandTotal": 10700, // 107,00 EUR
    "currency": "EUR",
    "customer": { "email": "[email protected]" },
    "items": [{ "sku": "ABC-123", "quantity": 1, "dealerId": "dealer_id" }]
  }
}
⚠️

Fehler & HTTP-Codes

Error Format
{
  "error": "Human-readable message",
  "code": "MACHINE_READABLE_CODE",
  "required": ["field1"]
}
StatusBedeutung
200OK
400Validation error
401Not authenticated
403Not authorized / COUNTRY_NOT_ASSIGNED
404Not found
409Conflict
429Rate limited
500Server error
🚦

Rate Limits

TierLimitFensterGilt für
AUTH51 min / IPRegister, login, password reset
REGISTRATION_EMAIL524h / emailRegistration only
AUTHENTICATED5001 min / IPAll dashboard APIs
PUBLIC1001 min / IPWidget, checkout
429 Response
{ "error": "Too many requests", "retryAfter": 45 }