Inventory

Updated: 13 Feb 2025

This section details the API calls available for managing inventory data within Tekla PowerFab.

API Calls

  • GetInventory

    This API call retrieves information about inventory items. You can filter the results using various criteria, such as material type, shape, or location.

    Request (XML)

    <FabSuiteXMLRequest>
      <ConnectionGUID>your_connection_guid</ConnectionGUID>
      <GetInventory>
        <Filter>
          <MaterialTypeID>1</MaterialTypeID> 
          <Shape>W</Shape>
        </Filter>
      </GetInventory>
    </FabSuiteXMLRequest>
    

    Response (XML)

    <FabSuiteXMLResponse>
      <GetInventory>
        <Successful>true</Successful>
        <InventoryItem>
          <InventoryItemID>101</InventoryItemID>
          <MaterialTypeID>1</MaterialTypeID>
          <Shape>W</Shape>
          <Dimensions Metric="0">16 x 36</Dimensions> 
          <Quantity>500</Quantity>
          <QuantityUOM>ft</QuantityUOM> 
        </InventoryItem>
        <InventoryItem>
          <InventoryItemID>102</InventoryItemID>
          <MaterialTypeID>1</MaterialTypeID>
          <Shape>W</Shape>
          <Dimensions Metric="0">12 x 26</Dimensions> 
          <Quantity>1200</Quantity>
          <QuantityUOM>ft</QuantityUOM> 
        </InventoryItem>
      </GetInventory>
    </FabSuiteXMLResponse>
    

    Code Example (C#)

    // Create the request object
    reqPowerFabAPI.fsreqFabSuiteXMLRequest request = new reqPowerFabAPI.fsreqFabSuiteXMLRequest();
    request.ConnectionGUID = connectionGUID;
    
    // Create the GetInventory command with filter
    reqPowerFabAPI.fsreqGetInventory getCommand = new reqPowerFabAPI.fsreqGetInventory();
    getCommand.Filter = new reqPowerFabAPI.fsreqGetInventory_Filter();
    getCommand.Filter.MaterialTypeID = 1;
    getCommand.Filter.Shape = "W";
    
    // Add the command to the request
    request.GetInventory = new List<reqPowerFabAPI.fsreqGetInventory>();
    request.GetInventory.Add(getCommand);
    
    // Execute the command and get the response
    resPowerFabAPI.FabSuiteXMLResponse response = executeCommand(request); // Note the updated response type
    
    // Handle the response (check for errors, etc.)
    if (response.GetInventory.First().Successful) 
    {
        List<resPowerFabAPI.InventoryItem> items = response.GetInventory.First().InventoryItem;
        //... process the retrieved inventory items
    }
    else 
    {
        //... handle errors
    }
    
  • InventoryItem_Insert

    This API call allows you to add new inventory items to Tekla PowerFab. You'll need to provide details like material type, shape, dimensions, quantity, and location.

    Request (XML)

    <FabSuiteXMLRequest>
      <ConnectionGUID>your_connection_guid</ConnectionGUID>
      <InventoryItem_Insert>
        <InventoryItem>
          <MaterialTypeID>2</MaterialTypeID> 
          <Shape>C</Shape>
          <Dimensions Metric="1">100 x 50</Dimensions> 
          <Quantity>300</Quantity>
          <QuantityUOM>m</QuantityUOM> 
          <InventoryLocationID>5</InventoryLocationID> 
        </InventoryItem>
      </InventoryItem_Insert>
    </FabSuiteXMLRequest>
    

    Code Example (C#)

    // Create the request object
    reqPowerFabAPI.fsreqFabSuiteXMLRequest request = new reqPowerFabAPI.fsreqFabSuiteXMLRequest();
    request.ConnectionGUID = connectionGUID;
    
    // Create the InventoryItem object
    reqPowerFabAPI.fsreqInventoryItem newItem = new reqPowerFabAPI.fsreqInventoryItem();
    newItem.MaterialTypeID = 2;
    newItem.Shape = "C";
    newItem.Dimensions = new reqPowerFabAPI.fsDimensionsWithMetric { Value = "100 x 50", Metric = true };
    newItem.Quantity = 300;
    newItem.QuantityUOM = "m";
    newItem.InventoryLocationID = 5; 
    
    // Create the InventoryItem_Insert command
    reqPowerFabAPI.fsreqInventoryItem_Insert insertCommand = new reqPowerFabAPI.fsreqInventoryItem_Insert();
    insertCommand.InventoryItem = newItem;
    
    // Add the command to the request
    request.InventoryItem_Insert = insertCommand;
    
    // Execute the command and get the response
    resPowerFabAPI.FabSuiteXMLResponse response = executeCommand(request); // Note the updated response type
    
    // Handle the response (check for errors, etc.)
    //...
    
  • InventoryItem_Issue

    Use this API call to issue inventory items, typically for use in a production job. You'll need to specify the inventory item and the quantity to issue.

  • InventoryItem_Unissue

    This call allows you to unissue inventory items, returning them to the available inventory.

  • InventoryItem_Move

    Use this API call to move inventory items from one location to another. You'll need to specify the item and the new location.

  • InventoryRemnant_Upsert

    This API call allows you to create or update inventory remnants. You'll need to provide details like the original inventory item, the remaining dimensions, and the quantity.

InventoryItem_Issue

Description: [To be added]

Request:

[To be added]

Response:

[To be added]

Code Example:

[To be added]

Notes:

  • [To be added]

InventoryItem_Unissue

Description: [To be added]

Request:

[To be added]

Response:

[To be added]

Code Example:

[To be added]

Notes:

  • [To be added]

InventoryItem_Move

Description: [To be added]

Request:

[To be added]

Response:

[To be added]

Code Example:

[To be added]

Notes:

  • [To be added]

InventoryRemnant_Upsert

Description: [To be added]

Request:

[To be added]

Response:

[To be added]

Code Example:

[To be added]

Notes:

  • [To be added]

InventoryRemnant_Delete

Description: [To be added]

Request:

[To be added]

Response:

[To be added]

Code Example:

[To be added]

Notes:

  • [To be added]

End of Section: Inventory

Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.