API-Dokumentation

Ship-ify API-Referenz

Vollständige Anleitung zur Integration der Ship-ify Verpackungsoptimierungs-API in Ihre Anwendungen.

Interaktive API (Swagger)

Übersicht

Die Ship-ify API bietet 3D-Bin-Packing-Optimierung für E-Commerce-Sendungen. Bei gegebenen verfügbaren Kartongrößen und zu versendenden Artikeln berechnet die API die optimale Verpackungskonfiguration, um Versandkosten zu minimieren und gleichzeitig die Kartonauslastung zu maximieren.

Schnelle Optimierung

Ergebnisse in Millisekunden mit fortschrittlichen Algorithmen

3D-Verpackung

Echte 3D-Bin-Verpackung mit Rotationsunterstützung

Gewichtsbeschränkungen

Berücksichtigt Gewichtsgrenzen für jeden Kartontyp

Visualisierung

3D-HTML-Visualisierung (Pro & Enterprise)

Authentifizierung

Alle API-Anfragen erfordern eine Authentifizierung mit einem API-Schlüssel. Fügen Sie Ihren API-Schlüssel in die Anfrage-Header ein:

Authorization: Bearer YOUR_API_KEY

Important: Halten Sie Ihre API-Schlüssel sicher. Legen Sie sie niemals im clientseitigen Code oder in öffentlichen Repositories offen.

Sie können API-Schlüssel von Ihrem Dashboard.

Endpunkte

POST/api/v1/shipping-optimize

Optimieren Sie die Verpackung für eine Reihe von Artikeln in verfügbare Kartons.

Anfragekörper

JSON-Objekt mit boxes, items und options (siehe Anfrageformat)

GET/api/v1/shipping-optimize

Rufen Sie API-Funktionen, Nutzungsstatistiken und Beispielanfragen für Ihre Stufe ab.

Antwort

JSON-Objekt mit Stufenfähigkeiten, Kontingentinfo und Nutzungsstatistiken

Karton-Sets

Karton-Sets ermöglichen es Ihnen, Kartonkonfigurationen über API-Anfragen hinweg zu speichern und wiederzuverwenden. Anstatt das vollständige boxes-Array mit jeder Anfrage zu senden, können Sie ein gespeichertes Set über seinen eindeutigen Schlüssel referenzieren.

Tip: Erstellen Sie separate Karton-Sets für verschiedene Versandszenarien, wie Standard-Wellpappe vs. isolierte Kartons für temperaturempfindliche Artikel.

Karton-Sets verwalten

Erstellen und verwalten Sie Ihre Karton-Sets über das Karton-Sets-Dashboard. Jedes Set erhält einen eindeutigen Schlüssel wie bs_abc123xyz456.

Verwendung von Karton-Sets in Anfragen

Verwenden Sie boxSetKey anstelle des boxes-Arrays:

{
  "boxSetKey": "bs_abc123xyz456",
  "items": [
    {
      "id": "item-001",
      "name": "Product A",
      "dimensions": { "length": 4, "width": 3, "height": 2 },
      "weight": 1.5,
      "quantity": 2
    }
  ],
  "options": {
    "algorithm": "shipify-ultra"
  }
}

Karton-Set-Limits nach Stufe

StufeMax Sets
Free1 (max 10 boxes)
Basic2 (max 20 boxes each)
Pro5 (max 50 boxes each)
Enterprise50 (max 100 boxes each)

Anfrageformat

Der POST-Anfragekörper muss entweder boxes oder boxSetKey enthalten, plus items, und optional options.

Box-Objekt

FeldTypErforderlichBeschreibung
idstringYesEindeutige Kennung für den Kartontyp
namestringNoLesbarer Name
dimensionsobjectYes{ length, width, height } in Ihrer bevorzugten Einheit
weightCapacitynumberNoStrukturelle Gewichtsgrenze des Kartons - maximales Gewicht, das das Kartonmaterial physisch tragen kann
costnumberNoKosten pro Karton für die Optimierung

Item-Objekt

FieldTypeRequiredDescription
idstringYesUnique identifier for the item
namestringNoHuman-readable name
dimensionsobjectYes{ length, width, height } in your preferred unit
weightnumberNoItem weight for constraint checking
quantitynumberNoNumber of this item to pack (default: 1)
fragilebooleanNoMark as fragile for special handling
keepUprightbooleanNoPrevent vertical rotation
fragilityLevelnumberNoZerbrechlichkeitsstufe von 0 (robust) bis 5 (extrem zerbrechlich). Wird von shipify-physics für Stapelentscheidungen verwendet. (Nur Pro+)
maxTopLoadnumberNoMaximales Gewicht, das dieser Artikel oben tragen kann. Wird von shipify-physics zur Durchsetzung von Tragfähigkeitsgrenzen verwendet. (Nur Pro+)

Options-Objekt

FeldTypStandardBeschreibung
algorithmstring"shipify-ultra"Packing algorithm (see Algorithms section)
allowRotationbooleantrueAllow items to be rotated for better fit
prioritizestring"space""space" | "cost" | "speed" | "consolidation"
enableVisualizationbooleanfalseInclude 3D HTML visualization (Basic+ only)
maxShipmentWeightnumber-Carrier weight limit - shipments above this threshold incur overweight fees
oversizedItemHandlingstring"unpacked""custom-box" | "unpacked" - How to handle items larger than any available box
overweightItemHandlingstring"allow""allow" | "unpacked" - How to handle items heavier than maxShipmentWeight (defaults to "allow" when maxShipmentWeight is set)

Understanding Weight Constraints

The API supports two distinct types of weight constraints:

Box Structural Limit (weightCapacity)

Set on each box type. This represents the maximum weight the box material can physically hold without breaking. The optimizer will not place items that would exceed this structural limit.

"boxes": [{ "id": "medium", "weightCapacity": 25, ... }]
Carrier Shipment Limit (maxShipmentWeight)

Set in options. This represents the carrier threshold above which overweight fees apply. All shipments will be optimized to stay under this limit regardless of box capacity. When this option is set, all items must have a weight property defined.

"options": { "maxShipmentWeight": 50 }
Overweight Item Handling (overweightItemHandling)

When a single item exceeds the maxShipmentWeight, this option controls how it's handled:

  • "allow" (default): Item is allowed to ship alone in a box, weight limit waived for this shipment
  • "unpacked": Item is placed in the unpackedItems array with reason
"options": { "maxShipmentWeight": 50, "overweightItemHandling": "unpacked" }

Both constraints are enforced simultaneously. A shipment must satisfy both the box structural capacity and the carrier weight limit.

Stapelbestellungen

Process multiple orders in a single API request. Instead of sending individual items, you can send an array of orders, each with its own items. The API will optimize packing for each order independently and return consolidated results.

Availability: All tiers

Batch order processing is available for all subscription tiers with the same limits.

Batch Limits

Limit TypeValue
Max Orders per Batch50
Max Items per Order100
Max Total Items per Batch500

Batch Request Format

Use the orders array instead of items. Each order must have an orderId and its own items array.

{
  "boxes": [
    { "id": "small", "name": "Small Box", "dimensions": { "length": 10, "width": 8, "height": 6 }, "cost": 2.50 },
    { "id": "medium", "name": "Medium Box", "dimensions": { "length": 14, "width": 12, "height": 10 }, "cost": 4.00 }
  ],
  "orders": [
    {
      "orderId": "ORD-001",
      "items": [
        { "id": "item-1", "name": "Book", "dimensions": { "length": 9, "width": 6, "height": 1.5 }, "weight": 1.2, "quantity": 2 }
      ]
    },
    {
      "orderId": "ORD-002",
      "items": [
        { "id": "item-2", "name": "Laptop", "dimensions": { "length": 14, "width": 10, "height": 2 }, "weight": 4.5, "quantity": 1 },
        { "id": "item-3", "name": "Charger", "dimensions": { "length": 4, "width": 3, "height": 2 }, "weight": 0.3, "quantity": 3 }
      ]
    }
  ],
  "options": {
    "algorithm": "shipify-ultra"
  }
}

Batch Response Format

The response includes results for each order plus an overall summary.

{
  "success": true,
  "batch": true,
  "results": [
    {
      "orderId": "ORD-001",
      "success": true,
      "data": {
        "shipments": [...],
        "unpackedItems": [],
        "summary": { "totalShipments": 1, "totalCost": 2.50, ... }
      }
    },
    {
      "orderId": "ORD-002",
      "success": true,
      "data": {
        "shipments": [...],
        "unpackedItems": [],
        "summary": { "totalShipments": 1, "totalCost": 4.00, ... }
      }
    }
  ],
  "summary": {
    "totalOrders": 2,
    "successfulOrders": 2,
    "failedOrders": 0,
    "totalBoxesUsed": 2,
    "totalCost": 6.50,
    "averageUtilization": 42.5,
    "totalItemsPacked": 3,
    "totalItemsUnpacked": 0
  },
  "metadata": {
    "algorithm": "shipify-ultra",
    "executionTime": "45ms",
    "timestamp": "2025-12-06T12:00:00.000Z"
  }
}

Backward Compatibility

The original single-order format using items array continues to work. Batch processing is only triggered when the orders array is present.

Antwortformat

Successful responses include shipment details, packing statistics, and metadata.

Response Structure

FieldDescription
successBoolean indicating request success
data.shipmentsArray of shipment objects with packed items
data.unpackedItemsItems that couldn't fit in any box
data.summaryAggregated statistics (total cost, utilization, etc.)
data.suggestionsOptimization suggestions
metadataAlgorithm used, execution time, tier info
visualizationHtml3D HTML visualization (Pro+ only)

Box Structure in Shipments

Each shipment contains a box object with the following fields:

FieldTypeDescription
idstringBox ID (from your submitted boxes, or "custom-*" for oversized items)
namestringBox name (or "Custom Box" for oversized items)
dimensionsobject{ length, width, height } of the box
costnumberBox cost (optional, 0 for custom boxes)
typestring"custom" when oversizedItemHandling is "custom-box" (only present for custom boxes)

Packed Items Structure

Each packed item in a shipment includes the following fields:

FieldTypeDescription
itemIdstringOriginal item ID as submitted in the request
itemIndexnumberIndex within quantity expansion (0, 1, 2, ...). For items with quantity > 1, each instance gets a unique index.
positionobject{ x, y, z } coordinates of item placement in the box
rotationobjectAxis mapping showing how item was rotated to fit
rotatedDimensionsobject{ length, width, height } after rotation applied

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 985
X-RateLimit-Reset: 2025-11-30T00:00:00.000Z

Algorithmen

Choose the algorithm that best fits your use case. Algorithm availability depends on your subscription tier.

first-fitBasic+

Fast, simple algorithm that places items in the first available space. Best for speed-critical applications.

best-fitBasic+

Finds the best fitting space for each item, improving utilization over first-fit.

guillotineBasic+

Divides space into rectangles for efficient 2D packing. Good balance of speed and utilization.

max-rectsPro+

Advanced algorithm maintaining multiple free rectangles for optimal packing.

shipify-ultraAll Tiers (Default)

Our smartest algorithm, optimized for both binning (grouping items into separate shipments) and packing (placing items into the smallest possible box). Uses look-ahead optimization, post-pack consolidation, and multi-pass refinement to minimize total boxes and maximize space utilization. Best for most use cases.

shipify-fitPro+

Combines global box selection strategy with fast 3D placement. Uses O(items × boxes × positions) complexity for efficient packing with excellent results.

shipify-maxBasic+

Weight-based grouping algorithm that groups items by order, splits bundles exceeding weight limits, consolidates small bundles, and validates each bundle with 3D packing. Ideal for multi-order shipments where weight-based grouping is preferred.

shipify-physicsAll Tiers

Physics-aware packing algorithm that prioritizes heavier items at the bottom for stability, respects fragility levels (0-5), enforces load capacity limits, and validates center of gravity balance. Includes support area validation (70% minimum) and rotation constraints for fragile items. Advanced features (fragilityLevel, maxTopLoad) require Pro or Enterprise tier.

Abonnementstufen

Choose the plan that fits your needs. FREE tier includes shipify-ultra and shipify-physics algorithms.

FeatureFree ($0)Basic ($5/mo)Pro ($20/mo)Enterprise ($80/mo)
Items/Month1,0005,00025,000125,000
Max Items per Request10251001,000
Max Box Types per Request102050100
API Keys11510
Batch Orders (max/items/total)50/100/50050/100/50050/100/50050/100/500
3D Visualization-
Algorithms2 (shipify-ultra, physics)68 (+max-rects, shipify-fit)All 8
Overage Rate (per 1000 items)$2.00$1.50$1.20$1.00

Algorithm Availability by Tier

  • FREE: shipify-ultra, shipify-physics
  • BASIC: FREE + first-fit, best-fit, guillotine, shipify-max
  • PRO: All BASIC algorithms + max-rects, shipify-fit
  • ENTERPRISE: All 8 algorithms

Rate-Limits

Why We Count Items, Not API Requests

Batching multiple orders into a single API call is more efficient for everyone. Charging per item optimized aligns with our CPU costs and encourages you to batch orders for maximum efficiency. This means you can send 100 orders in one batch request and pay the same as 100 individual requests with one order each.

Usage limits are based on items processed per month (counting item quantities). Limits reset on the 1st of each month. When you exceed your limit, the API returns a 429 status code with details about your usage.

TierMonthly Item LimitOverage Rate
FREE1,000 items$2.00 / 1,000 items
BASIC5,000 items$1.50 / 1,000 items
PRO25,000 items$1.20 / 1,000 items
ENTERPRISE125,000 items$1.00 / 1,000 items

Rate Limit Response

{
  "error": "Monthly item limit exceeded",
  "message": "This request would use 50 items, but you only have 25 items remaining in your monthly quota of 1000 items.",
  "itemsRequested": 50,
  "itemsRemaining": 25,
  "monthlyLimit": 1000,
  "resetAt": "2026-02-01T00:00:00.000Z"
}

Response Headers

Every API response includes usage headers:

  • X-RateLimit-Limit: Your monthly item limit
  • X-RateLimit-Remaining: Items remaining after this request
  • X-RateLimit-Reset: When your quota resets (1st of next month)
  • X-Items-Used: Total items used this month

Fehlercodes

StatusErrorDescription
400Invalid requestMissing or malformed boxes/items
401Authentication failedInvalid or missing API key
403Feature not availableAlgorithm or feature not in your tier
403Limit exceededToo many items or box types for your tier
429Monthly item limit exceededMonthly item quota exhausted
500Internal server errorServer-side error, please retry

Beispiele

Beispielanfrage

{
  "boxes": [
    {
      "id": "b1-box",
      "name": "Box B1",
      "dimensions": {
        "length": 7,
        "width": 7,
        "height": 12
      },
      "weightCapacity": 25,
      "cost": 1.18
    },
    {
      "id": "b3-box",
      "name": "Box B3",
      "dimensions": {
        "length": 11,
        "width": 10,
        "height": 14
      },
      "weightCapacity": 35,
      "cost": 2.11
    },
    {
      "id": "b7-box",
      "name": "Box B7",
      "dimensions": {
        "length": 20,
        "width": 16,
        "height": 18
      },
      "weightCapacity": 55,
      "cost": 3.98
    }
  ],
  "items": [
    {
      "id": "BOOK-001",
      "name": "Hardcover Book",
      "dimensions": {
        "length": 9.5,
        "width": 7.5,
        "height": 1.5
      },
      "weight": 1.8,
      "quantity": 2
    },
    {
      "id": "LAPTOP-COMP",
      "name": "Laptop Computer",
      "dimensions": {
        "length": 18,
        "width": 11,
        "height": 4.5
      },
      "weight": 6.8,
      "quantity": 1
    }
  ],
  "options": {
    "algorithm": "shipify-ultra",
    "allowRotation": true,
    "prioritize": "space",
    "enableVisualization": true
  }
}

Beispielantwort

{
  "success": true,
  "data": {
    "shipments": [
      {
        "box": {
          "id": "b7-box",
          "name": "Box B7",
          "dimensions": {
            "length": 20,
            "width": 16,
            "height": 18
          },
          "cost": 3.98
        },
        "packedItems": [
          {
            "itemId": "BOOK-001",
            "itemIndex": 0,
            "position": {
              "x": 0,
              "y": 0,
              "z": 0
            },
            "rotation": {
              "lengthAxis": "x",
              "widthAxis": "y",
              "heightAxis": "z"
            },
            "rotatedDimensions": {
              "length": 9.5,
              "width": 7.5,
              "height": 1.5
            }
          },
          {
            "itemId": "BOOK-001",
            "itemIndex": 1,
            "position": {
              "x": 9.5,
              "y": 0,
              "z": 0
            },
            "rotation": {
              "lengthAxis": "x",
              "widthAxis": "y",
              "heightAxis": "z"
            },
            "rotatedDimensions": {
              "length": 9.5,
              "width": 7.5,
              "height": 1.5
            }
          },
          {
            "itemId": "LAPTOP-COMP",
            "itemIndex": 0,
            "position": {
              "x": 0,
              "y": 0,
              "z": 1.5
            },
            "rotation": {
              "lengthAxis": "x",
              "widthAxis": "y",
              "heightAxis": "z"
            },
            "rotatedDimensions": {
              "length": 18,
              "width": 11,
              "height": 4.5
            }
          }
        ],
        "utilization": {
          "volume": 18.2,
          "weight": 18.9
        },
        "totalWeight": 10.4
      }
    ],
    "unpackedItems": [],
    "summary": {
      "totalShipments": 1,
      "totalCost": 3.98,
      "averageUtilization": 18.2,
      "packingEfficiency": 18,
      "itemsSuccessfullyPacked": 3,
      "itemsUnpacked": 0
    },
    "suggestions": [
      "Shipify-Ultra algorithm: Enhanced with look-ahead and consolidation"
    ]
  },
  "metadata": {
    "algorithm": "shipify-ultra",
    "executionTime": "32ms",
    "timestamp": "2025-12-06T12:00:00.000Z",
    "tier": "FREE"
  }
}

cURL-Beispiel

curl -X POST https://ship-ify.com/api/v1/shipping-optimize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "boxes": [
      {
        "id": "small-box",
        "dimensions": { "length": 10, "width": 8, "height": 6 }
      }
    ],
    "items": [
      {
        "id": "item-1",
        "dimensions": { "length": 4, "width": 3, "height": 2 },
        "quantity": 1
      }
    ]
  }'

Jetzt ausprobieren!

Testen Sie die API interaktiv auf unserer Startseite mit dem integrierten API-Tester.