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.

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