Richemont.Booster2.PublicApi

<back to all web services

GetCatalog

Requires Authentication
The following routes are available for this service:
GET/purchase/catalogGet a list of purchasable articles for the given Pos and Brand
<?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 Article implements JsonSerializable
{
    public function __construct(
        /** @description Reference ID / Code of the Article */
        // @ApiMember(Description="Reference ID / Code of the Article", IsRequired=true)
        /** @var string */
        public string $articleCode='',

        /** @description Price of the article */
        // @ApiMember(Description="Price of the article", IsRequired=true)
        /** @var float */
        public float $price=0.0,

        /** @description Currency of the price of the article */
        // @ApiMember(Description="Currency of the price of the article", IsRequired=true)
        /** @var string */
        public string $currency=''
    ) {
    }

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

class GetCatalogResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<Article>|null */
        public ?array $articles=null
    ) {
    }

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

class GetCatalog implements JsonSerializable
{
    public function __construct(
        /** @description POS Legacy */
        // @ApiMember(Description="POS Legacy", IsRequired=true)
        /** @var string */
        public string $posCode='',

        /** @description Brand Trigram of the POS */
        // @ApiMember(Description="Brand Trigram 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['brand'])) $this->brand = $o['brand'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->posCode)) $o['posCode'] = $this->posCode;
        if (isset($this->brand)) $o['brand'] = $this->brand;
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetCatalog 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 /purchase/catalog HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	
}