Comparison Operators & Formatting

Comparison Operators

With the ItemPath API, you can use operators in your arguments to refine your response results.

"Not" Operator: [not]

In this example, we want to get history records of orders that have been processed, not deleted. To do this, we want to filter out records with a Motive Type of 5 (deleted). (See this guide for more transaction types.)

/transactions?motiveType=[not]5

This can be combined with other operators. If we wanted to get all history records that have been processed, but not yet exported, we could do specify an Export State Type of 2 (ready to export).

/transactions?motiveType=[not]5&exportStateType=2

"Greater Than" & "Less Than" Operators: [gt] & [lt]

In this example, we want to get a list of materials with a current quantity of at least 1. We can use the [gt] operator for arguments like this.

/materials?currentQuantity=[gt]0

We can do something similar with the [lt] operator. In this case, we want to get materials that are about to be over-picked and cause a shortage. We can narrow down our results by specifying a net quantity of below 0.

/materials?netQuantity=[lt]0

These can also be combined with other operators for more complex results. For example, we can get orders that are not yet in process (Order Status 11) but have a high priority (Priority 3 or 4).

/orders?priority=[gt]2&orderStatusType=[lt]11

Formatting

API calls require particular formatting, and without it will return errors.

Array Objects

Using an array in body parameters allows sending a collection of items under one variable name. The most common use of this is adding order lines to an order. At least one order line is required in the creation of an order. (Creating orders is described in further depth here.)

The key to formatting an array is to use square brackets around the contents of the array.

{
    "name": "Example Order",
    "directionType": "2",
    "order_lines": [
        {
            "materialId": "E3E3FEBE-2273-41CD-ADE2-7F6F7F8872DA",
            "quantity": "10",
            "Info1": "Example Material 1",
            "Info2": "VLM1",
        },
        {
            "materialId": "EC4314C4-581A-44E5-92F7-C9BD79414046",
            "quantity": "20",
            "Info1": "Example Material 2",
            "Info2": "VLM2",
        }
    ],
    "warehouseName": "WH1",
    "Info1": "This order has two order lines."
}

Another common example of using an array is for adding material codes (alternate lookup codes) to a material. (Read more about creating materials here.)

{
    "name": "Example Material",
    "codes": ["Code1", "Code2"]
}

Date Format

The ItemPath API returns dates in YYYY-MM-DDTHH:mm:ss.SSSSSS format. In this example, the Creation Date of a transaction was November 22, 2021, at 7:12 pm, 31 seconds and 91 milliseconds.

"creationDate": "2021-11-22T19:12:31.910000"

To use dates in comparators, any of the following formats can be used:

FormatExample
YYYY-MM2022-01
YYYY-MM-DD
2022-01-23
YYYY-MM-DDTHH
2022-01-23T09
YYYY-MM-DDTHH:mm
2022-01-23T09:07
YYYY-MM-DDTHH:mm:ss
2022-01-23T09:07:21
YYYY-MM-DDTHH:mm:ss.S
2022-01-23T09:07:21.2
YYYY-MM-DDTHH:mm:ss.SS
2022-01-23T09:07:21.20
YYYY-MM-DDTHH:mm:ss.SSS
2022-01-23T09:07:21.205
YYYY-MM-DDTHH:mm:ss.SSSS
2022-01-23T09:07:21.2050
YYYY-MM-DDTHH:mm:ss.SSSSS
2022-01-23T09:07:21.20501
YYYY-MM-DDTHH:mm:ss.SSSSSS
2022-01-23T09:07:21.205010


For example, if you want to get all transactions from January, 2022, you could filter by after January 1, 2022 and before February 1, 2022. Since no time is specified, it will automatically set the time to 00:00:00.000000.

/transactions?creationDate=[gt]2022-01-01&creationDate=[lt]2022-02-01