Materials¶
Endpoints related to materials.
- GET /material-batch-action/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location
- POST /material-batch-action/¶
In order to transferring quantity (it is in “units” when sending to the backend) to core_unit, we need to
In order to transferring quantity (it is in “units” when sending to the backend) to core_unit, we need to get the “units” of the material. The logic to get it through db call is that:
1. If there’s source batch, get the source batch, and use the “units” in the source batch – this logic is implemented in _dehydrate function 2. If there’s no source batch, it must be create_initial_batch. We get the container from the metadata and then use the container to get units.
If we want to improve this in the future, I hope we can get the units field from the Frontend, which is the easiest method.
- Status Codes:
201 Created – Resource created successfully
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location
- Response Headers:
Location – URI of the created resource
- GET /material-batch-action/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location
- PUT /material-batch-action/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location
- DELETE /material-batch-action/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location
- GET /material-test/instruction/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material-test-instruction cannot be found.
- POST /material-test/instruction/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material-test-instruction cannot be found.
- Response Headers:
Location – URI of the created resource
- GET /material-test/instruction/{uuid}/¶
Get a single instruction by UUID.
Get a single instruction by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material-test-instruction cannot be found.
- PUT /material-test/instruction/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material-test-instruction cannot be found.
- DELETE /material-test/instruction/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – The requested material-test-instruction cannot be found.
- GET /material-test/work-checklist/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material work checklist cannot be found.
- GET /material-genealogy/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
403 Forbidden – You are not authorized to complete the request.
405 Method Not Allowed – MethodNotAllowed: Only GET method allowed for this endpoint.
- POST /material-genealogy/¶
- Status Codes:
201 Created – Resource created successfully
403 Forbidden – You are not authorized to complete the request.
405 Method Not Allowed – MethodNotAllowed: Only GET method allowed for this endpoint.
- Response Headers:
Location – URI of the created resource
- GET /material-genealogy/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
403 Forbidden – You are not authorized to complete the request.
405 Method Not Allowed – MethodNotAllowed: Only GET method allowed for this endpoint.
- PUT /material-genealogy/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
403 Forbidden – You are not authorized to complete the request.
405 Method Not Allowed – MethodNotAllowed: Only GET method allowed for this endpoint.
- DELETE /material-genealogy/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
403 Forbidden – You are not authorized to complete the request.
405 Method Not Allowed – MethodNotAllowed: Only GET method allowed for this endpoint.
- GET /material-test/unit/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material-test-unit cannot be found.
- POST /material-test/unit/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material-test-unit cannot be found.
- Response Headers:
Location – URI of the created resource
- GET /material-test/unit/{uuid}/¶
Get a single unit by UUID.
Get a single unit by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material-test-unit cannot be found.
- PUT /material-test/unit/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material-test-unit cannot be found.
- GET /material-test/operation-linking/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material-test-operation-linking cannot be found.
- GET /material-test/operation-linking/{uuid}/¶
Get a single material-test-operation by UUID.
Get a single material-test-operation by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material-test-operation-linking cannot be found.
- GET /material-container-action/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location ConvertNonDisposableContainer
- POST /material-container-action/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location ConvertNonDisposableContainer
- Response Headers:
Location – URI of the created resource
- GET /material-container-action/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location ConvertNonDisposableContainer
- DELETE /material-container-action/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – RecordNotFound
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The sub_location provided in the relocation action doesn’t belong to the provided location ConvertNonDisposableContainer
- GET /material-test/instruction-report/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material test report cannot be found.
- POST /material-test/instruction-report/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material test report cannot be found.
- Response Headers:
Location – URI of the created resource
- GET /material-test/instruction-report/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material test report cannot be found.
- PUT /material-test/instruction-report/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material test report cannot be found.
- GET /material-test/panel/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material test panel cannot be found.
- POST /material-test/panel/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material test panel cannot be found.
- Response Headers:
Location – URI of the created resource
- GET /material-test/panel/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material test panel cannot be found.
- PUT /material-test/panel/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material test panel cannot be found.
- DELETE /material-test/panel/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – The requested material test panel cannot be found.
- GET /material-batch/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material batch cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of material batch not allowed via API.
400 Bad Request – NotImplementedError
- POST /material-batch/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material batch cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of material batch not allowed via API.
400 Bad Request – NotImplementedError
- Response Headers:
Location – URI of the created resource
- GET /material-batch/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material batch cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of material batch not allowed via API.
400 Bad Request – NotImplementedError
- PUT /material-batch/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material batch cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of material batch not allowed via API.
400 Bad Request – NotImplementedError
- DELETE /material-batch/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – The requested material batch cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of material batch not allowed via API.
400 Bad Request – NotImplementedError
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
403 Forbidden – You are not authorized to complete the request.
404 Not Found – One of the provided objects doesn’t exists.
- POST /material/<uuid:material_uuid>/clone/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material type cannot be found.
403 Forbidden – You are not authorized to complete the request.
- Response Headers:
Location – URI of the created resource
- GET /material-container/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material_container cannot be found.
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The contents of the material container doesn’t match the requested material restrictions. The container isn’t empty. Please empty before trying to archive this container. This endpoint only supports updates for permanent containers. Can’t limit the size of the container below its current contents.
- POST /material-container/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material_container cannot be found.
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The contents of the material container doesn’t match the requested material restrictions. The container isn’t empty. Please empty before trying to archive this container. This endpoint only supports updates for permanent containers. Can’t limit the size of the container below its current contents.
- Response Headers:
Location – URI of the created resource
- GET /material-container/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material_container cannot be found.
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The contents of the material container doesn’t match the requested material restrictions. The container isn’t empty. Please empty before trying to archive this container. This endpoint only supports updates for permanent containers. Can’t limit the size of the container below its current contents.
- PUT /material-container/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material_container cannot be found.
403 Forbidden – You are not authorized to complete the request.
400 Bad Request – The contents of the material container doesn’t match the requested material restrictions. The container isn’t empty. Please empty before trying to archive this container. This endpoint only supports updates for permanent containers. Can’t limit the size of the container below its current contents.
- GET /material-test/operation/¶
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material-test-operation cannot be found.
- POST /material-test/operation/¶
- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material-test-operation cannot be found.
- Response Headers:
Location – URI of the created resource
- GET /material-test/operation/{uuid}/¶
Get a single material-test-operation by UUID.
Get a single material-test-operation by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material-test-operation cannot be found.
- PUT /material-test/operation/{uuid}/¶
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material-test-operation cannot be found.
- GET /material/¶
List all of the materials in the system for your account.
List all of the materials in the system for your account.
- Query Parameters:
limit (integer) – Maximum number of resources to return
offset (integer) – Number of resources to skip
sort (string) – Sort order (prefix with ‘-’ for descending)
- Status Codes:
200 OK – Successful response with list of resources
404 Not Found – The requested material cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of template material not allowed via API.
400 Bad Request – You cannot delete this material because there are stocks or orders associated with it. Delete all orders and stocks using this material first. There is a mismatch in the bureau and the bureau of manufacturer in the payload. Kindly make sure the manufacturer belongs to the same bureau. The requested material name already exists.
- POST /material/¶
Create a new material.
Create a new material.
After a new material is created a X-Upload-Location header will be returned. Using this allows us to upload a thumbnail for the material that was created. Use the X-Upload-Location header to PUT file contents to that location.
Example:
` curl -X PUT -H 'Content-Type: image/png' --data-binary '@PATH-TO-YOUR-PNG' "<HEADER X-UPLOAD-LOCATION>" `- Status Codes:
201 Created – Resource created successfully
404 Not Found – The requested material cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of template material not allowed via API.
400 Bad Request – You cannot delete this material because there are stocks or orders associated with it. Delete all orders and stocks using this material first. There is a mismatch in the bureau and the bureau of manufacturer in the payload. Kindly make sure the manufacturer belongs to the same bureau. The requested material name already exists.
- Response Headers:
Location – URI of the created resource
- GET /material/{uuid}/¶
Get a single material by UUID.
Get a single material by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
200 OK – Successful response
404 Not Found – The requested material cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of template material not allowed via API.
400 Bad Request – You cannot delete this material because there are stocks or orders associated with it. Delete all orders and stocks using this material first. There is a mismatch in the bureau and the bureau of manufacturer in the payload. Kindly make sure the manufacturer belongs to the same bureau. The requested material name already exists.
- PUT /material/{uuid}/¶
Update a material by UUID.
Update a material by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource updated successfully
404 Not Found – The requested material cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of template material not allowed via API.
400 Bad Request – You cannot delete this material because there are stocks or orders associated with it. Delete all orders and stocks using this material first. There is a mismatch in the bureau and the bureau of manufacturer in the payload. Kindly make sure the manufacturer belongs to the same bureau. The requested material name already exists.
- DELETE /material/{uuid}/¶
Delete a material by UUID.
Delete a material by UUID.
- Parameters:
uuid (string) – The UUID of the resource
- Status Codes:
204 No Content – Resource deleted successfully
404 Not Found – The requested material cannot be found.
403 Forbidden – You are not authorized to complete the request. Modification of template material not allowed via API.
400 Bad Request – You cannot delete this material because there are stocks or orders associated with it. Delete all orders and stocks using this material first. There is a mismatch in the bureau and the bureau of manufacturer in the payload. Kindly make sure the manufacturer belongs to the same bureau. The requested material name already exists.