Material kinds

Create a material kind

POST/material-kinds

Creates a material kind and returns it with its id. The code must be unique in the shop: a code that another kind has answers 409 already-exists. The body names the category and each compatibility group as {"id": …} or {"code": …}. A reference that names no entity of the shop answers 400 invalid-request pointing at it.

Request Headers

Bearer <token>

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A material kind to create. A kind created without category has no category.

Response Headers

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

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

201, 400, 403, 404, 429, default

201, 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 POST "https://example.com/material-kinds" \  -H "Authorization: Bearer ff_shop_…" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "code": "string",    "compatibility_mode": "universal"  }'
{  "result": {    "title": "string",    "code": "string",    "compatibility_mode": "universal",    "id": "string",    "category": {      "id": "string"    },    "compatibility_groups": [      {        "id": "string"      }    ]  }}