BokaMera.API.Host

<back to all web services

GetVossCustomerInvoiceBalance

The following routes are available for this service:
GET/voss/invoice/balanceget voss invoice
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


enum SortDirectionEnum : string
{
    case Ascending = 'Ascending';
    case Descending = 'Descending';
}

class VossPagination implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $SearchText=null,
        /** @var int */
        public int $PageIndex=0,
        /** @var int */
        public int $PageSize=0,
        /** @var string|null */
        public ?string $SortField=null,
        /** @var SortDirectionEnum|null */
        public ?SortDirectionEnum $SortDirection=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['SearchText'])) $this->SearchText = $o['SearchText'];
        if (isset($o['PageIndex'])) $this->PageIndex = $o['PageIndex'];
        if (isset($o['PageSize'])) $this->PageSize = $o['PageSize'];
        if (isset($o['SortField'])) $this->SortField = $o['SortField'];
        if (isset($o['SortDirection'])) $this->SortDirection = JsonConverters::from('SortDirectionEnum', $o['SortDirection']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->SearchText)) $o['SearchText'] = $this->SearchText;
        if (isset($this->PageIndex)) $o['PageIndex'] = $this->PageIndex;
        if (isset($this->PageSize)) $o['PageSize'] = $this->PageSize;
        if (isset($this->SortField)) $o['SortField'] = $this->SortField;
        if (isset($this->SortDirection)) $o['SortDirection'] = JsonConverters::to('SortDirectionEnum', $this->SortDirection);
        return empty($o) ? new class(){} : $o;
    }
}

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
class GetVossCustomerInvoiceBalance extends VossPagination implements JsonSerializable
{
    /**
     * @param string|null $SearchText
     * @param int $PageIndex
     * @param int $PageSize
     * @param string|null $SortField
     * @param SortDirectionEnum|null $SortDirection
     */
    public function __construct(
        ?string $SearchText=null,
        int $PageIndex=0,
        int $PageSize=0,
        ?string $SortField=null,
        ?SortDirectionEnum $SortDirection=null,
        /** @description 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.")
        /** @var string|null */
        public ?string $CompanyId=null,

        /** @description Controls up to which point of time transactions are included in invoice, can be set to any date, if not provided current UTC time will be used instead */
        // @ApiMember(Description="Controls up to which point of time transactions are included in invoice, can be set to any date, if not provided current UTC time will be used instead")
        /** @var DateTime|null */
        public ?DateTime $InvoiceDate=null,

        /** @description If present the operation will start only after this date */
        // @ApiMember(Description="If present the operation will start only after this date")
        /** @var DateTime|null */
        public ?DateTime $ScheduledStartTime=null,

        /** @description Optional CRON expression for recurring operations. */
        // @ApiMember(Description="Optional CRON expression for recurring operations.")
        /** @var string|null */
        public ?string $RecurringSchedule=null
    ) {
        parent::__construct($SearchText,$PageIndex,$PageSize,$SortField,$SortDirection);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['InvoiceDate'])) $this->InvoiceDate = JsonConverters::from('DateTime', $o['InvoiceDate']);
        if (isset($o['ScheduledStartTime'])) $this->ScheduledStartTime = JsonConverters::from('DateTime', $o['ScheduledStartTime']);
        if (isset($o['RecurringSchedule'])) $this->RecurringSchedule = $o['RecurringSchedule'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->InvoiceDate)) $o['InvoiceDate'] = JsonConverters::to('DateTime', $this->InvoiceDate);
        if (isset($this->ScheduledStartTime)) $o['ScheduledStartTime'] = JsonConverters::to('DateTime', $this->ScheduledStartTime);
        if (isset($this->RecurringSchedule)) $o['RecurringSchedule'] = $this->RecurringSchedule;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetVossCustomerInvoiceBalance 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 /voss/invoice/balance HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />