AIM Web Services

<back to all web services

SaleInfoRequest

SaleInfo
Requires active-e Inventory Service

The following routes are available for this service:
GET/api/SaleInfo
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 DiscountFromPriceLevel implements IConvertible
{
    // @DataMember
    String? BasePriceLevel;

    // @DataMember
    double? DisountPercentage;

    DiscountFromPriceLevel({this.BasePriceLevel,this.DisountPercentage});
    DiscountFromPriceLevel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BasePriceLevel = json['BasePriceLevel'];
        DisountPercentage = JsonConverters.toDouble(json['DisountPercentage']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BasePriceLevel': BasePriceLevel,
        'DisountPercentage': DisountPercentage
    };

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

// @DataContract
class RecurringSaleDay implements IConvertible
{
    // @DataMember
    String? Weekday;

    // @DataMember
    int? BeginHour;

    // @DataMember
    int? BeginMinute;

    // @DataMember
    int? EndHour;

    // @DataMember
    int? EndMinute;

    RecurringSaleDay({this.Weekday,this.BeginHour,this.BeginMinute,this.EndHour,this.EndMinute});
    RecurringSaleDay.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Weekday = json['Weekday'];
        BeginHour = json['BeginHour'];
        BeginMinute = json['BeginMinute'];
        EndHour = json['EndHour'];
        EndMinute = json['EndMinute'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Weekday': Weekday,
        'BeginHour': BeginHour,
        'BeginMinute': BeginMinute,
        'EndHour': EndHour,
        'EndMinute': EndMinute
    };

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

// @DataContract
class RecurringSaleInfo implements IConvertible
{
    // @DataMember
    List<RecurringSaleDay>? Days;

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

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

    Map<String, dynamic> toJson() => {
        'Days': JsonConverters.toJson(Days,'List<RecurringSaleDay>',context!)
    };

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

// @DataContract
class SaleRecord implements IConvertible
{
    // @DataMember
    int? SadPk;

    // @DataMember
    int? SkuPk;

    // @DataMember
    int? SaqPk;

    // @DataMember
    String? Model;

    // @DataMember
    String? SKU;

    // @DataMember
    int? LocationId;

    // @DataMember
    DateTime? StartDate;

    // @DataMember
    DateTime? EndDate;

    // @DataMember
    int? CustomerAccount;

    // @DataMember
    int? CustomerDefaultId;

    // @DataMember
    String? Condition;

    // @DataMember
    DiscountFromPriceLevel? DiscountFromPriceLevel;

    // @DataMember
    String? DiscountByPriceLevel;

    // @DataMember
    double? DiscountBySetPrice;

    // @DataMember
    double? DiscountByAmount;

    // @DataMember
    RecurringSaleInfo? RecurringSale;

    SaleRecord({this.SadPk,this.SkuPk,this.SaqPk,this.Model,this.SKU,this.LocationId,this.StartDate,this.EndDate,this.CustomerAccount,this.CustomerDefaultId,this.Condition,this.DiscountFromPriceLevel,this.DiscountByPriceLevel,this.DiscountBySetPrice,this.DiscountByAmount,this.RecurringSale});
    SaleRecord.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SadPk = json['SadPk'];
        SkuPk = json['SkuPk'];
        SaqPk = json['SaqPk'];
        Model = json['Model'];
        SKU = json['SKU'];
        LocationId = json['LocationId'];
        StartDate = JsonConverters.fromJson(json['StartDate'],'DateTime',context!);
        EndDate = JsonConverters.fromJson(json['EndDate'],'DateTime',context!);
        CustomerAccount = json['CustomerAccount'];
        CustomerDefaultId = json['CustomerDefaultId'];
        Condition = json['Condition'];
        DiscountFromPriceLevel = JsonConverters.fromJson(json['DiscountFromPriceLevel'],'DiscountFromPriceLevel',context!);
        DiscountByPriceLevel = json['DiscountByPriceLevel'];
        DiscountBySetPrice = JsonConverters.toDouble(json['DiscountBySetPrice']);
        DiscountByAmount = JsonConverters.toDouble(json['DiscountByAmount']);
        RecurringSale = JsonConverters.fromJson(json['RecurringSale'],'RecurringSaleInfo',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SadPk': SadPk,
        'SkuPk': SkuPk,
        'SaqPk': SaqPk,
        'Model': Model,
        'SKU': SKU,
        'LocationId': LocationId,
        'StartDate': JsonConverters.toJson(StartDate,'DateTime',context!),
        'EndDate': JsonConverters.toJson(EndDate,'DateTime',context!),
        'CustomerAccount': CustomerAccount,
        'CustomerDefaultId': CustomerDefaultId,
        'Condition': Condition,
        'DiscountFromPriceLevel': JsonConverters.toJson(DiscountFromPriceLevel,'DiscountFromPriceLevel',context!),
        'DiscountByPriceLevel': DiscountByPriceLevel,
        'DiscountBySetPrice': DiscountBySetPrice,
        'DiscountByAmount': DiscountByAmount,
        'RecurringSale': JsonConverters.toJson(RecurringSale,'RecurringSaleInfo',context!)
    };

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

// @DataContract
class SaleInfoResponse extends BaseResponse implements IConvertible
{
    // @DataMember
    List<SaleRecord>? SaleRecords;

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

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'SaleRecords': JsonConverters.toJson(SaleRecords,'List<SaleRecord>',context!)
    });

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

/**
* SaleInfoRequires active-e Inventory Service
*/
// @DataContract
class SaleInfoRequest extends BaseSecureRequest implements IConvertible
{
    // @DataMember
    int? LocationId;

    /**
    * If sent, only sales that are active during the sent Date/Time are returned. Otherwise, the current Date/Time is used
    */
    // @DataMember
    // @ApiMember(Description="If sent, only sales that are active during the sent Date/Time are returned. Otherwise, the current Date/Time is used", Name="DateTime")
    DateTime? DateTime;

    SaleInfoRequest({this.LocationId,this.DateTime});
    SaleInfoRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'LocationId': LocationId,
        'DateTime': JsonConverters.toJson(DateTime,'DateTime',context!)
    });

    getTypeName() => "SaleInfoRequest";
    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()),
    'DiscountFromPriceLevel': TypeInfo(TypeOf.Class, create:() => DiscountFromPriceLevel()),
    'RecurringSaleDay': TypeInfo(TypeOf.Class, create:() => RecurringSaleDay()),
    'RecurringSaleInfo': TypeInfo(TypeOf.Class, create:() => RecurringSaleInfo()),
    'List<RecurringSaleDay>': TypeInfo(TypeOf.Class, create:() => <RecurringSaleDay>[]),
    'SaleRecord': TypeInfo(TypeOf.Class, create:() => SaleRecord()),
    'SaleInfoResponse': TypeInfo(TypeOf.Class, create:() => SaleInfoResponse()),
    'List<SaleRecord>': TypeInfo(TypeOf.Class, create:() => <SaleRecord>[]),
    'SaleInfoRequest': TypeInfo(TypeOf.Class, create:() => SaleInfoRequest()),
});

Dart SaleInfoRequest 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.

GET /api/SaleInfo HTTP/1.1 
Host: active-ewebservice.biz 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SaleInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
  <Status>
    <DomainName>String</DomainName>
    <ErrorCode>String</ErrorCode>
    <ErrorDisplayText>String</ErrorDisplayText>
    <ErrorMessage>String</ErrorMessage>
    <IpAddress>String</IpAddress>
    <Login>String</Login>
    <StatusCode>String</StatusCode>
  </Status>
  <SaleRecords>
    <SaleRecord>
      <Condition>String</Condition>
      <CustomerAccount>0</CustomerAccount>
      <CustomerDefaultId>0</CustomerDefaultId>
      <DiscountByAmount>0</DiscountByAmount>
      <DiscountByPriceLevel>String</DiscountByPriceLevel>
      <DiscountBySetPrice>0</DiscountBySetPrice>
      <DiscountFromPriceLevel>
        <BasePriceLevel>String</BasePriceLevel>
        <DisountPercentage>0</DisountPercentage>
      </DiscountFromPriceLevel>
      <EndDate>0001-01-01T00:00:00</EndDate>
      <LocationId>0</LocationId>
      <Model>String</Model>
      <RecurringSale>
        <Days>
          <RecurringSaleDay>
            <BeginHour>0</BeginHour>
            <BeginMinute>0</BeginMinute>
            <EndHour>0</EndHour>
            <EndMinute>0</EndMinute>
            <Weekday>String</Weekday>
          </RecurringSaleDay>
        </Days>
      </RecurringSale>
      <SKU>String</SKU>
      <SadPk>0</SadPk>
      <SaqPk>0</SaqPk>
      <SkuPk>0</SkuPk>
      <StartDate>0001-01-01T00:00:00</StartDate>
    </SaleRecord>
  </SaleRecords>
</SaleInfoResponse>