Materials

Change a material

PATCH/materials/{material}

Changes the fields that the body carries, keeps the others, and returns the material. The path names the material by its id, or by its code with by=code. A code in the body is the material's new code. The kind is set when the material is created and cannot change. In processing_capabilities, a slot that the body leaves out keeps its capability, and null clears it. The body names each entity it refers to as {"id": …} or {"code": …}. A reference that names no entity of the shop answers 400 invalid-request pointing at it.

Request Headers

Bearer <token>

Path Parameters

material*string

The material's id, or its code when by=code.

Query Parameters

by?string

Which key the path holds: id, the default, or code.

Default"id"

Value in

  • "id"
  • "code"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The fields to change. A field that the patch leaves out keeps its value. The kind is set when the material is created and cannot change.

Response Headers

200, 400, 401, 403, 404, 413, 429, default

200, 400, 401, 403, 404, 413, 429, default

200, 400, 403, 404, 429, default

200, 400, 403, 404, 429, default

429

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X PATCH "https://example.com/materials/string" \  -H "Authorization: Bearer ff_shop_…" \  -H "Content-Type: application/json" \  -d '{}'
{  "result": {    "code": "string",    "color": "string",    "thickness_mm": 0,    "price_ncu_m2": 0,    "tile_size_mm": 0,    "drawing_padding_mm": 0,    "id": "string",    "kind": {      "id": "string"    },    "status": "active",    "appearance": {      "id": "string"    },    "processing_capabilities": {      "cutting": {        "id": "string"      },      "engraving_light": {        "id": "string"      },      "engraving_medium": {        "id": "string"      },      "engraving_heavy": {        "id": "string"      }    }  }}