AIM Web Services

<back to all web services

InvoiceDetailRequest

InvoiceDetail
Requires active-e Customer Service.

The following routes are available for this service:
GET/api/InvoiceDetail
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 InvoiceLineItem implements IConvertible
{
    // @DataMember
    double? Quantity;

    // @DataMember
    String? Sku;

    // @DataMember
    String? Description;

    // @DataMember
    double? PriceEach;

    // @DataMember
    double? Extended;

    // @DataMember
    double? Discount;

    // @DataMember
    double? Total;

    // @DataMember
    String? OriginalRef;

    // @DataMember
    String? Notes;

    // @DataMember
    String? Source;

    InvoiceLineItem({this.Quantity,this.Sku,this.Description,this.PriceEach,this.Extended,this.Discount,this.Total,this.OriginalRef,this.Notes,this.Source});
    InvoiceLineItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Quantity = JsonConverters.toDouble(json['Quantity']);
        Sku = json['Sku'];
        Description = json['Description'];
        PriceEach = JsonConverters.toDouble(json['PriceEach']);
        Extended = JsonConverters.toDouble(json['Extended']);
        Discount = JsonConverters.toDouble(json['Discount']);
        Total = JsonConverters.toDouble(json['Total']);
        OriginalRef = json['OriginalRef'];
        Notes = json['Notes'];
        Source = json['Source'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Quantity': Quantity,
        'Sku': Sku,
        'Description': Description,
        'PriceEach': PriceEach,
        'Extended': Extended,
        'Discount': Discount,
        'Total': Total,
        'OriginalRef': OriginalRef,
        'Notes': Notes,
        'Source': Source
    };

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

// @DataContract
class InvoicePaymentItem implements IConvertible
{
    // @DataMember
    String? PayRef;

    // @DataMember
    DateTime? DateTime;

    // @DataMember
    double? Amount;

    // @DataMember
    String? Notes;

    // @DataMember
    String? Source;

    InvoicePaymentItem({this.PayRef,this.DateTime,this.Amount,this.Notes,this.Source});
    InvoicePaymentItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        PayRef = json['PayRef'];
        DateTime = JsonConverters.fromJson(json['DateTime'],'DateTime',context!);
        Amount = JsonConverters.toDouble(json['Amount']);
        Notes = json['Notes'];
        Source = json['Source'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'PayRef': PayRef,
        'DateTime': JsonConverters.toJson(DateTime,'DateTime',context!),
        'Amount': Amount,
        'Notes': Notes,
        'Source': Source
    };

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

// @DataContract
class InvoiceInfo implements IConvertible
{
    // @DataMember
    String? InvoiceNumber;

    // @DataMember
    DateTime? DateTime;

    // @DataMember
    int? SoldToAcct;

    // @DataMember
    String? SoldToName;

    // @DataMember
    int? BillToAcct;

    // @DataMember
    String? BillToName;

    // @DataMember
    String? Type;

    // @DataMember
    String? PO;

    // @DataMember
    double? OriginalAmount;

    // @DataMember
    double? Balance;

    // @DataMember
    String? Location;

    // @DataMember
    String? ShipToName;

    // @DataMember
    String? ShipToAddress;

    // @DataMember
    int? ShipToId;

    // @DataMember
    List<InvoiceLineItem>? LineItems;

    // @DataMember
    List<InvoicePaymentItem>? Payments;

    InvoiceInfo({this.InvoiceNumber,this.DateTime,this.SoldToAcct,this.SoldToName,this.BillToAcct,this.BillToName,this.Type,this.PO,this.OriginalAmount,this.Balance,this.Location,this.ShipToName,this.ShipToAddress,this.ShipToId,this.LineItems,this.Payments});
    InvoiceInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        InvoiceNumber = json['InvoiceNumber'];
        DateTime = JsonConverters.fromJson(json['DateTime'],'DateTime',context!);
        SoldToAcct = json['SoldToAcct'];
        SoldToName = json['SoldToName'];
        BillToAcct = json['BillToAcct'];
        BillToName = json['BillToName'];
        Type = json['Type'];
        PO = json['PO'];
        OriginalAmount = JsonConverters.toDouble(json['OriginalAmount']);
        Balance = JsonConverters.toDouble(json['Balance']);
        Location = json['Location'];
        ShipToName = json['ShipToName'];
        ShipToAddress = json['ShipToAddress'];
        ShipToId = json['ShipToId'];
        LineItems = JsonConverters.fromJson(json['LineItems'],'List<InvoiceLineItem>',context!);
        Payments = JsonConverters.fromJson(json['Payments'],'List<InvoicePaymentItem>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'InvoiceNumber': InvoiceNumber,
        'DateTime': JsonConverters.toJson(DateTime,'DateTime',context!),
        'SoldToAcct': SoldToAcct,
        'SoldToName': SoldToName,
        'BillToAcct': BillToAcct,
        'BillToName': BillToName,
        'Type': Type,
        'PO': PO,
        'OriginalAmount': OriginalAmount,
        'Balance': Balance,
        'Location': Location,
        'ShipToName': ShipToName,
        'ShipToAddress': ShipToAddress,
        'ShipToId': ShipToId,
        'LineItems': JsonConverters.toJson(LineItems,'List<InvoiceLineItem>',context!),
        'Payments': JsonConverters.toJson(Payments,'List<InvoicePaymentItem>',context!)
    };

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

// @DataContract
class InvoiceDetailResponse extends BaseResponse implements IConvertible
{
    // @DataMember
    List<InvoiceInfo>? Invoices;

    // @DataMember
    int? RemainingRecords;

    InvoiceDetailResponse({this.Invoices,this.RemainingRecords});
    InvoiceDetailResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

/**
* InvoiceDetailRequires active-e Customer Service.
*/
// @DataContract
class InvoiceDetailRequest extends BaseSecureRequest implements IConvertible
{
    // @DataMember
    int? Acct;

    // @DataMember
    DateTime? InvoiceStartDate;

    // @DataMember
    DateTime? InvoiceEndDate;

    /**
    * The Starting Offset. Defaults to 0 if not sent.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="The Starting Offset. Defaults to 0 if not sent.", Format="int64", Name="StartOffset")
    int? StartOffset;

    /**
    * The # of records to be returned. Defaults to 100 if not sent.
    */
    // @DataMember
    // @ApiMember(DataType="integer", Description="The # of records to be returned. Defaults to 100 if not sent.", Format="int64", Name="RecordCount")
    int? RecordCount;

    /**
    * The Invoice Ref# to be looked up. If sent, do not send WebRef, Acct, InvoiceStartDate, InvoiceEndDate, StartOffset, or RecordCount
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="The Invoice Ref# to be looked up. If sent, do not send WebRef, Acct, InvoiceStartDate, InvoiceEndDate, StartOffset, or RecordCount", Name="AIMRef")
    String? AIMRef;

    /**
    * The WebRef to be looked up. If sent, do not send AIMRef, Acct, InvoiceStartDate, InvoiceEndDate, StartOffset, or RecordCount
    */
    // @DataMember
    // @ApiMember(DataType="string", Description="The WebRef to be looked up. If sent, do not send AIMRef, Acct, InvoiceStartDate, InvoiceEndDate, StartOffset, or RecordCount", Name="WebRef")
    String? WebRef;

    InvoiceDetailRequest({this.Acct,this.InvoiceStartDate,this.InvoiceEndDate,this.StartOffset,this.RecordCount,this.AIMRef,this.WebRef});
    InvoiceDetailRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        Acct = json['Acct'];
        InvoiceStartDate = JsonConverters.fromJson(json['InvoiceStartDate'],'DateTime',context!);
        InvoiceEndDate = JsonConverters.fromJson(json['InvoiceEndDate'],'DateTime',context!);
        StartOffset = json['StartOffset'];
        RecordCount = json['RecordCount'];
        AIMRef = json['AIMRef'];
        WebRef = json['WebRef'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'Acct': Acct,
        'InvoiceStartDate': JsonConverters.toJson(InvoiceStartDate,'DateTime',context!),
        'InvoiceEndDate': JsonConverters.toJson(InvoiceEndDate,'DateTime',context!),
        'StartOffset': StartOffset,
        'RecordCount': RecordCount,
        'AIMRef': AIMRef,
        'WebRef': WebRef
    });

    getTypeName() => "InvoiceDetailRequest";
    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()),
    'InvoiceLineItem': TypeInfo(TypeOf.Class, create:() => InvoiceLineItem()),
    'InvoicePaymentItem': TypeInfo(TypeOf.Class, create:() => InvoicePaymentItem()),
    'InvoiceInfo': TypeInfo(TypeOf.Class, create:() => InvoiceInfo()),
    'List<InvoiceLineItem>': TypeInfo(TypeOf.Class, create:() => <InvoiceLineItem>[]),
    'List<InvoicePaymentItem>': TypeInfo(TypeOf.Class, create:() => <InvoicePaymentItem>[]),
    'InvoiceDetailResponse': TypeInfo(TypeOf.Class, create:() => InvoiceDetailResponse()),
    'List<InvoiceInfo>': TypeInfo(TypeOf.Class, create:() => <InvoiceInfo>[]),
    'InvoiceDetailRequest': TypeInfo(TypeOf.Class, create:() => InvoiceDetailRequest()),
});

Dart InvoiceDetailRequest DTOs

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

HTTP + OTHER

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

GET /api/InvoiceDetail HTTP/1.1 
Host: active-ewebservice.biz 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Invoices":[{"InvoiceNumber":"String","SoldToAcct":0,"SoldToName":"String","BillToAcct":0,"BillToName":"String","Type":"String","PO":"String","OriginalAmount":0,"Balance":0,"Location":"String","ShipToName":"String","ShipToAddress":"String","ShipToId":0,"LineItems":[{"Quantity":0,"Sku":"String","Description":"String","PriceEach":0,"Extended":0,"Discount":0,"Total":0,"OriginalRef":"String","Notes":"String","Source":"String"}],"Payments":[{"PayRef":"String","Amount":0,"Notes":"String","Source":"String"}]}],"RemainingRecords":0,"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}