Skip to content

Method Material

The method material resource.

Base/methodMaterial
GET/methodMaterial

List method materials

Retrieve a paginated list of method materials. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/methodMaterial
curl --request GET \
  --url '<your-host>/methodMaterial?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "makeMethodId": "xyz789",
    "methodType": "string",
    "itemType": "string",
    "itemId": "xyz789",
    "quantity": 10,
    "unitOfMeasureCode": "string",
    "companyId": "xyz789"
  }
]
GET/methodMaterial

Retrieve a method material

Fetch a single method material by filtering on `id`.

Query parameters

idstring

Match on the method material's `id`, e.g. `eq.{id}`.

GET/methodMaterial
curl --request GET \
  --url '<your-host>/methodMaterial?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "makeMethodId": "xyz789",
  "methodType": "string",
  "itemType": "string",
  "itemId": "xyz789",
  "quantity": 10,
  "unitOfMeasureCode": "string",
  "companyId": "xyz789"
}
POST/methodMaterial

Create a method material

Create a new method material.

Body parameters

makeMethodIdstringrequired
methodTypemethodTyperequired
materialMakeMethodIdstring
itemTypestringrequired
itemIdstringrequired
quantitynumberrequired
unitOfMeasureCodestringrequired
companyIdstringrequired

References company.id

customFieldsobject
ordernumberrequired
methodOperationIdstring

References methodOperation.id

scrapQuantitynumberrequired
tagsarray
productionQuantitynumber
kitbooleanrequired
storageUnitIdsobjectrequired
sourcingTypesourcingTyperequired
POST/methodMaterial
curl --request POST \
  --url <your-host>/methodMaterial \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"makeMethodId":"xyz789","methodType":"string","itemType":"string","itemId":"xyz789","quantity":10,"unitOfMeasureCode":"string","companyId":"xyz789","order":0,"scrapQuantity":10,"kit":true,"storageUnitIds":"string","sourcingType":"string"}'
Response
{
  "id": "abc123def456",
  "makeMethodId": "xyz789",
  "methodType": "string",
  "itemType": "string",
  "itemId": "xyz789",
  "quantity": 10,
  "unitOfMeasureCode": "string",
  "companyId": "xyz789"
}
PATCH/methodMaterial

Update a method material

Update an existing method material, matched on `id`.

Body parameters

makeMethodIdstringrequired
methodTypemethodTyperequired
materialMakeMethodIdstring
itemTypestringrequired
itemIdstringrequired
quantitynumberrequired
unitOfMeasureCodestringrequired
companyIdstringrequired

References company.id

customFieldsobject
ordernumberrequired
methodOperationIdstring

References methodOperation.id

scrapQuantitynumberrequired
tagsarray
productionQuantitynumber
kitbooleanrequired
storageUnitIdsobjectrequired
sourcingTypesourcingTyperequired
PATCH/methodMaterial
curl --request PATCH \
  --url '<your-host>/methodMaterial?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"makeMethodId":"xyz789"}'
Response
{
  "id": "abc123def456",
  "makeMethodId": "xyz789",
  "methodType": "string",
  "itemType": "string",
  "itemId": "xyz789",
  "quantity": 10,
  "unitOfMeasureCode": "string",
  "companyId": "xyz789"
}
DELETE/methodMaterial

Delete a method material

Delete a method material, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the method material to delete, e.g. `eq.{id}`.

DELETE/methodMaterial
curl --request DELETE \
  --url '<your-host>/methodMaterial?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content