Fetch All Product Materials

Request

GET https://backend.net0.com/v1/products/{productId}/materials

This endpoint allows you to retrieve a list of all the materials associated with a product.

curl --location --request GET 'https://backend.net0.com/v1/products/2/materials' \
--header 'x-api-key: <API_KEY>'

Response

The response contains an array of all the materials associated with a product

[
	{
    "id": 1,
    "name": "TEST Material",
    "materialType": "Material",
    "createdAt": "2021-11-25T21:14:50.336Z",
    "updatedAt": "2021-11-25T21:14:50.336Z",
    "totalEmission": 0,
    "companyId": 2,
    "materialsProduct": [
        {
            "productId": 2,
            "materialId": 1,
            "totalEmission": null,
            "createdAt": "2021-11-25T21:14:50.346Z",
            "updatedAt": "2021-11-25T21:14:50.346Z"
        }
    ]
	},
  {
    "id": 2,
    "name": "OPMAN Material",
    "materialType": "Material",
    "createdAt": "2021-11-25T21:17:35.336Z",
    "updatedAt": "2021-11-25T21:17:35.336Z",
    "totalEmission": 0,
    "companyId": 2,
    "materialsProduct": [
        {
            "productId": 2,
            "materialId": 1,
            "totalEmission": null,
            "createdAt": "2021-11-25T21:17:35.336Z",
            "updatedAt": "2021-11-25T21:17:35.336Z"
        }
    ]
}
]