> For the complete documentation index, see [llms.txt](https://knowledge.out-smart.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.out-smart.com/openapi/sub-materials.md).

# Sub Materials

## Get sub-materials

> This api is used to retrieve all sub materials from WorkorderApp.  \
> Each material record can contain the following data:\
> \
> \| Parameter | Required | Type (size) |\
> \| --- | --- | --- |\
> \| id | Y | Int (11) |\
> \| parent\_material\_code | Y | Varchar (255) |\
> \| sub\_material\_code | Y | Varchar(255) |\
> \| sub\_fixed\_amount | Yes, when sub\_type equals 'sub\_fixed\_amount' | Decimal |\
> \| sub\_calculation\_amount | Yes, when sub\_type equals 'sub\_calculation\_amount' | Decimal |\
> \| sub\_type | Y | Varchar (50)  \<br>Can be:  \<br>\\- sub\_fixed\_amount  \<br>\\- sub\_calculation\_amount |\
> \| visible | Y | Boolean |\
> \| billable | Y | Boolean |\
> \| created\_at | N (read only) | Timestamp |\
> \| updated\_at | N (read only) | Timestamp |

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/sub-materials/":{"get":{"summary":"Get sub-materials","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Sub Materials"],"description":"This api is used to retrieve all sub materials from WorkorderApp.  \nEach material record can contain the following data:\n\n| Parameter | Required | Type (size) |\n| --- | --- | --- |\n| id | Y | Int (11) |\n| parent_material_code | Y | Varchar (255) |\n| sub_material_code | Y | Varchar(255) |\n| sub_fixed_amount | Yes, when sub_type equals 'sub_fixed_amount' | Decimal |\n| sub_calculation_amount | Yes, when sub_type equals 'sub_calculation_amount' | Decimal |\n| sub_type | Y | Varchar (50)  <br>Can be:  <br>\\- sub_fixed_amount  <br>\\- sub_calculation_amount |\n| visible | Y | Boolean |\n| billable | Y | Boolean |\n| created_at | N (read only) | Timestamp |\n| updated_at | N (read only) | Timestamp |"}}}}
```

## Add sub-materials

> This api is used to sync materials with WorkorderApp.  \
> Each material record can contain the following data:\
> \
> \| Parameter | Required | Type (size) |\
> \| --- | --- | --- |\
> \| parent\_material\_code | Y | Varchar (255) |\
> \| sub\_material\_code | Y | Varchar(255) |\
> \| sub\_fixed\_amount | Yes, when sub\_type equals 'sub\_fixed\_amount' | Decimal |\
> \| sub\_calculation\_amount | Yes, when sub\_type equals 'sub\_calculation\_amount' | Decimal |\
> \| sub\_type | Y | Varchar (50)  \<br>Can be:  \<br>\\- sub\_fixed\_amount  \<br>\\- sub\_calculation\_amount |\
> \| visible | Y | Boolean |\
> \| billable | Y | Boolean |

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/sub-materials/":{"post":{"summary":"Add sub-materials","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Sub Materials"],"description":"This api is used to sync materials with WorkorderApp.  \nEach material record can contain the following data:\n\n| Parameter | Required | Type (size) |\n| --- | --- | --- |\n| parent_material_code | Y | Varchar (255) |\n| sub_material_code | Y | Varchar(255) |\n| sub_fixed_amount | Yes, when sub_type equals 'sub_fixed_amount' | Decimal |\n| sub_calculation_amount | Yes, when sub_type equals 'sub_calculation_amount' | Decimal |\n| sub_type | Y | Varchar (50)  <br>Can be:  <br>\\- sub_fixed_amount  <br>\\- sub_calculation_amount |\n| visible | Y | Boolean |\n| billable | Y | Boolean |"}}}}
```

## Delete sub-materials

> This api is used to sync materials with WorkorderApp.  \
> Each material record can contain the following data:\
> \
> \| Parameter | Required | Type (size) |\
> \| --- | --- | --- |\
> \| id | Y | int (11) |

```json
{"openapi":"3.1.0","info":{"title":"OpenApi","version":"1.0.0"},"servers":[{"url":"{{api_url}}"},{"url":"https://www.werkbonapp.nl"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/sub-materials/":{"delete":{"summary":"Delete sub-materials","parameters":[{"name":"token","in":"query","schema":{"type":"string"}},{"name":"software_token","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Response_200"}},"tags":["Sub Materials"],"description":"This api is used to sync materials with WorkorderApp.  \nEach material record can contain the following data:\n\n| Parameter | Required | Type (size) |\n| --- | --- | --- |\n| id | Y | int (11) |"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://knowledge.out-smart.com/openapi/sub-materials.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
