> ## Documentation Index
> Fetch the complete documentation index at: https://developer.worldly.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MSI Create Materials

## Introduction

This API endpoint allows for the creation of custom materials in the Higg MSI.

To create a custom material, the following base attributes are required:

* Name (open text field, must be unique within an MSI library)
* Category (user defined from the set of categories available in the MSI). See [MSI Get Material Categories](/v1.0/reference/msi-get-material-categories) for additional information.
* At least one base material (user defined from the set of base materials available in the MSI) See [MSI Get Base Materials](/v1.0/reference/msi-get-base-materials) for additional information.

An optional text field material code can be added as 'code'.  This field can be used to store a PLM id. Note that the field is editable by users within MSI.

```text theme={null}
{
    "name": "My custom material",
    "code": "my PLM code",
    "category": "TX",
    "baseMaterials":[{
        "baseMaterialId": "FM002"
    }]
}
```

## Creating blends

Blends are based on % of material for 1kg of MSI material.  For example the code below represents an MSI material with 60% organic cotton, 40% polyester.  The % blend must equal 100%.

```text theme={null}
{

    "name": "Organic/Poly Blend",
    "code": "my PLM code",
    "baseMaterials":[{
        "baseMaterialId": "TX0010",
        "blendPercentage": 60
    }, {
        "baseMaterialId": "TX0001",
        "blendPercentage": 40
    }],
      "category": "TX"
}
```

## Setting Yields

Optionally one or multiple yields can be sent for a material.  All materials in MSI are normalized to 1kg.  Yields provide conversions for the MSI 1kg material to a linear/volumetric unit. See [MSI Get Yield Options](/v1.0/reference/msi-get-yield-options) for additional information.

```text theme={null}
{
    "name": "Example MSI custom material",
    "code": "yield 2",
    "baseMaterials": [
        {
            "baseMaterialId": "FM002"
        }
    ],
    "yieldInfo": [
        {
            "type": "Yards (volumetric)",
            "width": 1,
            "widthUnit": "m",
            "thickness": 2,
            "thicknessUnit": "in",
            "densityVolumetric": 13,
            "densityVolumetricUnit": "kg/m3"
        }
    ],
    "category": "TX"
}
```

## Setting Base Material Processes

The stage process for a base material can be changed via the API using the `processId`.  For example, changing 'cotton, fiber' to 'cotton fiber, organic" in the raw material formation stage.  The processes must be available for the base material to change it. See [MSI Get Processes for Base Material](/v1.0/reference/msi-get-processes-for-base-material) for how to get a list of available processes and their IDs.

```text theme={null}
{
    "name": "Test blend",
    "code": "xyz PLM code",
    "baseMaterials":[{
        "baseMaterialId": "FM002",
        "blendPercentage": 60,
        "processes": {
      	 "P001": "PR0804000648",
         "P002": "PR0804000331"
        }
    }, {
    	 "baseMaterialId": "TX0010",
       "blendPercentage": 40,
       "processes": {
       	"P006": "PR0804000543"
       }
   }],
      "category": "TX"
}
```

See [MSI Data Dictionary](/v1.0/docs/msi-data-dictionary#materialtrimpackage-metadata) for details about the parameters.
