Create a UDF field
In order to create a new UDF field, we first need to know which UDF page that field is going to go on. Below we will walk through the creation of a UDF page, and then add some UDF fields to it.
To create a UDF page, send a POST request to the following endpoint
https://better-snow-2961.spirelan.com:10880/api/v2/companies/inspire2021/inventory/items/udf/pages
With the below example payload data
{ "label": "metrics" }
This creates a new UDF page in the context of sales orders called Metrics
Now we will add some fields on to the new UDF page, we will add two fields a boolean called isSeasonal, and a multi selection option for Season.
To do this we will send a PUT request to the end point for udf field, we will define our udf field endpoint as isSeasonal in the URL field and we will include the new UDF page ID of 25 with the details of the Boolean field that we wish to create
And then we will add a second field which we will define as Season
Visiting a UDF tab for any inventory item shows our new additions to the UDF structure for inventory items.