Details:
There are currently 3 types of measurements for Inventory Containers:
- Mass
- Volume
- Count
You can get this by fetching a container /inventory/containers/{eid} and looking into the Amount field:
{ "id": "PE_INV_SYSTEM_Amount", "definition": { "key": "PE_INV_SYSTEM_Amount", "title": "Amount", "type": "unit", "measures": [ { "measure": "mass", "label": "Mass" }, { "measure": "volume", "label": "Volume" }, { "measure": "count", "label": "Count" } ], "isUserDefined": false, "isRequired": true, "defaultUnit": "g" }, "content": { "measure": "count", "isRawValue": false, "user": "10 item(s)", "value": 10.0 } }
Using the example data above under the content object, you can incorporate this into your POST request to create a container with that amount and measure type.
Here is an example to create a container with the default measure type of mass and the default unit, grams:
{ "data": { "type": "inventoryContainer", "attributes": { "typeId": "7cfdaaa2-4c7b-4935-a61f-1179486ba68e", ///your container type eid "status": "AVAILABLE", "location": { "id": "cc121a75-1867-46c7-9ede-0f30c9f5ae40" ///your location eid }, "contents": [ { "entityId": "batch:64b1ad20f2036c0ff46103a0" ///your batch eid } ], "fields": [ { "id": "371ec368-5ebd-4fdc-9823-a27a8c0a17f1", ///Inventory Security field eid "content": { "value": "Default" } }, { "id": "PE_INV_SYSTEM_Amount", "content": { "value": 100, "unit": "g" } } ] } } }
Same example now using items as measure type:
{ "data": { "type": "inventoryContainer", "attributes": { "typeId": "7cfdaaa2-4c7b-4935-a61f-1179486ba68e", "status": "AVAILABLE", "location": { "id": "cc121a75-1867-46c7-9ede-0f30c9f5ae40" }, "contents": [ { "entityId": "batch:64b1ad20f2036c0ff46103a0" } ], "fields": [ { "id": "371ec368-5ebd-4fdc-9823-a27a8c0a17f1", "content": { "value": "Default" } }, { "id": "PE_INV_SYSTEM_Amount", "content": { "measure": "count", "isRawValue": false, "user": "10 item(s)", "value": 10.0 } } ] } } }
Now using volume measure type:
{ "data": { "type": "inventoryContainer", "attributes": { "typeId": "7cfdaaa2-4c7b-4935-a61f-1179486ba68e", "status": "AVAILABLE", "location": { "id": "cc121a75-1867-46c7-9ede-0f30c9f5ae40" }, "contents": [ { "entityId": "batch:64b1ad20f2036c0ff46103a0" } ], "fields": [ { "id": "371ec368-5ebd-4fdc-9823-a27a8c0a17f1", "content": { "value": "Default" } }, { "id": "PE_INV_SYSTEM_Amount", "content": { "measure": "volume", "isRawValue": false, "user": "10 mL", "value": 10.0 } } ] } } }