This API creates a Forecast in Smart Materials. A Forecast defines parameters like work packages, warehouses, and so on of a Forecast Run.
A Forecast Run is a combination of Forecast header code and a unique run number.
Required Privilege: API_CREATE_FAHEADER
Headers
Header Name |
Description |
Required |
Values |
---|---|---|---|
Authorization |
Access token |
Required |
Bearer <access_token> |
Content-Type |
Request type format |
Required |
application/JSON |
Body
URL: POST https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Forecasts
Specify values for the project, discipline, and language in the URL. The project, discipline, and language together, define the project environment where the Forecast is created.
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
FahCode |
Name of the Forecast specifies what the Forecast does |
String |
Required |
|
RunNumber |
Unique number attached to a FahCode |
Decimal |
Required |
For a new Forecast, run number |
Shortage |
Specifies acceptable short quantities used in Bill of Materials allocation. Allowed values are:
|
String |
Optional |
Default value is 2-Pass Optimized (Any). |
Allocate Level |
Defines the pre-receiving level of material that a Forecast Run should check. Allowed values are:
|
String |
Optional |
Forecast Run starts with the inventory level and look For this search, Default value is Only Inventory. |
SplitType |
Defines Forecast Run split type. Allowed values are:
|
String |
Optional |
|
AttrId |
Unique ID of the used attribute, when the split type is NA or PA. |
Decimal |
Optional |
To view existing attributes, use: GET https://{host}/Smat/V1/ |
DtpId |
Unique ID of the delivery type |
Decimal |
Optional |
To view existing delivery types, use: GET https://{host}/Smat/V1/ |
Priority |
Type of priority specified for the assigned nodes Allowed values are:
|
String |
Optional |
Default value is NULL. |
SortOrder |
Allows you to calculate the weight of nodes assigned to a work package. Allowed Values are:
|
String |
Optional |
Default value is None. |
WeightAttrId |
Unique ID of the weight |
Decimal |
Optional |
|
TagNoOption |
Tag number option. Allowed values are:
|
String |
Optional |
Default value is |
DdId |
Unique ID of the delivery designation |
Decimal |
Optional |
To view available delivery designations, GET https://{host}/Smat/V1/Projects(‘:project’) |
AllPositionInd |
Allowed values are Y and N.
|
String |
Optional |
|
PositionsWithFullSiteQty |
Allowed values are Y and N.
|
String |
Optional |
|
SubstInd |
Indicates when the substitution/ transformation Allowed values are Y, N, and A.
|
String |
Optional |
Default value is N. |
ExcludeMIRQtyInd |
Indicates whether the issued quantities on unposted MIRs by BOM Allowed values are Y and N.
|
String |
Optional |
|
BestQuantityInd |
Allowed values are Y and N.
|
String |
Optional |
If StatId is not passed, |
UseOnlySiteStatusInd |
Allowed values are Y and N.
|
String |
Optional |
If BestQuantityInd is set to N, |
OnlyEndnodesInd |
Allowed values are Y and N.
|
String |
Optional |
|
StatId |
Unique ID of the issue status.
|
Decimal |
Optional |
To view existing Issue status, use: GET https://{host}/Smat/V1/Projects(‘:project’) |
LstId |
Unique ID of the list status |
Decimal |
Required |
To view existing list status, use: GET https://{host}/Smat/V1/Projects(‘:project’) |
WeightInd |
Allowed values are Y and N.
|
String |
Optional |
|
CostInd |
Allowed values are Y and N.
|
String |
Optional |
|
HourInd |
Allowed values are Y and N.
|
String |
Optional |
|
StartDate |
Item shipments whose |
Date Time Offset |
Optional |
The acceptable format is YYYY-MM-DD. |
EndDate |
Item shipments whose |
Date Time Offset |
Optional |
The acceptable format is YYYY-MM-DD. |
IgnoreNullDateInd |
Allowed values are Y and N.
|
String |
Optional |
|
AutoAssignWhInd |
Auto assign warehouse to the Forecast.
|
String |
Required |
Forecast requires multiple collections which are as follows:
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
ListNodes |
Collection of list nodes that you can assign to a work package. To view existing list nodes, use: GET https://{host}/Smat/V1/Projects(‘:project’) |
String |
Optional |
|
AssignedWarehouses |
Collection of Forecast warehouses |
Collection |
Optional |
To view existing warehouses, use: GET https://{host}/Smat/V1/Projects(‘:project’) |
AssignedWorkpacks |
Collection of Forecast work packages |
Collection |
Required |
To view existing work packages, use: GET https://{host}/Smat/V1/Projects(‘:project’) |
-
AssignedWarehouses Entity Type
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
OrderSeq |
Sequence of the warehouses considered while forecasting. |
Decimal |
Optional |
|
WhCode |
Name or code of the warehouse |
String |
Optional |
To view existing warehouses, GET https://{host}/Smat/V1/Projects(':project') |
BnlCode |
Name or code of the bin location |
String |
Optional |
To view existing bin locations, GET https://{host}/Smat/V1/Projects(‘:project’) |
-
AssignedWorkpacks Entity Type
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
OrderSeq |
Sequence of the work packages considered while forecasting |
Decimal |
Optional |
|
AttrSort |
If the priority for a work package is Attribute, |
String |
Optional |
Default value is Ascending. |
PriorityType |
Priority type specified for work package in the current Forecast Run. Allowed values are:
|
String |
Optional |
Default value |
ApiAttributes |
List of attributes attached to the Forecast Run. This attribute list is used to create where condition for list positions. |
Collection |
Optional |
|
ApiCommodityCodes |
List of attached commodity codes. These commodity codes |
Collection |
Optional |
|
WpId |
Unique ID of the work package |
Integer |
Optional |
To view existing warehouses, use: GET https://{host}/Smat/V1/Projects(':project') |
-
Api Attrributes Entity type
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
AttrCode |
Name or code of the attribute |
String |
Required |
To view existing attributes, GET https://{host}/Smat/V1/Projects(':project') |
AttrValue |
Value of the attribute |
String |
Optional |
-
ApiCommodityCodes Entity Type
Element |
Description |
Type |
Required |
Notes |
---|---|---|---|---|
CommodityCode |
Name or code of the commodity |
String |
Required |
To view existing commodity codes, GET https://{host}/Smat/V1/Projects(':project') |
Size (1-5) |
Value of inputs of the geometric details |
String |
Optional |
Five values are allowed. |
Sample Code
POST https://in-smatapi.ingrnet.com/API21/Smat/v1/Projects('M06_1108')/Disciplines('PIPE')/Nls('ENGLISH')/Forecasts
{
"FahCode":"FAHCODE380",
"RunNumber":2,
"Shortage":"2-Pass Optimized(Any)",
"AllocateLevel":"Shipped Items",
"SplitType":"PA",
"AttrId":5571,
"DtpId":5701,
"Priority":"ISSUED FIRST",
"SortOrder":"HeaviestFirst",
"WeightAttrId":5130,
"TagNoOption":"Ignore Tag Number",
"AllPositionsInd": "Y",
"PositionsWithFullSiteQty":"Y",
"SubstInd":"Y",
"ExcludeMIRQtyInd":"Y",
"BestQuantityInd":"Y",
"UseOnlySiteStatusInd":"Y",
"OnlyEndnodesInd":"Y",
"StatId":5626,
"LstId":5046,
"WeightInd":"Y",
"CostInd":"Y",
"HourInd":"Y",
"StartDate":"2018-04-16",
"EndDate":"2018-04-16",
"IgnoreNullDateInd":"Y",
"ListNodes":
[
"MTO_FF"
],
"AssignedWarehouses":
[
{
"OrderSeq":2,
"WhCode":"RM_STD_WAREHOUSE"
}
],
"AssignedWorkpacks":
[
{
"OrderSeq":1,
"WpId": 2222,
"AttrSort":"ASC",
"PriorityType":"WP",
"ApiAttributes":
[
{
"AttrCode":"E_XCX_CONDUCTOR",
"AttrValue":"05"
}
],
"ApiCommodityCodes":
[
{
"Size1":"1.25",
"Size2":"S-XXS",
"Size3":"20",
"Size4":"28.5MM",
"Size5":"44929142",
"CommodityCode":"165201ETOF2E205"
},
{
"Size1":"20",
"Size2":"9.5MM",
"Size3":"S-XXS",
"Size4":"25.4MM",
"Size5":"52848838",
"CommodityCode":"165201EFOF2J042"
}
]
}
],
"AutoAssignWhInd":"N"
}
Success Response
Status: 200 OK
{
"@odata.context":"https://in-smatapi.ingrnet.com/API21/SMAT/V1/$metadata#Projects('M06_1108')/Disciplines('PIPE')/Nls('ENGLISH')/Forecasts/$entity",
"FahId":65698,
"ProjId":"M06_1108",
"FahCode":"FAHCODE381",
"RunNumber":2,
"LstId":5046,
"Shortage":"2-Pass Optimized(Any)",
"SplitType":"PA",
"AllPositionsInd":"Y",
"SubstInd":"Y",
"BestQuantityInd":"Y",
"UseOnlySiteStatusInd":"Y",
"WeightInd":"Y",
"CostInd":"Y",
"HourInd":"Y",
"SplitResult":null,
"StatId":5626,
"AttrId":5571,
"StartDate":null,
"EndDate":null,
"AllocateLevel":"Shipped Items",
"DtpId":5701,
"Priority":"ISSUED FIRST",
"WeightAttrId":5130,
"SortOrder:"HeaviestFirst",
"TagNoOption":"Ignore Tag Number",
"DdId":null,
"OnlyEndnodesInd":"Y",
"PositionsWithFullSiteQty":"Y",
"IgnoreNullDateInd":"Y",
"ExcludeMIRQtyInd":"Y",
"JobStatus":"NEW",
"JobStartDate":null,
"JobEndDate":null,
"ParentFahId":null,
"ListNodes":[]
"AutoAssignWhInd":"Y"
}
Element |
Description |
Type |
---|---|---|
FahId |
Unique ID of the Forecast |
Integer |
ProjId |
Unique ID of the Project |
String |
JobStartDate |
Start date of the Forecast job |
Date Time Offset |
JobEndDate |
End date of the Forecast job |
Date Time Offset |
ParentFahId |
Unique ID of the parent Forecast |
Integer |
JobStatus |
Status of the job, and job here is to run the Forecast |
String |
WpId |
Unique ID of the work package |
Decimal |
BnlCode |
Name or code of the bin location |
String |
ROSDate |
Date and time when the work package is Required on Site |
Date Time Offset |
BOMPath |
BOM path of the list node |
String |
SplitResult |
Value of the split type |
String |
WptfId |
Workpack to forecast ID |
Integer |
BOMDetails |
Collection of the attributes assigned to a BOM |
Collection |
LnId |
Unique ID of th list node |
Integer |
ApccId |
Unique ID of the ApiCommodityCodes |
Decimal |
ApaId |
Unique ID of the ApiAttributes |
Decimal |
After creating Forecast Header, NLS description can be added using NlsDescription.