---
title: Stacking & Nesting
slug: docs/stacking-nesting
description: Discover how to optimize shipping with Paccurate's stacking and nesting features. Learn to use compact-pattern for efficient item stacking and internal-space rules to utilize empty spaces within larger items, reducing wasted space and shipping costs.
icon: 🪺
docTags: 
createdAt: 2025-05-28T16:27:05.964Z
---

Oftentimes, shippers need to pack and ship items whose packed dimensions, when sending multiples, are in reality much smaller than the item count multiplied by the item’s cubic volume. Items can stack or compress due to their shape, and thus take up less space in a carton or container. Prime examples of this are things like trash cans, traffic cones, or even baseball caps. Additionally, items may have space available within them to place other items that may be in an order, creating the opportunity to nest a smaller item inside another one.

## Stacking

Paccurate has a pair of rules to address both of these instances, and they can be combined. Let’s start with stacking behavior. As an example, we can use a traffic cone as the target item which we need to stack and pack.

The Paccurate rule for this is called `compact-pattern` and the options associated with it are

- `compactibleAxes` : an array, max length of 3, containing the axis index of each changing dimension. A value of \[0, 1] would mean that the height (0, X axis) and length (1, y axis) are compactible. Putting an axis index in this array essentially “activates” the axis to watch for items places alongside it.
- `compactProperties` : an array that contains a list of config objects with the attributes `targetRefId` (the refId of an item that triggers an item’s compaction), `compactedStackSizeLimit` (maximum amount of items to be stacked before pattern starts over), and `compactibleAxisDimensionChange`, which is a child array that supports multiple objects which define how each axis should change. The child array’s order maps to the `compactibleAxes` array order.

:::hint{type="warning"}
**The&#x20;**`compactibleAxisDimensionChange`**&#x20;array sequence is important.**

The index of the compaction definition is applied when the `compactibleAxis` with the same array index is triggered. For example if an item’s x and z axes can compact, the `compactibleAxes` would be `[0, 2]` , and `compactibleAxisDimensionChange` array would be something like `[{"x":-2.5}, {"z":-0.5}]` . This means an item placed on *top* of the item (along the X axis — 0 in the `compactibleAxes` array) would match the *first* rule in `compactibleAxisDimensionChange` array, and the first compacted dimension would be applied accordingly (`{"x":-2.5}`).
:::



Here is an example of a fully composed “compact-pattern” rule:

```jsx
{
	"rules": [
    {
      "itemMatch": {
        "property": "sequence",
        "expression": "cone"
      },
      "operation": "compact-pattern",
      "options": {
        "compactibleAxes": [
          0
        ],
        "compactProperties": [
          {
            "targetRefId": null,
            "compactibleAxisDimensionChange": [
              {
                "x": -8.5
              }
            ]
          }
        ]
      }
    }
  ]
 }
```

:::Iframe{iframeHeight="700" code="<iframe src=&#x22;https://inspector.manage.paccurate.io/config-editor?config=N4Ig9gTgJgphCWUQC4QE4CsAGAHAJjRABoR4AXGAWwGUYyBnFAbVAhgDMBJJZLEgdxjwA5gAsyKPCQCOAVwCGAOzLkAnigwlF8yjBQgACvIgBreIuEACAMJhFekvRhyYigMZ7Ubuw5BR4uor08HaMyKAAHigAjHwg6sgAbCQAXiiJAL4k3gA2kPoAxNgAzDBoOCAZALokELI5MGEspBSUALLyZG6iKKAADhBgfXBkCSBOLu6%20MBEDjcF2%20t72lSRDcJ0hiktglH3ybmQAtPtkFBDba30qob0g8jnn2ioWKGR1MNm7%204fwAEYNACCEUazCwNRA3j2BzIBkGwwgKlByGaZGMwjoACUONwUIp6jkvtDfgCYMD4PQACIBVwLRTWURKDHMSIoI6JAB0GGqPOqJD%20YAiABVVMMmqBBCJxB0oshinFtLp9DgABqqiokfyBOlhVnIHAkBIGkBpfUZLISoRiMgylAAFgVOk8IAA7Cq3YliH4aUEtrqQLKXYaUEGTelzURLVKbfJZfKtE79NE8CrkyrPZqfTq7rLk8HkHmw0kI1HrbbkA6E0rUNFiqm67WvVraX6czFivna6l2yWQJKy7H7Y7qyBook1Wqm1nW%20EAzFkvEUMbTThe%2F3pYO5cPndE7am9xnvdqZ3rd527d3ixa%201aN7LKyBFTusKmX8mp8fbrPc3EErFL8ma63jG97bkme67qmGpHi2X6nhei4FghprRKu17riBQ5Vjuqppu%20mafkEbYFsaf5SEWgHocB5YPk%20yoTruH6wUR35Lvmy4xHaQHRjRYE1rhqqHs2vpwXOJGdhxV6RjePGbrRiaoHgb4QXgTEiSxepKeeAF4NxA6gdh%20hum6GBqdmrHIKGCShqa3JUbJBmPgpo4pnhpkEcx%2Fq5uRZEAXZ0kYbxhk1q5KbymZJ5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cMI7AHhOH5IKEUwwGRgHgB4AA4mAB4%20hKBgHoMccgVBGAZCAA%3D&embed=true&#x22; width=&#x22;500&#x22;></iframe>"}

:::

In this snippet, we’re creating the rule for items with the `sequence` property of `“cone”` . When an item that matches that rule is packed on top of another instance of itself (`”targetRefId”:null` ), it’s height is reduced by 8.5. This means that if our cone is 10” tall, any additional cone placed on top of it only adds 1.5” to the initial cone height (because 10-8.5 = 1.5).

The rule can be expanded to have different compaction behaviors based on what other items are packed alongside it, or on top of it. Each property definition can have different axis changes and refId targets.

Here’s [another example of compact-pattern](https://inspector.manage.dev.paccurate.io/config-editor/?config=N4Igxg9gNlCmYBcCWEB2BJAJiAXCAnAMwBssmZA7ALQAsAHMfrYTQKxV1g0AMVsATAEZBYVqx4BDAEbYANCAAOEsAGUkAWwAySVLACuCrLkXKAzhqr58%2FKlImnYUHbEskylWgyY0W7Tjz4hETFJGRB5BwBHPVhUMFgVCAAnBFwEJJj5KQgADwAVAE8FWABhAAsIJHiAcQgJKGN1CFMEKiQEWHVTcJB2zoB5JKRYhAlkNBVYCSSwMoARWAUEMtx%20eT71dFR2pHrB4dRR8dQABSTYADNYJPPsHAv6h3kMuG6cAG1QCGKksZRUYxQCBgADWVGSByO%2Fx6GwAsmNZrhQLAcgpzqZzGhjJp%20iUANI9NHfa4IArGVASdSwEAAX3k32Ob1AF3OsAAgjlYG93twALo0ulfH5%2FLF4FkSADmSDgMI66nhCEROGRqPRmIBeAAQpLqoSksSUmS8BSqbT6Ut%2FkyQGg8t9%20qgoEb0jEBbIhdcRRqQPUOkkKR0qJgNLF1d11nKAEqXIw4QSEc2MpEgINU1Ch3CfEA5VYAOlY8iNNBzxHkAC9cBQafzBdbhcdjCiwFA9ORZZ0FUqVWiuerjHMI%20gSgBRVg9XQSsbUnDO2DyIk%2FUnkynUukgUZJCWwBCa3JRi5Ybmsflu2se%20t4RvN1vh9sIlbKkAo7sY6F4fuDoeCbhj2ATjppDJZ0UfUFyNEATRXeR103bdd2jTBuS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YQ%20RpDyG4DoHmYgNC6F3H0UwnAn9BBsLMRbUBY5eFzFscmexcCRGSJcUaNxLiPFeJwQgPBYVlFEO8QEjROB8DFjPro%202OBImGMvmIOJodzFWy%2FEk6xIBIFUE6XYmGDinFSKNGI5BGCCkkOKbGUp%2Fj1FTlQdQupMYvzKSiWfVhJ52EJK4f08CvD%20F9J9kIoZCCRlZPGTIyZPiSl%20PKfMs5ucdG0JFqs4C6zjGtOARY%20p1sfbgJACUXgeyTkZMzo85BOTBDuIQdcopijbkqMKQ82M2dWChOWXcN5jCmlz1iVs%20JnDfl7IBSko5gj0lpngbGSh2TVjQrybCpFUyEUzLuciwJsZy61JefU7FBipzNJMabNpOziVWMHr0siFLBlgscRCiRsZnGXJwMQPMcLpkEOZeHFFZ8qEMExSUtZhiNn4tMaKol78JXGEOdKgZ6c5XDLpTSmFqr1Xavhb4j1uraXaMNTM41CzPkEotT8q1XTB5Ar6dAylVonWQvpa66pGsymFM1bM%205nLN4hLCa8xpgq8VfPabs61b5gUxtlVSzJLrnW5JVcmjVrKtWprUVm6pp987hKNe8pp6thXbMtXcEAMkI3GF6SO%201sCq3gqVec2djK3Upv8em9lrbKn8EQUs3lMYZKBuYZs813yrYTv2d0w5J7QXTvlfOhNNaVVqqXeUld3rOUbq0c8rt0TCE4qDY5ItYrp4noBVGi9sbqVjMVXW9BMj3UtpuWyl9660UYu3XcXdPaC2EDNSKo9XCgPJN4KBytcaLmQYZfW2Dy6m0Zo5eu7lnaRboZ%2FasPt%2F7B3GEcqOiBhGK0OqvfGxVEHpGLsbV6uDFTBWUK3Z%20xye6aUHpw8W35nHHZnp4zKvjJGb2CdpfeyjT7qOrp1a%2031H7GP5rCsGw9SnAOlsBepydwiZ1CahUm%2FTabDOIcFcE9Fub6myYw6sQtIbcPKbs2SlTaTiPgd02Rtzj6PNibma%209tPKZMWeiax96yAqQQD0BHEgNIgA%3D) being used with multiple axes being changed:

```jsx
{
  "rules": [
    {
      "itemRefId": 1,
      "operation": "compact-pattern",
      "options": {
        "alternating": "true",
        "compactibleAxes": [
          1,
          2
        ],
        "compactProperties": [
          {
            "targetRefId": null,
            "compactibleAxisDimensionChange": [
              {
                "y": -0.515
              },
              {
                "z": -0.515
              }
            ]
          }
        ]
      }
    }
  ],
  "itemSets": [
    {
      "originalRefId": "1",
      "refId": 1,
      "name": "Cup 1 DRICE10",
      "weight": 0.4927,
      "sequence": "1",
      "dimensions": {
        "z": 3.707,
        "y": 3.707,
        "x": 4.682
      },
      "orderId": "123350675",
      "quantity": 9
    }
  ],
  "boxTypes": [
    {
      "originalRefId": "10",
      "name": "B0-10",
      "dimensions": {
        "z": 12.75,
        "y": 17.75,
        "x": 9
      },
      "weightMax": 150,
      "refId": 10
    }
  ]
}
```

:::Iframe{iframeHeight="700" code="<iframe src=&#x22;https://inspector.manage.paccurate.io/config-editor?config=N4Ig9gTgJgphCWUQC4QE4CsAGAHAJjRABoR4AXGAWwGUYyBnFAbVAhgDMBJJZLEgdxjwA5gAsyKPCQCOAVwCGAOzLkAnigwlF8yjBQgACvIgBreIuEACAMJhFekvRhyYigMZ7Ubuw5BR4uor08HaMyKAAHigAjHwg6sgAbCQAXiiJAL4k3gA2kPoAxNgAzDBoOCAZALokELI5MGEspBSUALLyZG6iKKAADhBgfXBkCSBOLu6%20MBEDjcF2%20t72lSRDcJ0hiktglH3ybmQAtPtkFBDba30qob0g8jnn2ioWKGR1MNm7%204fwAEYNACCEUazCwNRA3j2BzIBkGwwgKlByGaZGMwjoACUONwUIp6jkvtDfgCYMD4PQACIBVwLRTWURKDHMSIoI6JAB0GGqPOqJD%20YAiABVVMMmqBBCJxB0oshinFtLp9DgABqqiokfyBOlhVnIHAkBIGkBpfUZLISoRiMgylAAFgVOk8IAA7Cq3YliH4aUEtrqQLKXYaUEGTelzURLVKbfJZfKtE79NE8CrkyrPZqfTq7rLk8HkHmw0kI1HrbbkA6E0rUNFiqm67WvVraX6czFivna6l2yWQJKy7H7Y7qyBook1Wqm1nW%20EAzFkvE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qppWZ4LLi5Cund8YWWijXa6fCYaGwBlvaWBMzaiNXjfUutDjqyPzggleLDJHZwYgvBh599TsQAkLahQ9nJ7gPJY4GS94EVkvIkexg8Z5fxfOLVOyMeGgOnofZqw86GMX%2FgTDxZ4KLIIcX4kcksDFR0liYpRZiRpzwwTEiyIieG4KSZ%2FEcOc8lWJ3rYnBuiw4bwnJQqOu8iyUKVirNqPN8ndSJhnHxYCaFJ1SinLpm1%20ao3On0sJqDOYwIPHAoBiDQkH2meXNMFS3HWIUQWPuuCITmDcDkWQsBqBuAQNcMI7AHhOH5IKEUwwGRgHgB4AA4mAB4%20hKBgHoMccgVBGAZCAA%3D&embed=true&#x22; width=&#x22;500&#x22;></iframe>"}

:::

Viewing the example in our inspector, you can see that the innermost instance of the item is much smaller than the outermost — it reduces each dimension by .515” as they are placed alongside each other in the width and length dimensions.

The `compactibleAxisDimensionChange` values are not restricted to a single dimension. You could for example, increase an items height while reducing its length when placed next to itself (or other items!)

It is worth noting that the dimension changes and `targetRefId` mapping are quite strict; you must be specific when creating these rules. If an item can compact against `n` different items, you could wind up with a very long `compactProperties` list. We find in most cases, shippers create rules for specific item shapes primarily (using `targetRefId:null`) which covers the majority of use cases.

## Nesting

What if, instead of shipping traffic cones, you needed to ship several trash cans, and you want to be able to use the inside of those cans to pack additional items in the shipment? In this case, we want to keep our compact pattern logic, but add in another rule: `internal-space` .

The `internal-space` rule creates a subspace inside an item in which other items can be packed. The subspace is defined the same way as any other `boxType` — it can have a refId, weightMax, price, etc. The available `options` for the `internal-space` rule are:

- `type` - must be “subspace”
- `boxType` - the type definition of the subspace. Inherits the `boxType` schema and should contain, at minimum, a `name`, `weightMax`, and `dimensions`.
- `origin` - a `point` value where the subspace is positioned relative to the item’s origin point and dimensions.
- `blocking` - a boolean value that defines whether the bounding box of the internal space blocks the placement of other items in the parent box.
- `display` - a `boolean` value representing the option to display the bounding box of the internal space as a white semi-transparent object in the visualization of the containing Item.
- `displayChildren` - `boolean` option to display the children packed within the internals pace in the visualization of its containing parent Box.

```jsx
{"rules": [
    {
      "operation": "internal-space",
      "itemMatch": {
        "property": "sequence",
        "expression": "Basket"
      },
      "options": {
        "type": "subspace",
        "boxType": {
          "weightMax": 10,
          "name": "Bucket interior",
          "price": 0,
          "refId": 202,
          "dimensions": {
            "x": 8,
            "y": 6,
            "z": 6
          }
        },
        "origin": {
          "x": 0.25,
          "y": 1,
          "z": 1
        },
        "display": false,
        "displayChildren": true
      }
    },
    {
      "itemMatch": {
        "property": "sequence",
        "expression": "Basket"
      },
      "operation": "compact-pattern",
      "options": {
        "alternating": true,
        "compactibleAxes": [
          0
        ],
        "compactProperties": [
          {
            "targetRefId": null,
            "compactibleAxisDimensionChange": [
              {
                "x": -8.5
              }
            ]
          }
        ]
      }
    }
  ]
  }
```

The combined config above creates a wastebasket with an available internal space for packing. To the right, we see the output of the above rules, combined with 3 smaller items that were packed in addition to the wastebaskets.

💡 Important to note: only one subspace will be created when items are compacted. This means in reality the “topmost” compacted item is the one that contains the subspace.

While the API response will return `lenBoxes:1`   , the `boxes` array in the response will include an additional “box” for the interior space. This box has a `subspace` property with information about its position in its parent, along with the parent box and item indexes.

```jsx
"subspace": {
  "originInParent": {
    "x": 0.25,
    "y": 1,
    "z": 1
  },
  "parentBoxIndex": 0,
  "parentItemIndex": 1
}
```

Also of note, the outermost box will include the items in the subspace as part of its `lenItems`. If you need to assign an item in a subspace to an outer box, use the subspace property to make that assignment when looping through the output boxes.

:::Iframe{iframeHeight="700" code="<iframe src=&#x22;https://inspector.manage.paccurate.io/config-editor?config=N4Ig9gTgJgphCWUQC4QE4CsAGAHAJjRABoR4AXGAWwGUYyBnFAbVAhgDMBJJZLEgdxjwA5gAsyKPCQCOAVwCGAOzLkAnigwlF8yjBQgA6vPoUABACFjAazrEQ9GHJiKAxntSX6NiSSjxdivTwYIEooAAeKACMfCDqyABsJABeKAkAviQuYAA2kPoAxNgAzDBoOCCZrBzc0TIKymooxb7+zkEhjMgR0QB0mnGSKShYvXg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8EtzneaU26/vhpXAZF/R+aks6MYhnX+fYy1rQFw2AaR5mYpat6tdDkU8F6lLftqn2jb91X9OKwrTjd6WrLl7TBoJh6Hf90SC9J4vLsqpSy4U+3hbz53zaTxLKb867ddtrPK6F43HaiCTx6iQ4G5NPAois+fbcONvR5rkAWcKnUZ7DmWuZbnUV9z5H3Pc4o2Z7q3Egjgiz8PnATZd+uQ97m6bcW7PY5Ns3TfF7e/IGJSAx5aHzjlFcaKEz5/1flVW6t8P6MzzmgZCSDnZQOQGgdiGDbYV0VjnUBJ1O6oOfpfZ2VkvY4JjmRe+jtN60LQR7L6BED7wOrnnda7Vk4v3wnhW6FDCbt2RhNdWaDlJVVpt7Yevt8HPXEngMm59Oru2xlzWmcDJF4IfqdIhkttZ9zIb9PhVcBF6RPshCiaCAppAIhREBxN2FoP7rww+CQVaCPAW1ER/dSHYNsUDfyElT4KI+hZSxopI7NGjvw1eec8AoVicHHRKdJD91iSpO+xM07IUyWneh6cub9UkMcXxa8YhiyLsQzmTdZbWMMSPI+elSmlMOK7CpJcqot2acUmJCc4q5LSmklhxjJTxP8dFehXjwmiiKYM6JyNA4/2nq0y64cqpANYl0wR6sEmcJIco0RUcNkNO/mbcpiSuGmysms8itSpEZLitsi+7s8mTMiUY2Zel1oxAcbtX6WBDmShinFLAaC8kFMSH8mZ9ThmFRPvQ3eLznGuIaT0jaSyKp5Oir9aZ6jP5AzPkHIJUtLpn2vhlf5+hTGnJ2ZzUJkzTjkrWh5Kljz5KOJqQykA61mnfJ4QRTpkLqElK2VvNFOtRHzSYRCnFCC5m0KycC0Vqdd682tMw6VrC5kxUyYS3RhSeZgteXU6RJNJLMsURZPZtN6WgVIK4HIshYDUBcAgHsXQAxBhgGBbkvIYARjAGqGAABxMAgZ9CUDACYf4qZGDpCAA===&embed=true&#x22; width=&#x22;500&#x22;></iframe>"}

:::

If an item is not compacted, the inner space will be assigned for each instance of the packed item, and will also be included in any API response, even if the subspaces are empty. Since the subspaces are their own `boxType`  you can create rules to exclude items from them, or make them more or less expensive to incentivize items being packed in them.

## Conclusion

Stacking and nesting are powerful techniques in optimizing packing efficiency. By utilizing Paccurate's `compact-pattern` and `internal-space` rules, shippers can significantly reduce wasted space and improve their packing strategies.

The `compact-pattern` rule allows for efficient stacking of items like traffic cones or cups, reducing the overall dimensions when multiple items are packed together. This is particularly useful for items that can compress or fit snugly against each other.

The `internal-space` rule enables the creation of subspaces within larger items, such as packing smaller items inside a trash can. This maximizes the use of available space and can lead to more efficient and cost-effective shipping.

By combining these rules and understanding their applications, shippers can create sophisticated packing algorithms that account for the unique characteristics of their inventory. This results in optimized space utilization, potentially reduced shipping costs, and improved overall logistics efficiency.
