AIM Web Services

<back to all web services

GetPOSTotalsRequest

In development, not yet for public use.

The following routes are available for this service:
POST/api/GetPOSTotals
import 'package:servicestack/servicestack.dart';

// @DataContract
class BaseRequest implements IConvertible
{
    /**
    * This is your AIM API Key provided by Tri-Tech
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
    String? ApiKey;

    // @DataMember
    // @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
    String? OAuthToken;

    BaseRequest({this.ApiKey,this.OAuthToken});
    BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'OAuthToken': OAuthToken
    };

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

// @DataContract
class BaseSecureRequest extends BaseRequest implements IConvertible
{
    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
    String? Token;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
    String? DeviceId;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
    String? AppId;

    BaseSecureRequest({this.Token,this.DeviceId,this.AppId});
    BaseSecureRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Token = json['Token'];
        DeviceId = json['DeviceId'];
        AppId = json['AppId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Token': Token,
        'DeviceId': DeviceId,
        'AppId': AppId
    });

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

// @DataContract
class BaseResponseResult implements IConvertible
{
    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
    String? StatusCode;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
    String? Login;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
    String? ErrorCode;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
    String? ErrorDisplayText;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
    String? ErrorMessage;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
    String? DomainName;

    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
    String? IpAddress;

    BaseResponseResult({this.StatusCode,this.Login,this.ErrorCode,this.ErrorDisplayText,this.ErrorMessage,this.DomainName,this.IpAddress});
    BaseResponseResult.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        StatusCode = json['StatusCode'];
        Login = json['Login'];
        ErrorCode = json['ErrorCode'];
        ErrorDisplayText = json['ErrorDisplayText'];
        ErrorMessage = json['ErrorMessage'];
        DomainName = json['DomainName'];
        IpAddress = json['IpAddress'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'StatusCode': StatusCode,
        'Login': Login,
        'ErrorCode': ErrorCode,
        'ErrorDisplayText': ErrorDisplayText,
        'ErrorMessage': ErrorMessage,
        'DomainName': DomainName,
        'IpAddress': IpAddress
    };

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

// @DataContract
class BaseResponse implements IConvertible
{
    /**
    * 
    */
    // @DataMember
    // @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
    BaseResponseResult? Status;

    BaseResponse({this.Status});
    BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Status = JsonConverters.fromJson(json['Status'],'BaseResponseResult',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Status': JsonConverters.toJson(Status,'BaseResponseResult',context!)
    };

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

// @DataContract
class ExceptionInfo implements IConvertible
{
    // @DataMember
    String? Barcode;

    // @DataMember
    String? Description;

    // @DataMember
    String? Base64Image;

    // @DataMember
    int? Category;

    // @DataMember
    int? SubCategory;

    ExceptionInfo({this.Barcode,this.Description,this.Base64Image,this.Category,this.SubCategory});
    ExceptionInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Barcode = json['Barcode'];
        Description = json['Description'];
        Base64Image = json['Base64Image'];
        Category = json['Category'];
        SubCategory = json['SubCategory'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Barcode': Barcode,
        'Description': Description,
        'Base64Image': Base64Image,
        'Category': Category,
        'SubCategory': SubCategory
    };

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

// @DataContract
class PosLineItem implements IScanItem, IConvertible
{
    // @DataMember
    int? SkuPk;

    // @DataMember
    int? SasPk;

    // @DataMember
    String? Sku;

    // @DataMember
    String? Serial;

    // @DataMember
    double? Quantity;

    // @DataMember
    ExceptionInfo? ExceptionInfo;

    // @DataMember
    double? Discount;

    // @DataMember
    int? NicsCat;

    // @DataMember
    int? NicsSub;

    // @DataMember
    double? PriceOverride;

    // @DataMember
    bool? AllowPriceOverrideToIgnoreMinPrice;

    // @DataMember
    String? Notes;

    PosLineItem({this.SkuPk,this.SasPk,this.Sku,this.Serial,this.Quantity,this.ExceptionInfo,this.Discount,this.NicsCat,this.NicsSub,this.PriceOverride,this.AllowPriceOverrideToIgnoreMinPrice,this.Notes});
    PosLineItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SkuPk = json['SkuPk'];
        SasPk = json['SasPk'];
        Sku = json['Sku'];
        Serial = json['Serial'];
        Quantity = JsonConverters.toDouble(json['Quantity']);
        ExceptionInfo = JsonConverters.fromJson(json['ExceptionInfo'],'ExceptionInfo',context!);
        Discount = JsonConverters.toDouble(json['Discount']);
        NicsCat = json['NicsCat'];
        NicsSub = json['NicsSub'];
        PriceOverride = JsonConverters.toDouble(json['PriceOverride']);
        AllowPriceOverrideToIgnoreMinPrice = json['AllowPriceOverrideToIgnoreMinPrice'];
        Notes = json['Notes'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SkuPk': SkuPk,
        'SasPk': SasPk,
        'Sku': Sku,
        'Serial': Serial,
        'Quantity': Quantity,
        'ExceptionInfo': JsonConverters.toJson(ExceptionInfo,'ExceptionInfo',context!),
        'Discount': Discount,
        'NicsCat': NicsCat,
        'NicsSub': NicsSub,
        'PriceOverride': PriceOverride,
        'AllowPriceOverrideToIgnoreMinPrice': AllowPriceOverrideToIgnoreMinPrice,
        'Notes': Notes
    };

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

// @DataContract
class PosResponseItem extends PosLineItem implements IConvertible
{
    // @DataMember
    double? PriceEach;

    // @DataMember
    double? Price;

    // @DataMember
    bool? Discountable;

    // @DataMember
    String? ErrorMessage;

    PosResponseItem({this.PriceEach,this.Price,this.Discountable,this.ErrorMessage});
    PosResponseItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        PriceEach = JsonConverters.toDouble(json['PriceEach']);
        Price = JsonConverters.toDouble(json['Price']);
        Discountable = json['Discountable'];
        ErrorMessage = json['ErrorMessage'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'PriceEach': PriceEach,
        'Price': Price,
        'Discountable': Discountable,
        'ErrorMessage': ErrorMessage
    });

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

// @DataContract
class GetPOSTotalsResponse extends BaseResponse implements IConvertible
{
    // @DataMember
    double? SubTotal;

    // @DataMember
    double? TaxTotal;

    // @DataMember
    double? Total;

    // @DataMember
    List<PosResponseItem>? Items;

    GetPOSTotalsResponse({this.SubTotal,this.TaxTotal,this.Total,this.Items});
    GetPOSTotalsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        SubTotal = JsonConverters.toDouble(json['SubTotal']);
        TaxTotal = JsonConverters.toDouble(json['TaxTotal']);
        Total = JsonConverters.toDouble(json['Total']);
        Items = JsonConverters.fromJson(json['Items'],'List<PosResponseItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'SubTotal': SubTotal,
        'TaxTotal': TaxTotal,
        'Total': Total,
        'Items': JsonConverters.toJson(Items,'List<PosResponseItem>',context!)
    });

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

/**
* In development, not yet for public use.
*/
// @DataContract
class GetPOSTotalsRequest extends BaseSecureRequest implements IConvertible
{
    // @DataMember
    int? Acct;

    // @DataMember
    int? LocId;

    // @DataMember
    int? TaxId;

    // @DataMember
    List<PosLineItem>? Items;

    /**
    * MANUAL, BLANKET_PERCENT, BLANKET_AMOUNT, BACK_INTO_TOTAL, or BACK_INTO_TOTAL_WITH_TAX. Defaults to Manual. No line item discounts can be set unless this is MANUAL.
    */
    // @DataMember
    // @ApiMember(Description="MANUAL, BLANKET_PERCENT, BLANKET_AMOUNT, BACK_INTO_TOTAL, or BACK_INTO_TOTAL_WITH_TAX. Defaults to Manual. No line item discounts can be set unless this is MANUAL.", Name="DiscountMode", ParameterType="query")
    String? DiscountMode;

    // @DataMember
    double? DiscountDetail;

    GetPOSTotalsRequest({this.Acct,this.LocId,this.TaxId,this.Items,this.DiscountMode,this.DiscountDetail});
    GetPOSTotalsRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Acct = json['Acct'];
        LocId = json['LocId'];
        TaxId = json['TaxId'];
        Items = JsonConverters.fromJson(json['Items'],'List<PosLineItem>',context!);
        DiscountMode = json['DiscountMode'];
        DiscountDetail = JsonConverters.toDouble(json['DiscountDetail']);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Acct': Acct,
        'LocId': LocId,
        'TaxId': TaxId,
        'Items': JsonConverters.toJson(Items,'List<PosLineItem>',context!),
        'DiscountMode': DiscountMode,
        'DiscountDetail': DiscountDetail
    });

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

TypeContext _ctx = TypeContext(library: 'active_ewebservice.biz', types: <String, TypeInfo> {
    'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
    'BaseSecureRequest': TypeInfo(TypeOf.Class, create:() => BaseSecureRequest()),
    'BaseResponseResult': TypeInfo(TypeOf.Class, create:() => BaseResponseResult()),
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'ExceptionInfo': TypeInfo(TypeOf.Class, create:() => ExceptionInfo()),
    'PosLineItem': TypeInfo(TypeOf.Class, create:() => PosLineItem()),
    'PosResponseItem': TypeInfo(TypeOf.Class, create:() => PosResponseItem()),
    'GetPOSTotalsResponse': TypeInfo(TypeOf.Class, create:() => GetPOSTotalsResponse()),
    'List<PosResponseItem>': TypeInfo(TypeOf.Class, create:() => <PosResponseItem>[]),
    'GetPOSTotalsRequest': TypeInfo(TypeOf.Class, create:() => GetPOSTotalsRequest()),
    'List<PosLineItem>': TypeInfo(TypeOf.Class, create:() => <PosLineItem>[]),
});

Dart GetPOSTotalsRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /api/GetPOSTotals HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Acct":0,"LocId":0,"TaxId":0,"Items":[{"SkuPk":0,"SasPk":0,"Sku":"String","Serial":"String","Quantity":0,"ExceptionInfo":{"Barcode":"String","Description":"String","Base64Image":"String","Category":0,"SubCategory":0},"Discount":0,"NicsCat":0,"NicsSub":0,"PriceOverride":0,"AllowPriceOverrideToIgnoreMinPrice":false,"Notes":"String"}],"DiscountMode":"String","DiscountDetail":0,"Token":"String","DeviceId":"String","AppId":"String","ApiKey":"String","OAuthToken":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"SubTotal":0,"TaxTotal":0,"Total":0,"Items":[{"PriceEach":0,"Price":0,"Discountable":false,"ErrorMessage":"String","SkuPk":0,"SasPk":0,"Sku":"String","Serial":"String","Quantity":0,"ExceptionInfo":{"Barcode":"String","Description":"String","Base64Image":"String","Category":0,"SubCategory":0},"Discount":0,"NicsCat":0,"NicsSub":0,"PriceOverride":0,"AllowPriceOverrideToIgnoreMinPrice":false,"Notes":"String"}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}