Item

Create a new item cut from an activated material shape. The shape determines the item's material thickness, material form and length unit, so those are not sent on the request — select the shape that carries the combination you want. The item is always created as a Buy item measured in Pieces, its number is generated from the shape and the dimensions supplied (e.g. `Steel A36 Sheet 1/4": 48"x120"`), and its weight is calculated from the shape's density. The shape must already be activated for the shop. An id that exists only in the materials database is rejected with a 404 — activate it first with the Material Activate endpoint. This endpoint never activates a shape, because activating one also un-archives every existing non-remnant item that uses it. A material item's number is derived rather than caller-supplied, so the same shape and dimensions always resolve to the same item. If that item already exists it is returned as-is instead of a duplicate being created, and if it was archived it is un-archived — meaning a successful response may carry the id of an item that predates the request. Check whether an item with the expected number already exists if the distinction matters to your integration. The number does not encode remnant state, so `isRemnant` is honoured only when a new item is created and is ignored on that collision.

post/api/items/material

Request body

materialShapeIdstring required

The id of the material shape to cut the item from. Must be a shape that is already activated for this shop, as returned by the Material List endpoint with active true; an id that is only present in the materials database is rejected with a 404. Activate it first with the Material Activate endpoint.

lengthnumber double required

The length of the piece, expressed in the material shape's length unit (inch, foot, millimeter, ...). Required for every shape, and must be greater than zero.

widthnumber double nullable

The width of the piece, expressed in the material shape's length unit. Required when the material shape is planar (sheet, plate, tread plate), because those shapes are sized by length and width, and the width determines both the generated item number and the item's calculated weight; omitting it is rejected with a 400 rather than defaulted. Must be omitted when the material shape is linear (bar, tube, pipe, beam, angle, channel), because those shapes are sized by length alone and their width is fixed by the shape; supplying it is rejected with a 400 rather than ignored, so a caller is never left believing a width was stored.

isRemnantboolean nullable

Set true to create the item as a remnant — an offcut left over from a larger piece. Defaults to false. A remnant is excluded from the shop's default buy-item accounting code, so it is created with no accounting code unless one is assigned afterwards.

Applies only when a new item is created. The generated number encodes the shape and the dimensions but not remnant state, so a request whose number already resolves to an existing item returns that item unchanged, keeping whatever remnant state it already had.

Response

Material item created, or an existing material item with the same generated number returned

idstring required

The id of the created record

Changes