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 Foundation
import ServiceStack

// @ValidateRequest(Validator="IsAuthenticated")
public class QuerySummarizedInvoices : ICompany, Codable
{
    /**
    * 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.")
    public var companyId:String?

    /**
    * Filter by customer id.
    */
    // @ApiMember(Description="Filter by customer id.")
    public var customerId:String?

    /**
    * Filter by date from.
    */
    // @ApiMember(Description="Filter by date from.")
    public var dateFrom:Date?

    /**
    * Filter by date to.
    */
    // @ApiMember(Description="Filter by date to.")
    public var dateTo:Date?

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

    required public init(){}
}

public enum SummarizedInvoiceStatus : String, Codable
{
    case Pending
    case Processing
    case Completed
    case Failed
}

public class QuerySummarizedInvoicesResponse : Codable
{
    public var results:[SummarizedInvoiceDetailResponse] = []
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class SummarizedInvoiceDetailResponse : Codable
{
    public var id:String
    public var companyId:String
    public var customerId:String
    public var customerName:String
    public var eAccountingInvoiceId:String
    public var draft:Bool
    public var dateFrom:Date
    public var dateTo:Date
    public var serviceId:Int?
    public var status:Int
    public var statusName:String
    public var errorMessage:String
    public var bookingIds:[Int] = []
    public var createdDate:Date
    public var updatedDate:Date

    required public init(){}
}


Swift QuerySummarizedInvoices DTOs

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

HTTP + JSV

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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
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
		}
	}
}