Paxon
Paxon MultiBoxPacker Service de cartonnage
API
FR

Référence API

Appelez le moteur d'emballage directement via HTTP. Envoyez un envoi (produits et types de cartons) et recevez l'ensemble optimal de colis. Les réponses sont déterministes pour une requête donnée.

URL de base

http://localhost:5180

Authentification

Chaque requête doit inclure votre clé API dans l'en-tête X-Api-Key. Contactez votre administrateur Paxon pour obtenir une clé.

X-Api-Key: your-api-key

Point de terminaison

POST http://localhost:5180/api/v1/pack

Champs de la requête

FieldTypeNotes
maxParcelsintMax parcels (boxes + boxless).
rotationModestringNone | UprightOnly | Free.
productsarrayid, length, width, height (mm), weight (g), quantity, breakable, dg, boxless?, orientationConstrained?, tags?.
boxTypesarrayid, length, width, height (mm), maxWeight (g), breakableAllowed, dgAllowed, priority (lower preferred), minCutHeight? (mm — the machine can trim the box down to this height).
rulesarray?type (keep-separate | keep-together | limit-quantity), tagA, tagB?, quantity?.
maxRuntimeSecondsint?Override the solve budget (bounded by a server ceiling).
forceRecomputebool?Bypass the cache lookup (result still cached).

Champs de la réponse

FieldTypeNotes
statusstringSUCCESS | NO_SOLUTION | NOT_FOUND | ERROR.
parcelsUsedintBoxes + boxless items used.
boxesarrayChosen boxes with their placements, contentsHeight (mm, how tall the contents stack) and cutHeight? (mm, present only when the box is cuttable).
boxlessItemsarrayItems shipped without a box.
timedOutboolTrue if the solve budget elapsed.
runtimeMslongSolve time in milliseconds.
errorsarray?Present when status is ERROR.

Statut du résultat

SUCCESS : une solution a été trouvée. NO_SOLUTION : prouvé impossible dans les limites. NOT_FOUND : aucune solution trouvée mais l'impossibilité n'est pas prouvée (voir timedOut). ERROR : la requête était invalide (voir errors).

Erreurs

Une saisie invalide renvoie un HTTP 200 avec le statut ERROR et un tableau errors ; chaque entrée a un code (un chemin de champ tel que products[0].weight) et un message lisible.

Limites

Jusqu'à 100 requêtes par minute et par adresse IP ; les corps de requête sont limités à 1 MB.

Exemple de requête

{
  "maxParcels": 6,
  "rotationMode": "Free",
  "products": [
    { "id": "SKU-1", "length": 220, "width": 150, "height": 20, "weight": 500, "quantity": 1, "breakable": false, "dg": false }
  ],
  "boxTypes": [
    { "id": "A1", "length": 225, "width": 150, "height": 100, "maxWeight": 15000, "breakableAllowed": true, "dgAllowed": true, "priority": 20, "minCutHeight": 20 }
  ]
}

Exemple de réponse

{
  "success": true,
  "parcelsUsed": 1,
  "boxes": [ { "boxTypeId": "A1", "contentsHeight": 20, "cutHeight": 20, "placements": [ { "productId": "SKU-1" } ] } ],
  "boxlessItems": [],
  "status": "SUCCESS",
  "timedOut": false,
  "runtimeMs": 3
}