Related Data Sets

The related resources previously discussed all link to a single resource. However, it is possible that the current resource has a list many other linked resources of the same type. A good example is a sales order header that has one or more child details. As a convenience and additionally for guidance/performance reasons, many entity representations have additional hyperlinked relations to these data sets. These field names always end in “_set”.

Continuing the sales order header example, the order details set could be represented as the following in an order_hdr retrieve representation. Assume there are two detail line items and the “id” value of the order_hdr entity is “123”.

GET https://.../wms/lgfapi/v10/entity/order_hdr/123

{

“id”: 123,

"order_dtl_set": {

"result_count": 2,

"url": "https://.../wms/lgfapi/v10/entity/order_dtl/?order_id=123"

},

}

It’s important to note that unlike the “_id” related resources which have a retrieve style hyperlink to the specific resource, “_set” related representations use list style with query string filters in order to return a paginated list of 1 to n resource representations. Also, instead of giving the “id” and “key”, the related count is returned.

If no related resources are found for the set, the value will be “null” for JSON representations and an empty tag for XML.