swagger: '2.0' info: version: 1.5.7 title: paccurate.io paths: /: post: description: | a pure-JSON endpoint for packing requests. produces: - application/json consumes: - application/json parameters: - name: pack in: body description: complete set of items, boxes, and parameters to pack. schema: $ref: "#/definitions/Pack" responses: 200: description: Successful pack. schema: type: object title: PackResponse properties: boxes: description: List of boxes, packed, with their contained items. type: array items: type: object properties: box: $ref: '#/definitions/Box' title: description: title of packing result, when applicable. type: string built: description: build timestamp of engine. type: string version: description: version of engine type: string lenBoxes: description: cardinality of all packed boxes type: integer lenItems: description: cardinality of all items type: integer lenLeftovers: description: cardinality of items unabled to be packed type: integer totalCost: description: total estimated cost of all packed boxes, when applicable, in cents. type: integer totalVolume: description: total volume of all boxes returned type: number totalVolumeNet: description: total net (item) volume of all packed (non-leftover) items type: number totalVolumeUsed: description: total net volume plus reserved volume from "reservedSpace" type: number totalVolumeUtilization: description: totalVolumeUsed divided by totalVolume type: number totalWeight: description: total gross weight of all packed boxes, including box tare weights and item weights. type: number packTime: description: seconds spent in packing type: number renderTime: description: seconds spent in rendering and placement instruction creation of packing solution type: number totalTime: description: seconds spent generating response, total. type: number leftovers: description: items left over that could not be packed into any available boxes. type: array items: $ref: '#/definitions/Item' itemSortUsed: description: name of item sort algorithm used. type: string boxTypeChoiceGoalUsed: description: name of box type choice goal used. type: string scripts: description: additional javascripts for any image loading. type: string styles: description: additional styles for pack images type: string svgs: description: all box SVG images type: array items: type: string orderId: description: a client-provided string identifier for the order this pack corresponds to. type: string requestId: description: a client-provided string identifier for the pack request being made. type: string images: description: if PNG imageFormat selected, list of PNG image objects. type: array items: $ref: '#/definitions/Image' usedKeyStem: description: stem of authorization key used, if any. type: string warnings: description: any warning messages about non-critical issues arising during the pack. required: false type: array items: type: string 400: description: Bad request. Malformed or some other problem occurred processing the request. schema: $ref: "#/definitions/Error" 422: description: Invalid input. The request was well-formed, but the parameters were contradictory, invalid, or otherwise somehow unable to be processed. More information will be contained in the error details. schema: $ref: "#/definitions/Error" 429: description: Rate limited. Without an API key, only 10 unique requests are allowed per day for testing or demonstration purposes. Note that a randomized pack repeated is only a single unique request. schema: $ref: "#/definitions/Error" 500: description: Unexpected error. schema: $ref: "#/definitions/Error" definitions: Error: type: object required: - message - code properties: message: type: string details: type: string code: type: integer minimum: 100 maximum: 600 Pack: type: object properties: key: description: issued API key. type: string requestId: description: a client-provided string identifier for the pack request being made. type: string orderId: description: a client-provided string identifier for the order this pack corresponds to. type: string layFlat: description: aligns all items laying flat. If possible, it may create a "brick-laying" pattern to increase stability. type: boolean default: false interlock: description: alternates layFlat orientation by layer, so as to create an interlocked placement pattern and improve item stability. type: boolean default: false corners: type: boolean description: only pack items at valid corner points of other items (optimal) default: true itemSets: description: item set definitions if not creating random items. type: array items: $ref: "#/definitions/ItemSet" example: - refId: 0 color: tomato dimensions: x: 4.2 y: 7 z: 8 weight: 4.5 quantity: 10 - refId: 1 color: cornflowerblue dimensions: x: 3 y: 3 z: 5 weight: 2 quantity: 13 boxTypes: description: box type definitions for packing, will override boxTypeSets defined. type: array items: $ref: "#/definitions/BoxType" boxTypeGenerators: description: list of dynamic boxTypeGenerators to use, in combination with boxTypes type: array items: $ref: "#/definitions/BoxTypeGenerator" boxTypeDefaults: description: default attributes for all "boxTypes", to be overridden by any individual "boxType" attributes specified. example: weightMax: 50 rateTable: dimFactor: 166 allOf: - $ref: "#/definitions/BoxProperties" boxes: description: pre-packed boxes, including any items specified that will be packed and excess space used before any new boxes are created. type: array items: $ref: "#/definitions/Box" example: [] usableSpace: description: an estimate of typical box utilization for the quick "estimated" boxTypeChoiceStyle, which will be used to ensure "estimated" box type choices are not overly optimistic regarding potential volume utilization. minimum: 0 maximum: 1 default: 0.85 example: 0.85 type: number reservedSpace: description: space in boxes that is reserved, i.e., for packing material. minimum: 0 maximum: 1 default: 0 example: 0.2 type: number boxTypeSets: description: predefined box types to be used, separated by commas. Will be overridden by boxTypes. Acceptable values are