Skip to main content

Supply Chain Data Model API

This page introduces the data model API provided by InterSystems Supply Chain Orchestrator™.

Supply Chain Orchestrator includes a data model APIOpens in a new tab that you can use for model discovery and customization, including ways to

  • List all supply chain data objects

  • Retrieve details of any objects, with attributes, data type, size limit, and so on

  • Extend the data model by adding custom attributes to existing supply chain objects

List of Supply Chain Data Objects

Use this API call to find all supply chain objects in the data model:

GET {{IRIS-SERVER}}/api/scdata/v1/objects

The response looks like the following example:

[
    {
        "objectName": "BOM",
        "className": "SC.Data.BOM",
        "description": "Object for bill of material. This object is commonly
                        used in manufacturing to specify the parts required 
                        to make or assemble a product."
    },
    {
        "objectName": "Carrier",
        "className": "SC.Data.Carrier",
        "description": "This object is used to capture shipment 
                        carrier information."
    },
...
]

To find the details of each object, use the next API call with the objectName value returned in this API response.

Get Object Definition

To get the details of an object, first get the object name using the above API call. Then use this API call:

GET {{IRIS-SERVER}}/api/scdata/v1/objects/[ObjectName]

For example, the following is part of the response returned for Customer object:

{
    "objectName": "Customer",
    "className": "SC.Data.Customer",
    "objectName": "This object is used to capture the master
                  data for a customer.",
    "attributes": [
        {
            "name" : "uid",
            "description" : "unique ID of a customer",
            "dataType" : "String",
            "required" : 1,
            "maxLength" : "256",
            "isCustom" : 0
        },
        {
            "name" : "name",
            "description" : "official name of the customer",
            "dataType" : "String",
            "required" : 0,
            "maxLength" : "256",
            "isCustom" : 0
        },
...
    ]
}

Adding Custom Attributes

To add a new attribute to an object in the supply chain model, use this API call:

POST {{IRIS-SERVER}}/api/scdata/v1/attributes/[ObjectName]

with the attribute definition JSON in the API body, such as:

{
    "name" : "customProperty",
    "description" : "Custom attribute added for testing",
    "dataType" : "String",
    "maxlength" : 120,
    "required" : 1
}

Once an attribute is added through this API, data access APIs can be used to load data into the attributes, or search for records based on the newly created attributes. No additional step or waiting is needed.

Important:

This API does not support more advanced customizations as can be made by modifying the class directly, such as adding indexes or validation rules. Also, there is no API to update or delete custom attributes, so use this API with caution.

See Also

FeedbackOpens in a new tab