BokaMera.API.Host

<back to all web services

QuerySummarizedInvoices

Requires Authentication
The following routes are available for this service:
GET/eaccounting/summarizedinvoicesList summarized invoices with optional filtersQuery summarized invoices by company, customer, date range, and status.
import 'package:servicestack/servicestack.dart';

class SummarizedInvoiceDetailResponse implements IConvertible
{
    String Id = "";
    String CompanyId = "";
    String CustomerId = "";
    String CustomerName = "";
    String? EAccountingInvoiceId;
    bool Draft;
    DateTime DateFrom = DateTime(0);
    DateTime DateTo = DateTime(0);
    int? ServiceId;
    int Status = 0;
    String StatusName = "";
    String? ErrorMessage;
    List<int> BookingIds = [];
    DateTime CreatedDate = DateTime(0);
    DateTime UpdatedDate = DateTime(0);

    SummarizedInvoiceDetailResponse({this.Id,this.CompanyId,this.CustomerId,this.CustomerName,this.EAccountingInvoiceId,this.Draft,this.DateFrom,this.DateTo,this.ServiceId,this.Status,this.StatusName,this.ErrorMessage,this.BookingIds,this.CreatedDate,this.UpdatedDate});
    SummarizedInvoiceDetailResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        CompanyId = json['CompanyId'];
        CustomerId = json['CustomerId'];
        CustomerName = json['CustomerName'];
        EAccountingInvoiceId = json['EAccountingInvoiceId'];
        Draft = json['Draft'];
        DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
        DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
        ServiceId = json['ServiceId'];
        Status = json['Status'];
        StatusName = json['StatusName'];
        ErrorMessage = json['ErrorMessage'];
        BookingIds = JsonConverters.fromJson(json['BookingIds'],'List<int>',context!);
        CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
        UpdatedDate = JsonConverters.fromJson(json['UpdatedDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'CompanyId': CompanyId,
        'CustomerId': CustomerId,
        'CustomerName': CustomerName,
        'EAccountingInvoiceId': EAccountingInvoiceId,
        'Draft': Draft,
        'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
        'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!),
        'ServiceId': ServiceId,
        'Status': Status,
        'StatusName': StatusName,
        'ErrorMessage': ErrorMessage,
        'BookingIds': JsonConverters.toJson(BookingIds,'List<int>',context!),
        'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
        'UpdatedDate': JsonConverters.toJson(UpdatedDate,'DateTime',context!)
    };

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

class QuerySummarizedInvoicesResponse implements IConvertible
{
    List<SummarizedInvoiceDetailResponse> Results = [];
    ResponseStatus ResponseStatus;

    QuerySummarizedInvoicesResponse({this.Results,this.ResponseStatus});
    QuerySummarizedInvoicesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

enum SummarizedInvoiceStatus
{
    Pending,
    Processing,
    Completed,
    Failed,
}

// @ValidateRequest(Validator="IsAuthenticated")
class QuerySummarizedInvoices implements ICompany, IConvertible
{
    /**
    * The company id, if empty will use the company id for the user you are logged in with.
    */
    // @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
    String? CompanyId;

    /**
    * Filter by customer id.
    */
    // @ApiMember(Description="Filter by customer id.")
    String? CustomerId;

    /**
    * Filter by date from.
    */
    // @ApiMember(Description="Filter by date from.")
    DateTime? DateFrom;

    /**
    * Filter by date to.
    */
    // @ApiMember(Description="Filter by date to.")
    DateTime? DateTo;

    /**
    * Filter by status (0=Pending, 1=Processing, 2=Completed, 3=Failed).
    */
    // @ApiMember(Description="Filter by status (0=Pending, 1=Processing, 2=Completed, 3=Failed).")
    SummarizedInvoiceStatus? Status;

    QuerySummarizedInvoices({this.CompanyId,this.CustomerId,this.DateFrom,this.DateTo,this.Status});
    QuerySummarizedInvoices.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        CustomerId = json['CustomerId'];
        DateFrom = JsonConverters.fromJson(json['DateFrom'],'DateTime',context!);
        DateTo = JsonConverters.fromJson(json['DateTo'],'DateTime',context!);
        Status = JsonConverters.fromJson(json['Status'],'SummarizedInvoiceStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'CustomerId': CustomerId,
        'DateFrom': JsonConverters.toJson(DateFrom,'DateTime',context!),
        'DateTo': JsonConverters.toJson(DateTo,'DateTime',context!),
        'Status': JsonConverters.toJson(Status,'SummarizedInvoiceStatus',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'SummarizedInvoiceDetailResponse': TypeInfo(TypeOf.Class, create:() => SummarizedInvoiceDetailResponse()),
    'QuerySummarizedInvoicesResponse': TypeInfo(TypeOf.Class, create:() => QuerySummarizedInvoicesResponse()),
    'List<SummarizedInvoiceDetailResponse>': TypeInfo(TypeOf.Class, create:() => <SummarizedInvoiceDetailResponse>[]),
    'SummarizedInvoiceStatus': TypeInfo(TypeOf.Enum, enumValues:SummarizedInvoiceStatus.values),
    'QuerySummarizedInvoices': TypeInfo(TypeOf.Class, create:() => QuerySummarizedInvoices()),
});

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

GET /eaccounting/summarizedinvoices HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"Results":[{"CustomerName":"String","EAccountingInvoiceId":"String","Draft":false,"ServiceId":0,"Status":0,"StatusName":"String","ErrorMessage":"String","BookingIds":[0]}],"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}