| GET | /purchase/pos | Get a list of authorized pos that can place orders |
|---|
<?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 Pos implements JsonSerializable
{
public function __construct(
/** @description POS Code */
// @ApiMember(Description="POS Code", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Name of the POS */
// @ApiMember(Description="Name of the POS", IsRequired=true)
/** @var string */
public string $name='',
/** @description City of the POS */
// @ApiMember(Description="City of the POS", IsRequired=true)
/** @var string */
public string $city='',
/** @description Address of the POS */
// @ApiMember(Description="Address of the POS", IsRequired=true)
/** @var string */
public string $address='',
/** @description Country of the POS */
// @ApiMember(Description="Country of the POS", IsRequired=true)
/** @var string */
public string $country='',
/** @description Brand of the POS */
// @ApiMember(Description="Brand of the POS", IsRequired=true)
/** @var string */
public string $brand=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['name'])) $this->name = $o['name'];
if (isset($o['city'])) $this->city = $o['city'];
if (isset($o['address'])) $this->address = $o['address'];
if (isset($o['country'])) $this->country = $o['country'];
if (isset($o['brand'])) $this->brand = $o['brand'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->name)) $o['name'] = $this->name;
if (isset($this->city)) $o['city'] = $this->city;
if (isset($this->address)) $o['address'] = $this->address;
if (isset($this->country)) $o['country'] = $this->country;
if (isset($this->brand)) $o['brand'] = $this->brand;
return empty($o) ? new class(){} : $o;
}
}
class GetPurchasablePosResponse implements JsonSerializable
{
public function __construct(
/** @description Index of the result set returnedr */
// @ApiMember(Description="Index of the result set returnedr", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Total amount of pages / result sets */
// @ApiMember(Description="Total amount of pages / result sets", IsRequired=true)
/** @var int */
public int $totalPages=0,
/** @description Total amount of results */
// @ApiMember(Description="Total amount of results", IsRequired=true)
/** @var int */
public int $totalResults=0,
/** @description List of Pos */
// @ApiMember(Description="List of Pos", IsRequired=true)
/** @var array<Pos>|null */
public ?array $elements=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['totalPages'])) $this->totalPages = $o['totalPages'];
if (isset($o['totalResults'])) $this->totalResults = $o['totalResults'];
if (isset($o['elements'])) $this->elements = JsonConverters::fromArray('Pos', $o['elements']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->totalPages)) $o['totalPages'] = $this->totalPages;
if (isset($this->totalResults)) $o['totalResults'] = $this->totalResults;
if (isset($this->elements)) $o['elements'] = JsonConverters::toArray('Pos', $this->elements);
return empty($o) ? new class(){} : $o;
}
}
class GetPurchasablePos implements IPagedRequest, JsonSerializable
{
public function __construct(
/** @description Index of the result set returned */
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
/** @var int */
public int $page=0,
/** @description Size of the result set returned */
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
/** @var int */
public int $items=0,
/** @description Omit precise record count - save on performance */
// @ApiMember(Description="Omit precise record count - save on performance")
/** @var bool|null */
public ?bool $noCount=null,
/** @description Sorting expression */
// @ApiMember(Description="Sorting expression")
/** @var string|null */
public ?string $sortBy=null,
/** @description Brand Trigram */
// @ApiMember(Description="Brand Trigram", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Brand Context ID */
// @ApiMember(Description="Brand Context ID")
/** @var string|null */
public ?string $boosterContextId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['page'])) $this->page = $o['page'];
if (isset($o['items'])) $this->items = $o['items'];
if (isset($o['noCount'])) $this->noCount = $o['noCount'];
if (isset($o['sortBy'])) $this->sortBy = $o['sortBy'];
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['boosterContextId'])) $this->boosterContextId = $o['boosterContextId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->page)) $o['page'] = $this->page;
if (isset($this->items)) $o['items'] = $this->items;
if (isset($this->noCount)) $o['noCount'] = $this->noCount;
if (isset($this->sortBy)) $o['sortBy'] = $this->sortBy;
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->boosterContextId)) $o['boosterContextId'] = $this->boosterContextId;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /purchase/pos HTTP/1.1 Host: dev-api-booster.richemont.com Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GetPurchasablePosResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Purchase.ServiceModel"> <elements i:nil="true" /> <items>0</items> <page>0</page> <totalPages>0</totalPages> <totalResults>0</totalResults> </GetPurchasablePosResponse>