Richemont.Booster2.PublicApi

<back to all web services

ExportCustomer

Requires Authentication
The following routes are available for this service:
POST/customer/{brand}/exportExport Customer Data
<?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 GetCustomerInterest implements JsonSerializable
{
    public function __construct(
        /** @description Interest description */
        // @ApiMember(Description="Interest description", IsRequired=true)
        /** @var string */
        public string $interest='',

        /** @description SAP Interest ID, e.g. 'CA-1' */
        // @ApiMember(Description="SAP Interest ID, e.g. 'CA-1'", IsRequired=true)
        /** @var string */
        public string $sapInterestId=''
    ) {
    }

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

class GetCustomerHobby implements JsonSerializable
{
    public function __construct(
        /** @description Hobby description */
        // @ApiMember(Description="Hobby description")
        /** @var string|null */
        public ?string $hobby=null,

        /** @description SAP Hobby ID, e.g. 'ART' */
        // @ApiMember(Description="SAP Hobby ID, e.g. 'ART'")
        /** @var string|null */
        public ?string $sapHobbyId=null
    ) {
    }

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

class GetCustomerProductCollection implements JsonSerializable
{
    public function __construct(
        /** @description Product Collection description */
        // @ApiMember(Description="Product Collection description", IsRequired=true)
        /** @var string */
        public string $productCollection='',

        /** @description SAP ProductCollection ID, e.g. 'CA-1' */
        // @ApiMember(Description="SAP ProductCollection ID, e.g. 'CA-1'", IsRequired=true)
        /** @var string */
        public string $sapProductCollectionId=''
    ) {
    }

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

class ProductCategory implements JsonSerializable
{
    public function __construct(
        /** @description Brand Category ID */
        // @ApiMember(Description="Brand Category ID")
        /** @var string|null */
        public ?string $brandCategoryId=null,

        /** @description Grand Category ID */
        // @ApiMember(Description="Grand Category ID", IsRequired=true)
        /** @var string */
        public string $grandCategoryId='',

        /** @description Master Category ID */
        // @ApiMember(Description="Master Category ID")
        /** @var string|null */
        public ?string $masterCategoryId=null,

        /** @description Category ID */
        // @ApiMember(Description="Category ID")
        /** @var string|null */
        public ?string $categoryId=null,

        /** @description Sub Category ID */
        // @ApiMember(Description="Sub Category ID")
        /** @var string|null */
        public ?string $subCategoryId=null
    ) {
    }

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

class SearchCustomer implements JsonSerializable
{
    public function __construct(
        /** @description Brand */
        // @ApiMember(Description="Brand", IsRequired=true)
        /** @var string */
        public string $brand='',

        /** @description POS Legacy */
        // @ApiMember(Description="POS Legacy", IsRequired=true)
        /** @var array<string>|null */
        public ?array $posCodes=null,

        /** @description Search key could be: 'Name', 'Email', 'Phone' without prefix, 'BoosterCustomerId' OR 'SapCRMId' */
        // @ApiMember(Description="Search key could be: 'Name', 'Email', 'Phone' without prefix, 'BoosterCustomerId' OR 'SapCRMId'")
        /** @var string|null */
        public ?string $searchKey=null,

        /** @description Search by phone number - exact match */
        // @ApiMember(Description="Search by phone number - exact match")
        /** @var string|null */
        public ?string $phoneNumber=null,

        /** @description Search by email address - exact match */
        // @ApiMember(Description="Search by email address - exact match")
        /** @var string|null */
        public ?string $email=null,

        /** @description Values can be 'it', 'en' etc. */
        // @ApiMember(Description="Values can be 'it', 'en' etc.")
        /** @var array<string>|null */
        public ?array $locationCountryIds=null,

        /** @description Client Spending From e.g. '100' */
        // @ApiMember(Description="Client Spending From e.g. '100'")
        /** @var float|null */
        public ?float $clientSpendingFrom=null,

        /** @description Client Spending To e.g. '50000' */
        // @ApiMember(Description="Client Spending To e.g. '50000'")
        /** @var float|null */
        public ?float $clientSpendingTo=null,

        /** @description Customer Creation Date From e.g. '2022-01-01' */
        // @ApiMember(Description="Customer Creation Date From e.g. '2022-01-01'")
        /** @var DateTime|null */
        public ?DateTime $creationDateFrom=null,

        /** @description Customer Creation Date To e.g. '2023-11-01' */
        // @ApiMember(Description="Customer Creation Date To e.g. '2023-11-01'")
        /** @var DateTime|null */
        public ?DateTime $creationDateTo=null,

        /** @description Transaction Date From e.g. '2022-01-01' */
        // @ApiMember(Description="Transaction Date From e.g. '2022-01-01'")
        /** @var DateTime|null */
        public ?DateTime $transactionDateFrom=null,

        /** @description Transaction Date To e.g. '2023-11-01' */
        // @ApiMember(Description="Transaction Date To e.g. '2023-11-01'")
        /** @var DateTime|null */
        public ?DateTime $transactionDateTo=null,

        /** @description Values can be 'true' or 'false' */
        // @ApiMember(Description="Values can be 'true' or 'false'")
        /** @var bool|null */
        public ?bool $canBeContactedByMaison=null,

        /** @description Values can be 1 for 'January', 2 for 'February', 3 for 'March', 4 for 'April', 5 for 'May', 6 for 'June', 7 for 'July', 8 for 'August', 9 for 'September', 10 for 'October', 11 for 'November', 12 for 'December' */
        // @ApiMember(Description="Values can be 1 for 'January', 2 for 'February', 3 for 'March', 4 for 'April', 5 for 'May', 6 for 'June', 7 for 'July', 8 for 'August', 9 for 'September', 10 for 'October', 11 for 'November', 12 for 'December'")
        /** @var array<int>|null */
        public ?array $birthdateMonths=null,

        /** @description Customer interest filter */
        // @ApiMember(Description="Customer interest filter")
        /** @var array<GetCustomerInterest>|null */
        public ?array $interests=null,

        /** @description Customer hobby filter */
        // @ApiMember(Description="Customer hobby filter")
        /** @var array<GetCustomerHobby>|null */
        public ?array $hobbies=null,

        /** @description Customer product collection filter */
        // @ApiMember(Description="Customer product collection filter")
        /** @var array<GetCustomerProductCollection>|null */
        public ?array $productCollections=null,

        /** @description Customer Status e.g. 'Prospect', 'Client' */
        // @ApiMember(Description="Customer Status e.g. 'Prospect', 'Client'")
        /** @var array<string>|null */
        public ?array $customerStatus=null,

        /** @description List of BoosterCustomerIds, e.g. 1234567,1231231,12323423 */
        // @ApiMember(Description="List of BoosterCustomerIds, e.g. 1234567,1231231,12323423")
        /** @var array<int>|null */
        public ?array $boosterCustomerIds=null,

        /** @description Values can be 'true' or 'false' */
        // @ApiMember(Description="Values can be 'true' or 'false'")
        /** @var bool|null */
        public ?bool $hasSapCrmError=null,

        /** @description Product Categories */
        // @ApiMember(Description="Product Categories")
        /** @var array<ProductCategory>|null */
        public ?array $productCategories=null,

        /** @description Sale Reprentative Emails */
        // @ApiMember(Description="Sale Reprentative Emails")
        /** @var array<string>|null */
        public ?array $saleRepresentativeEmails=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['brand'])) $this->brand = $o['brand'];
        if (isset($o['posCodes'])) $this->posCodes = JsonConverters::fromArray('string', $o['posCodes']);
        if (isset($o['searchKey'])) $this->searchKey = $o['searchKey'];
        if (isset($o['phoneNumber'])) $this->phoneNumber = $o['phoneNumber'];
        if (isset($o['email'])) $this->email = $o['email'];
        if (isset($o['locationCountryIds'])) $this->locationCountryIds = JsonConverters::fromArray('string', $o['locationCountryIds']);
        if (isset($o['clientSpendingFrom'])) $this->clientSpendingFrom = $o['clientSpendingFrom'];
        if (isset($o['clientSpendingTo'])) $this->clientSpendingTo = $o['clientSpendingTo'];
        if (isset($o['creationDateFrom'])) $this->creationDateFrom = JsonConverters::from('DateTime', $o['creationDateFrom']);
        if (isset($o['creationDateTo'])) $this->creationDateTo = JsonConverters::from('DateTime', $o['creationDateTo']);
        if (isset($o['transactionDateFrom'])) $this->transactionDateFrom = JsonConverters::from('DateTime', $o['transactionDateFrom']);
        if (isset($o['transactionDateTo'])) $this->transactionDateTo = JsonConverters::from('DateTime', $o['transactionDateTo']);
        if (isset($o['canBeContactedByMaison'])) $this->canBeContactedByMaison = $o['canBeContactedByMaison'];
        if (isset($o['birthdateMonths'])) $this->birthdateMonths = JsonConverters::fromArray('int', $o['birthdateMonths']);
        if (isset($o['interests'])) $this->interests = JsonConverters::fromArray('GetCustomerInterest', $o['interests']);
        if (isset($o['hobbies'])) $this->hobbies = JsonConverters::fromArray('GetCustomerHobby', $o['hobbies']);
        if (isset($o['productCollections'])) $this->productCollections = JsonConverters::fromArray('GetCustomerProductCollection', $o['productCollections']);
        if (isset($o['customerStatus'])) $this->customerStatus = JsonConverters::fromArray('string', $o['customerStatus']);
        if (isset($o['boosterCustomerIds'])) $this->boosterCustomerIds = JsonConverters::fromArray('int', $o['boosterCustomerIds']);
        if (isset($o['hasSapCrmError'])) $this->hasSapCrmError = $o['hasSapCrmError'];
        if (isset($o['productCategories'])) $this->productCategories = JsonConverters::fromArray('ProductCategory', $o['productCategories']);
        if (isset($o['saleRepresentativeEmails'])) $this->saleRepresentativeEmails = JsonConverters::fromArray('string', $o['saleRepresentativeEmails']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->brand)) $o['brand'] = $this->brand;
        if (isset($this->posCodes)) $o['posCodes'] = JsonConverters::toArray('string', $this->posCodes);
        if (isset($this->searchKey)) $o['searchKey'] = $this->searchKey;
        if (isset($this->phoneNumber)) $o['phoneNumber'] = $this->phoneNumber;
        if (isset($this->email)) $o['email'] = $this->email;
        if (isset($this->locationCountryIds)) $o['locationCountryIds'] = JsonConverters::toArray('string', $this->locationCountryIds);
        if (isset($this->clientSpendingFrom)) $o['clientSpendingFrom'] = $this->clientSpendingFrom;
        if (isset($this->clientSpendingTo)) $o['clientSpendingTo'] = $this->clientSpendingTo;
        if (isset($this->creationDateFrom)) $o['creationDateFrom'] = JsonConverters::to('DateTime', $this->creationDateFrom);
        if (isset($this->creationDateTo)) $o['creationDateTo'] = JsonConverters::to('DateTime', $this->creationDateTo);
        if (isset($this->transactionDateFrom)) $o['transactionDateFrom'] = JsonConverters::to('DateTime', $this->transactionDateFrom);
        if (isset($this->transactionDateTo)) $o['transactionDateTo'] = JsonConverters::to('DateTime', $this->transactionDateTo);
        if (isset($this->canBeContactedByMaison)) $o['canBeContactedByMaison'] = $this->canBeContactedByMaison;
        if (isset($this->birthdateMonths)) $o['birthdateMonths'] = JsonConverters::toArray('int', $this->birthdateMonths);
        if (isset($this->interests)) $o['interests'] = JsonConverters::toArray('GetCustomerInterest', $this->interests);
        if (isset($this->hobbies)) $o['hobbies'] = JsonConverters::toArray('GetCustomerHobby', $this->hobbies);
        if (isset($this->productCollections)) $o['productCollections'] = JsonConverters::toArray('GetCustomerProductCollection', $this->productCollections);
        if (isset($this->customerStatus)) $o['customerStatus'] = JsonConverters::toArray('string', $this->customerStatus);
        if (isset($this->boosterCustomerIds)) $o['boosterCustomerIds'] = JsonConverters::toArray('int', $this->boosterCustomerIds);
        if (isset($this->hasSapCrmError)) $o['hasSapCrmError'] = $this->hasSapCrmError;
        if (isset($this->productCategories)) $o['productCategories'] = JsonConverters::toArray('ProductCategory', $this->productCategories);
        if (isset($this->saleRepresentativeEmails)) $o['saleRepresentativeEmails'] = JsonConverters::toArray('string', $this->saleRepresentativeEmails);
        return empty($o) ? new class(){} : $o;
    }
}

class ExportCustomerResponse implements JsonSerializable
{
    public function __construct(
        /** @description Unique Identifier of the Export Request created */
        // @ApiMember(Description="Unique Identifier of the Export Request created", IsRequired=true)
        /** @var string */
        public string $asyncTaskId=''
    ) {
    }

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

class ExportCustomer extends SearchCustomer implements JsonSerializable
{
    /**
     * @param string $brand
     * @param array<string>|null $posCodes
     * @param string|null $searchKey
     * @param string|null $phoneNumber
     * @param string|null $email
     * @param array<string>|null $locationCountryIds
     * @param float|null $clientSpendingFrom
     * @param float|null $clientSpendingTo
     * @param DateTime|null $creationDateFrom
     * @param DateTime|null $creationDateTo
     * @param DateTime|null $transactionDateFrom
     * @param DateTime|null $transactionDateTo
     * @param bool|null $canBeContactedByMaison
     * @param array<int>|null $birthdateMonths
     * @param array<GetCustomerInterest>|null $interests
     * @param array<GetCustomerHobby>|null $hobbies
     * @param array<GetCustomerProductCollection>|null $productCollections
     * @param array<string>|null $customerStatus
     * @param array<int>|null $boosterCustomerIds
     * @param bool|null $hasSapCrmError
     * @param array<ProductCategory>|null $productCategories
     * @param array<string>|null $saleRepresentativeEmails
     */
    public function __construct(
        string $brand='',
        ?array $posCodes=null,
        ?string $searchKey=null,
        ?string $phoneNumber=null,
        ?string $email=null,
        ?array $locationCountryIds=null,
        ?float $clientSpendingFrom=null,
        ?float $clientSpendingTo=null,
        ?DateTime $creationDateFrom=null,
        ?DateTime $creationDateTo=null,
        ?DateTime $transactionDateFrom=null,
        ?DateTime $transactionDateTo=null,
        ?bool $canBeContactedByMaison=null,
        ?array $birthdateMonths=null,
        ?array $interests=null,
        ?array $hobbies=null,
        ?array $productCollections=null,
        ?array $customerStatus=null,
        ?array $boosterCustomerIds=null,
        ?bool $hasSapCrmError=null,
        ?array $productCategories=null,
        ?array $saleRepresentativeEmails=null,
        /** @description Export Request ID of the API Consumers */
        // @ApiMember(Description="Export Request ID of the API Consumers", IsRequired=true)
        /** @var string */
        public string $downloadRequestId=''
    ) {
        parent::__construct($brand,$posCodes,$searchKey,$phoneNumber,$email,$locationCountryIds,$clientSpendingFrom,$clientSpendingTo,$creationDateFrom,$creationDateTo,$transactionDateFrom,$transactionDateTo,$canBeContactedByMaison,$birthdateMonths,$interests,$hobbies,$productCollections,$customerStatus,$boosterCustomerIds,$hasSapCrmError,$productCategories,$saleRepresentativeEmails);
    }

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

PHP ExportCustomer 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.

POST /customer/{brand}/export HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"downloadRequestId":"String","brand":"String","posCodes":["String"],"searchKey":"String","phoneNumber":"String","email":"String","locationCountryIds":["String"],"clientSpendingFrom":0,"clientSpendingTo":0,"creationDateFrom":"\/Date(-62135596800000-0000)\/","creationDateTo":"\/Date(-62135596800000-0000)\/","transactionDateFrom":"\/Date(-62135596800000-0000)\/","transactionDateTo":"\/Date(-62135596800000-0000)\/","canBeContactedByMaison":false,"birthdateMonths":[0],"interests":[{"interest":"String","sapInterestId":"String"}],"hobbies":[{"hobby":"String","sapHobbyId":"String"}],"productCollections":[{"productCollection":"String","sapProductCollectionId":"String"}],"customerStatus":["String"],"boosterCustomerIds":[0],"hasSapCrmError":false,"productCategories":[{"brandCategoryId":"String","grandCategoryId":"String","masterCategoryId":"String","categoryId":"String","subCategoryId":"String"}],"saleRepresentativeEmails":["String"]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"asyncTaskId":"00000000000000000000000000000000"}