Skip to main content
← API reference

Material and your own ids

Which stock a part may come from, and how your own identifiers come back.

material

When any part or stock carries material, the response adds materials (a per-material rollup — material, sheetCount/rodCount, yieldPct, placed, total, totalPrice) and unmatchedMaterials (demand whose material has no matching stock). On wood the material rides per cross-section section instead. Both keys are absent for a material-free job, which stays byte-identical.

POST /v1/optimize/2d

{
  "parts": [
    { "name": "Door", "w": 600, "h": 400, "qty": 4, "material": "MDF 18" },
    { "name": "Shelf", "w": 800, "h": 300, "qty": 6, "material": "Oak 18" },
    { "name": "Back panel", "w": 1000, "h": 500, "qty": 2, "material": "Ply 6" }
  ],
  "stock": [
    { "w": 2440, "h": 1220, "qty": 10, "price": 42, "material": "MDF 18" },
    { "w": 2440, "h": 1220, "qty": 10, "price": 68, "material": "Oak 18", "priority": true }
  ],
  "options": { "kerf": 3 },
  "engine": "heuristic"
}
Uses a public demo key — rate-limited, small jobs only, never billed.
{
  "materials": [
    {
      "material": "MDF 18",
      "sheetCount": 1,
      "yieldPct": 32.25,
      "placed": 4,
      "total": 4,
      "totalPrice": 42
    },
    {
      "material": "Oak 18",
      "sheetCount": 1,
      "yieldPct": 48.37,
      "placed": 6,
      "total": 6,
      "totalPrice": 68
    }
  ],
  "unmatchedMaterials": [
    {
      "material": "Ply 6",
      "parts": [{ "name": "Back panel", "w": 1000, "h": 500, "qty": 2 }]
    }
  ]
}

materials[] — per-material rollup (2d)

One material's totals across the sheets cut from it.

FieldTypeDescription
materialstringThe tag exactly as you sent it. Free text, matched exactly.
sheetCountintegerSheets cut from this material.
yieldPctnumberUsed area ÷ total area of THIS material's sheets, %.
placedintegerParts of this material placed.
totalintegerParts of this material requested (Σ qty).
totalPricenumberSum of the prices of the sheets used for this material.

materials[] — per-material rollup (1d)

One material's totals across the rods cut from it.

FieldTypeDescription
materialstringThe tag exactly as you sent it. Free text, matched exactly.
rodCountintegerBars cut from this material.
yieldPctnumberPlaced length ÷ total bar length of THIS material's rods, %.
placedintegerParts of this material placed.
totalintegerParts of this material requested (Σ qty).
totalPricenumberSum of the prices of the bars used for this material.

materials[] — per-material rollup (nest)

One material's totals across the sheets cut from it.

FieldTypeDescription
materialstringThe tag exactly as you sent it. Free text, matched exactly.
sheetCountintegerSheets cut from this material.
densitynumberThis material's own fill: placed polygon area / area of its sheets — a polygon fill, not comparable to the rectangular modes' yieldPct.
placedintegerPart copies of this material placed.
totalintegerPart copies of this material requested (Σ qty).
totalPricenumberSum of the prices of the sheets used for this material.

unmatchedMaterials[] — demand with no matching stock (2d)

Demand of a material for which the job supplied ZERO stock of that material.

FieldTypeDescription
materialstringThe tag that has no stock of its own anywhere in the request.
partsUnplaced2D[]The demand rows in that material, in the 2D unplaced shape: name, w, h, qty.

unmatchedMaterials[] — demand with no matching stock (1d)

FieldTypeDescription
materialstringThe tag that has no stock of its own anywhere in the request.
partsUnplaced1D[]The demand rows in that material, in the 1D unplaced shape: name, length, qty.

unmatchedMaterials[] — demand with no matching stock (nest)

FieldTypeDescription
materialstringThe tag that has no stock of its own anywhere in the request.
partsUnplacedNest[]The demand rows in that material, in the nest unplaced shape: name, qty.