Skip to main content

Material API

Welcome to the Material API documentation. This API provides a comprehensive set of functions for managing and interacting with materials within the system. Below is a list of available functions, each with a brief description and a link to its detailed documentation.

Function List

newMaterialClass

Generates an empty non-persisted Material Classes object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMaterialClass method in order to persist the record. Returns a JSON representation of the newly created material class object.

saveMaterialClass

Creates or updates a Material Classes record in the system based on the provided parameters. Returns a JSON representation of the saved material class.

createMaterialClassesForPath

Creates Material Classes objects for each name in the specified path if they do not already exist, setting their respective parents. No response is returned.

doesMaterialClassExist

Checks if a Material Classes object with the given ID or path exists. Returns a boolean indicating whether the material class exists.

findMaterialClasses

Retrieves Material Classes records based on the specified pagination, sort, and column constraint parameters. Returns a Query Result object.

getMaterialClass

Retrieves a Material Classes record by its ID or path. Returns a JSON representation of the material class. Returns nothing if no material class is found.

getAllMaterialClasses

Retrieves a list of all Material Classes records in the system. Returns a list of JSON objects representing all material classes.

getMaterialClassReferences

Retrieves a list of references to a Material Classes record by its ID or path. Returns a list of JSON objects.

validateMaterialClass

Validates the specified parameters for a Material Classes record and returns any validation errors. This only checks if the material class object can be saved based on the attributes given. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteMaterialClass

Deletes a Material Classes record by its ID or path. This cannot delete a material class with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

deleteMaterialClasses

Deletes all Material Classes records by the given IDs or paths. This cannot delete any material classes with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

newMaterial

Generates an empty non-persisted Materials object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMaterial method in order to persist the record. Returns a JSON representation of the newly created material object.

saveMaterial

Creates or updates a Materials record in the system based on the provided parameters. Returns a JSON representation of the saved material.

doesMaterialExist

Checks if a Materials object with the given ID or path exists. Returns a boolean indicating whether the material exists.

findMaterials

Retrieves Materials records based on the specified pagination, sort, and column constraint parameters. Returns a Query Result object.

getMaterial

Retrieves a Materials record by its ID or path. Returns a JSON representation of the material. Returns nothing if no material is found.

getMaterialByErpId

Retrieves a Materials record given an erp ID. Returns a JSON representation of the material. Returns nothing if no material is found.

getAllMaterials

Retrieves a list of all Materials records in the system. Returns a list of JSON objects representing all materials.

getMaterialReferences

Retrieves a list of references to a Materials record by its ID or path. Returns a list of JSON objects.

validateMaterial

Validates the specified parameters for a Materials record and returns any validation errors. This only checks if the material object can be saved based on the attributes given. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteMaterial

Deletes a Materials record by its ID or path. This cannot delete a material with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

deleteMaterials

Deletes all Materials records by the given IDs or paths. This cannot delete any materials with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

newProperty

Generates an empty non-persisted Material Properties object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveProperty method in order to persist the record. Returns a JSON representation of the newly created material property object.

saveProperty

Creates or updates a Material Properties record in the system based on the provided parameters. Returns a JSON representation of the saved material property.

getPropertyOrCreateNew

Retrieves a Material Properties record if an existing material property exists with the specified ID or name. Otherwise, creates a new Material Properties record with the specified name and attributes. Returns a JSON representation of the material property.

getProperty

Retrieves a Material Properties record by its specified ID. Returns a JSON representation of the material property.

getPropertiesForMaterialClass

Retrieves all Material Properties records for a given material class. Returns a list of JSON objects representing all material properties for a given material class.

getMaterialPropertyReferences

Retrieves a list of references to a Material Properties by its ID. Returns a list of JSON objects.

validateProperty

Validates the specified parameters for a Material Properties record and returns any validation errors. This only checks if the material property object can be saved based on the attributes given. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteProperty

Deletes a Material Properties record by its ID. This cannot delete a material property with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

newPropertyValue

Generates an empty non-persisted Material Property Values object to provide the structure required by the API to save a new record into the database. This method must be combined with the savePropertyValue method in order to persist the record. Returns a JSON representation of the newly created material property value object.

savePropertyValue

Creates or updates a Material Property Values record in the system based on the provided parameters. Returns a JSON representation of the saved material property value.

setPropertyValue

Updates the value of a Material Property Values record given a material ID or path and a property ID or name. Returns a JSON representation of the updated material property value.

getPropertyValue

Retrieves a Material Property Values record given its ID. Returns a JSON representation of the material property value. Returns nothing if no material property value is found.

getPropertyValuesForMaterial

Retrieves all Material Property Values records by its material ID or path. Returns a JSON representation of the material property value. Returns nothing if no material property value is found.

getValueForMaterialAndProperty

Retrieves a Material Property Values record by its material ID or path and by its property ID or name. Returns a JSON representation of the material property value. Returns nothing if no material property value is found.

getPropertiesAndValuesForMaterial

Retrieves all Material Properties and Material Property Values records by its material ID or path. Returns a list of JSON objects representing all material properties and property values for a given material.

getMaterialPropertyValueReferences

Retrieves a list of references to a Material Property Values by its ID. Returns a list of JSON objects.

validatePropertyValue

Validates the specified parameters for a Material Property Values record and returns any validation errors. This only checks if the material property value object can be saved based on the attributes given. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deletePropertyValue

Deletes a Material Property Values record by its ID. This cannot delete a material property value with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

deletePropertyValueFor

Deletes a Material Property Values record given the material path and property name. This cannot delete a material property value with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

deletePropertyValues

Deletes all Material Property Values records by the given IDs. This cannot delete any material property value with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

deletePropertyValuesFor

Deletes all Material Property Values records given the material path and property names. This cannot delete any material property value with references to it. If successful, an ApiResponse Object is returned with the success bool set True.

newMaterialReasonCode

Generates an empty non-persisted Material Reason Codes object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveMaterialReasonCode method in order to persist the record. Returns a JSON representation of the newly created material reason code object.

saveMaterialReasonCode

Creates or updates a Material Reason Codes record in the system based on the provided parameters. Returns a JSON representation of the saved material reason code.

getMaterialReasonCode

Retrieves a Material Reason Codes record by its ID or reason code. Returns a JSON representation of the material reason code. Returns nothing if no material reason code is found.

getAllMaterialReasonCodes

Retrieves a list of all Material Reason Codes records in the system. Returns a list of JSON objects representing all material reason codes.

validateMaterialReasonCode

Validates the specified parameters for a Material Reason Codes record and returns any validation errors. This only checks if the material reason code object can be saved based on the attributes given. Returns a JSON object where keys are field names and values are lists of validation violation messages.

deleteMaterialReasonCode

Deletes a Material Reason Codes record by its ID. This cannot delete a material reason code with references to it. If successful, an ApiResponse Object is returned with the success bool set True.


Explore each function’s documentation for detailed usage examples and additional information.