Materials

Materials are types of items that are stored. When creating and updating materials, the changes need to be verified and updated asynchronously by PowerPick.

Attributes

  • id uuid

  • name string

    The name of the material.

  • creationDate datetime

    When this material was created.

  • reOrderPoint float

    The minimum level of the material.

  • canOrderPoint float

    An alternate minimum or maximum level of the material.

  • currentQuantity integer

    How many of this material is in PowerPick

  • currentValue integer

    The current quantity of this material multiplied by the value.

  • expectedQuantity string

  • pickQuantity integer

    Amount in pending pick orders.

  • putQuantity integer

    Amount in pending put orders.

  • netQuantity integer

    Current quantity plus put quantity minus pick quantity.

  • unitOfMeasure string

    What measurement is used.

  • materialPropertyId UUID

    The id of the property this material belongs to.

  • weightPerUnit float

    How much each material weighs.

  • valuePerUnit float

    How much each individual material is worth.

  • isBlocked integer

    Whether the material is inactive.

  • isCounted boolean

    Whether this material has an accurate count.

  • blockReason string

    Why the material is inactive.

  • Info1 string

    A generic field for custom use.

  • Info2 string

    A generic field for custom use.

  • Info3 string

    A generic field for custom use.

  • Info4 string

    A generic field for custom use.

  • Info5 string

    A generic field for custom use.

  • [DynamicField] string

    Any custom fields set up in PowerPick.

Endpoints

List Materials

get /api/materials

Get the materials from the PPG database and return a JSON response.

Arguments

  • name string

    Only return materials that have the given name.

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 250.

  • offset integer

    Will return items, but only those after the integer amount.

  • countOnly boolean

    When true, will only return a count of the amount of items in the query.

  • orderBy string, array

    Order the response by the selected field. Multiple values can be passed, separated by a comma.

  • [dynamic_field]

    Any dynamic fields that have been set up can be used as a filter.

  • status string

    Only return order with a certain status.

Request with curl
curl "http://[Your IP] /api/materials" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{
    "materials": [
        {
            "MATERIALINFO6": null,
            "creationDate": "2021-11-15T18:45:42.210000",
            "isBlocked": 0,
            "id": "5736B656-568A-4F8C-BBB1-E7D663337B8B",
            "Info5": null,
            "Info1": "Example",
            "materialPropertyId": "F687AB5F-E6F6-48A2-B748-10CE0A6E2C29",
            "unitOfMeasure": null,
            "name": "Sample Material",
            "canOrderPoint": null,
            "blockReason": null,
            "Info4": null,
            "Info2": null,
            "valuePerUnit": null,
            "weightPerUnit": null,
            "Info3": null,
            "reOrderPoint": null
        }
    ]
}

Create Material

post /api/materials

Create a material and get a response.

For more about Material Properties, click here.
For more about Material Codes, click here.

Body Parameters

  • name string REQUIRED

    The name of the material.

  • materialPropertyId uuid

    The ID of the material property assigned to this material. If this and materialProperty are both blank, the first material property found will be the default.

  • materialProperty string

    The name of the material property assigned to this material. If this and materialPropertyId are both blank, the first material property found will be the default.

  • codes array

    The name of the material code assigned to the material. There can be multiple codes per material, which need to be passed as an array.

  • reOrderPoint float

    The minimum level of the material.

  • canOrderPoint float

    An alternate minimum or maximum level of the material.

  • unitOfMeasure string

    What measurement is used.

  • weightPerUnit float

    How much each material weighs at the unit level.

  • valuePerUnit float

    How much the material is worth at the unit level.

  • isBlocked integer

    Whether the material is inactive.

  • blockReason string

    Why the material is inactive.

  • Info1 string

  • Info2 string

  • Info3 string

  • Info4 string

  • Info5 string

  • family string

    The name of a group this material belongs to.

  • [DynamicField] string

    Any material dynamic field that is in PowerPick.

Request with curl
curl "http://[Your IP] /api/materials" \ -X post \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]" \
-d '{
  "name": "Sample Material",
  "codes": ["SampleCode1", "SampleCode2"],
  "Info1": "This example has material codes.",
  "unitOfMeasure": "lbs",
  "weightPerUnit": 2,
  "valuePerUnit": 1.5,
  "materialPropertyId" : "F687AB5F-E6F6-48A2-B748-10CE0A6E2C29"
}'
Example Response
{
    "material": {
        "name": "Sample Material",
        "codes": [
            "SampleCode2",
            "SampleCode1"
        ],
        "Info2": null,
        "Info1": "This example has material codes.",
        "currentQuantity": 0.0,
        "weightPerUnit": 2.0,
        "canOrderPoint": null,
        "unitOfMeasure": "lbs",
        "Info3": null,
        "expectedQuantity": 0.0,
        "blockReason": null,
        "pickQuantity": 0.0,
        "netQuantity": 0.0,
        "currentValue": 0.0,
        "reOrderPoint": null,
        "materialPropertyId": "F687AB5F-E6F6-48A2-B748-10CE0A6E2C29",
        "isBlocked": 0,
        "Info4": null,
        "putQuantity": 0.0,
        "creationDate": "2022-03-17T19:15:16.067000",
        "id": "EBD286D1-4D5A-41C3-B24A-E62FC1008E57",
        "valuePerUnit": 1.5,
        "Info5": null
    }
}

Show Material

get /api/materials/[id]

Get a specific material from the PPG database and return a JSON response. The order will be pulled from the Material table.

Arguments

  • Info1 String

  • Info2 String

  • Info3 String

  • Info4 String

  • Info5 String

  • canOrderPoint Integer

    An alternate minimum or maximum level of the material.

  • creationDate DateTime

    The date when material was created.

  • currentQuantity Decimal

  • currentValue Integer

  • expectedQuantity Decimal

  • id uuid

  • materialProperty String

    The name of the material property assigned to this material. If this and materialPropertyId are both blank, the first material property found will be the default.

  • name String

    The name of the material.

  • netQuantity Decimal

  • pickQuantity Decimal

  • pullQuantity Decimal

  • reOrderPoint Integer

    The minimum level of the material.

  • unitOfMeasure String

    What measurement is used.

  • valuePerUnit Integer

    How much the material is worth at the unit level.

  • weightPerUnit Integer

    How much each material weighs at the unit level.

Request with curl
curl -L 
-X GET '[Your IP]/api/materials/5736B656-568A-4F8C-BBB1-E7D663337B8B' 
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer [Your JWT Access Token]'
Example Response
{
    "material": {
        "Info5": null,
        "id": "5736B656-568A-4F8C-BBB1-E7D663337B8B",
        "netQuantity": 0.0,
        "currentQuantity": 0.0,
        "currentValue": 0,
        "materialPropertyId": "F687AB5F-E6F6-48A2-B748-10CE0A6E2C29",
        "unitOfMeasure": null,
        "valuePerUnit": null,
        "weightPerUnit": null,
        "Info3": null,
        "expectedQuantity": 0.0,
        "blockReason": null,
        "canOrderPoint": null,
        "putQuantity": 0.0,
        "creationDate": "2021-11-15T18:45:42.210000",
        "Info1": "Example",
        "pickQuantity": 0.0,
        "Info2": null,
        "reOrderPoint": null,
        "MATERIALINFO6": null,
        "isBlocked": 0,
        "Info4": null,
        "name": "Sample Material"
    }
}

Update Material

put /api/materials/[id]

Update a material and get a response. Each key/value is optional. Only keys sent will be updated, but an object is required to be sent.

Arguments

  • name string

    The name of the material.

  • reOrderPoint integer

    The minimum level of the material.

  • canOrderPoint integer

    The max level of the material.

  • unitOfMeasure string

    What measurement is used.

  • weightPerUnit integer

    How much each material weighs.

  • valuePerUnit integer

    How much each individual material is worth.

  • isBlocked integer

    Whether the material is inactive.

Request with curl
curl "http://[Your IP] /api/materials/[id]" \ -X put \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
-d '{ 
  "name": "Renamed Sample Material"
  "Info1": "Example" 
}'
Example Response
{
    "material": {
        "Info5": null,
        "id": "5736B656-568A-4F8C-BBB1-E7D663337B8B",
        "netQuantity": 0.0,
        "currentQuantity": 0.0,
        "currentValue": 0,
        "materialPropertyId": "F687AB5F-E6F6-48A2-B748-10CE0A6E2C29",
        "unitOfMeasure": null,
        "valuePerUnit": null,
        "weightPerUnit": null,
        "Info3": null,
        "expectedQuantity": 0.0,
        "blockReason": null,
        "canOrderPoint": null,
        "putQuantity": 0.0,
        "creationDate": "2021-11-15T18:45:42.210000",
        "Info1": "Example",
        "pickQuantity": 0.0,
        "Info2": null,
        "reOrderPoint": null,
        "MATERIALINFO6": null,
        "isBlocked": 0,
        "Info4": null,
        "name": "Renamed Sample Material"
    }
}

Delete Material

get /api/materials/[id]/delete

Delete a specific material from the PPG database and return a JSON response.

Arguments

Request with curl
curl -L 
-X DELETE '[Your IP]/api/materials/5736B656-568A-4F8C-BBB1-E7D663337B8B/delete' 
-H 'Content-Type: application/json' 
-H 'Authorization: Bearer [Your JWT Access Token]'
Example Response
{"deleted": "true"}