BokaMera.API.Host

<back to all web services

GetEAccountingSettingsQuery

The following routes are available for this service:
GET/eaccounting/settings
<?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};


class EAccountingSettingsQueryResponse implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $CompanyId=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var string|null */
        public ?string $DefaultArticle6PercentVat=null,
        /** @var float */
        public float $DefaultArticle12PercentVat=0.0,
        /** @var float */
        public float $DefaultArticle25PercentVat=0.0,
        /** @var string|null */
        public ?string $DefaultCreateType=null,
        /** @var string|null */
        public ?string $DefaultTermsOfPaymentId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['DefaultArticle6PercentVat'])) $this->DefaultArticle6PercentVat = $o['DefaultArticle6PercentVat'];
        if (isset($o['DefaultArticle12PercentVat'])) $this->DefaultArticle12PercentVat = $o['DefaultArticle12PercentVat'];
        if (isset($o['DefaultArticle25PercentVat'])) $this->DefaultArticle25PercentVat = $o['DefaultArticle25PercentVat'];
        if (isset($o['DefaultCreateType'])) $this->DefaultCreateType = $o['DefaultCreateType'];
        if (isset($o['DefaultTermsOfPaymentId'])) $this->DefaultTermsOfPaymentId = $o['DefaultTermsOfPaymentId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->DefaultArticle6PercentVat)) $o['DefaultArticle6PercentVat'] = $this->DefaultArticle6PercentVat;
        if (isset($this->DefaultArticle12PercentVat)) $o['DefaultArticle12PercentVat'] = $this->DefaultArticle12PercentVat;
        if (isset($this->DefaultArticle25PercentVat)) $o['DefaultArticle25PercentVat'] = $this->DefaultArticle25PercentVat;
        if (isset($this->DefaultCreateType)) $o['DefaultCreateType'] = $this->DefaultCreateType;
        if (isset($this->DefaultTermsOfPaymentId)) $o['DefaultTermsOfPaymentId'] = $this->DefaultTermsOfPaymentId;
        return empty($o) ? new class(){} : $o;
    }
}

class GetEAccountingSettingsQuery implements ICompany, JsonSerializable
{
    public function __construct(
        /** @description E-Accounting settings company Id. */
        // @ApiMember(Description="E-Accounting settings company Id.")
        /** @var string|null */
        public ?string $CompanyId=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['CompanyId'])) $this->CompanyId = $o['CompanyId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->CompanyId)) $o['CompanyId'] = $this->CompanyId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetEAccountingSettingsQuery 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/settings HTTP/1.1 
Host: api.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"CompanyId":"00000000-0000-0000-0000-000000000000","Active":false,"DefaultArticle6PercentVat":"String","DefaultArticle12PercentVat":0,"DefaultArticle25PercentVat":0,"DefaultCreateType":"String","DefaultTermsOfPaymentId":"String"}