Field Squared API Services

<back to all web services

InventoryItemType

The following routes are available for this service:
GET,PUT,POST/{Workspace}/InventoryItemType
GET,PUT,POST/{Workspace}/InventoryItemType/{ObjectId}
import 'package:servicestack/servicestack.dart';

abstract class InventoryTreeNode
{
    String? Type;
    int? DescendantCount;

    InventoryTreeNode({this.Type,this.DescendantCount});
    InventoryTreeNode.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Type = json['Type'];
        DescendantCount = json['DescendantCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Type': Type,
        'DescendantCount': DescendantCount
    };

    getTypeName() => "InventoryTreeNode";
    TypeContext? context = _ctx;
}

class InventoryItemType extends InventoryTreeNode implements IConvertible
{
    String? Type;
    String? ObjectId;
    String? Workspace;
    String? ExternalId;
    String? Created;
    String? LastUpdated;
    String? ItemType;
    String? Desc;
    String? VendorNum;
    String? PurchasingUOM;
    String? SalesUOM;
    int? ReorderLevel;
    int? ReorderQty;
    double? DefaultUnitCost;
    double? DefaultUnitPrice;
    String? Barcode;
    bool? UseSerialNumbers;
    String? Template;
    Map<String,String?>? Data;
    bool? Enabled;
    String? ParentCategoryId;
    bool? IncludeInactive;

    InventoryItemType({this.Type,this.ObjectId,this.Workspace,this.ExternalId,this.Created,this.LastUpdated,this.ItemType,this.Desc,this.VendorNum,this.PurchasingUOM,this.SalesUOM,this.ReorderLevel,this.ReorderQty,this.DefaultUnitCost,this.DefaultUnitPrice,this.Barcode,this.UseSerialNumbers,this.Template,this.Data,this.Enabled,this.ParentCategoryId,this.IncludeInactive});
    InventoryItemType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Type = json['Type'];
        ObjectId = json['ObjectId'];
        Workspace = json['Workspace'];
        ExternalId = json['ExternalId'];
        Created = json['Created'];
        LastUpdated = json['LastUpdated'];
        ItemType = json['ItemType'];
        Desc = json['Desc'];
        VendorNum = json['VendorNum'];
        PurchasingUOM = json['PurchasingUOM'];
        SalesUOM = json['SalesUOM'];
        ReorderLevel = json['ReorderLevel'];
        ReorderQty = json['ReorderQty'];
        DefaultUnitCost = JsonConverters.toDouble(json['DefaultUnitCost']);
        DefaultUnitPrice = JsonConverters.toDouble(json['DefaultUnitPrice']);
        Barcode = json['Barcode'];
        UseSerialNumbers = json['UseSerialNumbers'];
        Template = json['Template'];
        Data = JsonConverters.toStringMap(json['Data']);
        Enabled = json['Enabled'];
        ParentCategoryId = json['ParentCategoryId'];
        IncludeInactive = json['IncludeInactive'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Type': Type,
        'ObjectId': ObjectId,
        'Workspace': Workspace,
        'ExternalId': ExternalId,
        'Created': Created,
        'LastUpdated': LastUpdated,
        'ItemType': ItemType,
        'Desc': Desc,
        'VendorNum': VendorNum,
        'PurchasingUOM': PurchasingUOM,
        'SalesUOM': SalesUOM,
        'ReorderLevel': ReorderLevel,
        'ReorderQty': ReorderQty,
        'DefaultUnitCost': DefaultUnitCost,
        'DefaultUnitPrice': DefaultUnitPrice,
        'Barcode': Barcode,
        'UseSerialNumbers': UseSerialNumbers,
        'Template': Template,
        'Data': Data,
        'Enabled': Enabled,
        'ParentCategoryId': ParentCategoryId,
        'IncludeInactive': IncludeInactive
    });

    getTypeName() => "InventoryItemType";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'InventoryTreeNode': TypeInfo(TypeOf.AbstractClass),
    'InventoryItemType': TypeInfo(TypeOf.Class, create:() => InventoryItemType()),
});

Dart InventoryItemType DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /{Workspace}/InventoryItemType HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<InventoryItemType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Inventory">
  <DescendantCount>0</DescendantCount>
  <Barcode>String</Barcode>
  <Created>String</Created>
  <Data xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Data>
  <DefaultUnitCost>0</DefaultUnitCost>
  <DefaultUnitPrice>0</DefaultUnitPrice>
  <Desc>String</Desc>
  <Enabled>false</Enabled>
  <ExternalId>String</ExternalId>
  <IncludeInactive>false</IncludeInactive>
  <ItemType>String</ItemType>
  <LastUpdated>String</LastUpdated>
  <ObjectId>String</ObjectId>
  <ParentCategoryId>String</ParentCategoryId>
  <PurchasingUOM>String</PurchasingUOM>
  <ReorderLevel>0</ReorderLevel>
  <ReorderQty>0</ReorderQty>
  <SalesUOM>String</SalesUOM>
  <Template>String</Template>
  <UseSerialNumbers>false</UseSerialNumbers>
  <VendorNum>String</VendorNum>
  <Workspace>String</Workspace>
</InventoryItemType>