Trendsic Platform Service

<back to all web services

QboTaxProbeRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/qbo/taxcodes
<?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 QboTaxCodeInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Id=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var string|null */
        public ?string $Description=null
    ) {
    }

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

class QboTaxProbeResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $LikelyAst=null,
        /** @var string|null */
        public ?string $Country=null,
        /** @var string|null */
        public ?string $CompanyName=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var array<QboTaxCodeInfo>|null */
        public ?array $TaxCodes=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['LikelyAst'])) $this->LikelyAst = $o['LikelyAst'];
        if (isset($o['Country'])) $this->Country = $o['Country'];
        if (isset($o['CompanyName'])) $this->CompanyName = $o['CompanyName'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['TaxCodes'])) $this->TaxCodes = JsonConverters::fromArray('QboTaxCodeInfo', $o['TaxCodes']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->LikelyAst)) $o['LikelyAst'] = $this->LikelyAst;
        if (isset($this->Country)) $o['Country'] = $this->Country;
        if (isset($this->CompanyName)) $o['CompanyName'] = $this->CompanyName;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->TaxCodes)) $o['TaxCodes'] = JsonConverters::toArray('QboTaxCodeInfo', $this->TaxCodes);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class QboTaxProbeRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP QboTaxProbeRequest 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 /v1/qbo/taxcodes HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	LikelyAst: False,
	Country: String,
	CompanyName: String,
	Message: String,
	TaxCodes: 
	[
		{
			Id: String,
			Name: String,
			Active: False,
			Description: String
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}