Richemont.Booster2.PublicApi

<back to all web services

GetCustomer

Requires Authentication
The following routes are available for this service:
GET/customer/{boosterCustomerId}Get customer detailsGet Customer info based on the Booster Customer ID
<?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 CustomerEmail implements JsonSerializable
{
    public function __construct(
        /** @description Description */
        // @ApiMember(Description="Description", IsRequired=true)
        /** @var string */
        public string $description='',

        /** @description Email Address */
        // @ApiMember(Description="Email Address", IsRequired=true)
        /** @var string */
        public string $email='',

        /** @description Is main email address */
        // @ApiMember(Description="Is main email address", IsRequired=true)
        /** @var bool|null */
        public ?bool $isMain=null
    ) {
    }

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

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

        /** @description Phone Number */
        // @ApiMember(Description="Phone Number", IsRequired=true)
        /** @var string */
        public string $phone='',

        /** @description Is main phone number  */
        // @ApiMember(Description="Is main phone number ", IsRequired=true)
        /** @var bool|null */
        public ?bool $isMain=null,

        /** @description Phone number country prefix */
        // @ApiMember(Description="Phone number country prefix", IsRequired=true)
        /** @var string */
        public string $prefixCountryId='',

        /** @description Telephone prefix */
        // @ApiMember(Description="Telephone prefix", IsRequired=true)
        /** @var string */
        public string $telephonePrefix=''
    ) {
    }

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

class CustomerEvent implements JsonSerializable
{
    public function __construct(
        /** @description Event Id */
        // @ApiMember(Description="Event Id", IsRequired=true)
        /** @var int */
        public int $eventId=0,

        /** @description Event Description  */
        // @ApiMember(Description="Event Description ", IsRequired=true)
        /** @var string */
        public string $eventDescription='',

        /** @description Event Other */
        // @ApiMember(Description="Event Other", IsRequired=true)
        /** @var string */
        public string $eventTypeOther='',

        /** @description Comment */
        // @ApiMember(Description="Comment", IsRequired=true)
        /** @var string */
        public string $comment='',

        /** @description Event Day */
        // @ApiMember(Description="Event Day", IsRequired=true)
        /** @var int */
        public int $eventDay=0,

        /** @description Event Month */
        // @ApiMember(Description="Event Month", IsRequired=true)
        /** @var int */
        public int $eventMonth=0,

        /** @description Event Year */
        // @ApiMember(Description="Event Year", IsRequired=true)
        /** @var int */
        public int $eventYear=0
    ) {
    }

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

class GetCustomerResponse implements JsonSerializable
{
    public function __construct(
        /** @description Booster Customer ID */
        // @ApiMember(Description="Booster Customer ID", IsRequired=true)
        /** @var int */
        public int $id=0,

        /** @description SAP Customer ID */
        // @ApiMember(Description="SAP Customer ID", IsRequired=true)
        /** @var string */
        public string $sapId='',

        /** @description Customer Reference */
        // @ApiMember(Description="Customer Reference", IsRequired=true)
        /** @var string */
        public string $customerReference='',

        /** @description Gender */
        // @ApiMember(Description="Gender", IsRequired=true)
        /** @var string */
        public string $gender='',

        /** @description Personal Title */
        // @ApiMember(Description="Personal Title", IsRequired=true)
        /** @var string */
        public string $personalTitle='',

        /** @description First Name */
        // @ApiMember(Description="First Name", IsRequired=true)
        /** @var string */
        public string $firstName='',

        /** @description Customer Last Name */
        // @ApiMember(Description="Customer Last Name", IsRequired=true)
        /** @var string */
        public string $lastName='',

        /** @description First Name Not Latin */
        // @ApiMember(Description="First Name Not Latin", IsRequired=true)
        /** @var string */
        public string $firstNameNotLatin='',

        /** @description Customer Last Name Not Latin */
        // @ApiMember(Description="Customer Last Name Not Latin", IsRequired=true)
        /** @var string */
        public string $lastNameNotLatin='',

        /** @description Middle Name */
        // @ApiMember(Description="Middle Name", IsRequired=true)
        /** @var string */
        public string $middleName='',

        /** @description Can be contacted or not? */
        // @ApiMember(Description="Can be contacted or not?", IsRequired=true)
        /** @var bool|null */
        public ?bool $canBeContacted=null,

        /** @description Language */
        // @ApiMember(Description="Language", IsRequired=true)
        /** @var string */
        public string $language='',

        /** @description Country */
        // @ApiMember(Description="Country", IsRequired=true)
        /** @var string */
        public string $countryId='',

        /** @description Brand Trigram */
        // @ApiMember(Description="Brand Trigram", IsRequired=true)
        /** @var string */
        public string $brand='',

        /** @description List of Emails */
        // @ApiMember(Description="List of Emails", IsRequired=true)
        /** @var array<CustomerEmail>|null */
        public ?array $emails=null,

        /** @description List of Phone Numbers */
        // @ApiMember(Description="List of Phone Numbers", IsRequired=true)
        /** @var array<CustomerPhone>|null */
        public ?array $phones=null,

        /** @description List of Events */
        // @ApiMember(Description="List of Events", IsRequired=true)
        /** @var array<CustomerEvent>|null */
        public ?array $events=null,

        /** @description Registration date */
        // @ApiMember(Description="Registration date")
        /** @var DateTime|null */
        public ?DateTime $registrationDate=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['sapId'])) $this->sapId = $o['sapId'];
        if (isset($o['customerReference'])) $this->customerReference = $o['customerReference'];
        if (isset($o['gender'])) $this->gender = $o['gender'];
        if (isset($o['personalTitle'])) $this->personalTitle = $o['personalTitle'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['firstNameNotLatin'])) $this->firstNameNotLatin = $o['firstNameNotLatin'];
        if (isset($o['lastNameNotLatin'])) $this->lastNameNotLatin = $o['lastNameNotLatin'];
        if (isset($o['middleName'])) $this->middleName = $o['middleName'];
        if (isset($o['canBeContacted'])) $this->canBeContacted = $o['canBeContacted'];
        if (isset($o['language'])) $this->language = $o['language'];
        if (isset($o['countryId'])) $this->countryId = $o['countryId'];
        if (isset($o['brand'])) $this->brand = $o['brand'];
        if (isset($o['emails'])) $this->emails = JsonConverters::fromArray('CustomerEmail', $o['emails']);
        if (isset($o['phones'])) $this->phones = JsonConverters::fromArray('CustomerPhone', $o['phones']);
        if (isset($o['events'])) $this->events = JsonConverters::fromArray('CustomerEvent', $o['events']);
        if (isset($o['registrationDate'])) $this->registrationDate = JsonConverters::from('DateTime', $o['registrationDate']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->sapId)) $o['sapId'] = $this->sapId;
        if (isset($this->customerReference)) $o['customerReference'] = $this->customerReference;
        if (isset($this->gender)) $o['gender'] = $this->gender;
        if (isset($this->personalTitle)) $o['personalTitle'] = $this->personalTitle;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->firstNameNotLatin)) $o['firstNameNotLatin'] = $this->firstNameNotLatin;
        if (isset($this->lastNameNotLatin)) $o['lastNameNotLatin'] = $this->lastNameNotLatin;
        if (isset($this->middleName)) $o['middleName'] = $this->middleName;
        if (isset($this->canBeContacted)) $o['canBeContacted'] = $this->canBeContacted;
        if (isset($this->language)) $o['language'] = $this->language;
        if (isset($this->countryId)) $o['countryId'] = $this->countryId;
        if (isset($this->brand)) $o['brand'] = $this->brand;
        if (isset($this->emails)) $o['emails'] = JsonConverters::toArray('CustomerEmail', $this->emails);
        if (isset($this->phones)) $o['phones'] = JsonConverters::toArray('CustomerPhone', $this->phones);
        if (isset($this->events)) $o['events'] = JsonConverters::toArray('CustomerEvent', $this->events);
        if (isset($this->registrationDate)) $o['registrationDate'] = JsonConverters::to('DateTime', $this->registrationDate);
        return empty($o) ? new class(){} : $o;
    }
}

class GetCustomer implements JsonSerializable
{
    public function __construct(
        /** @description Booster Customer ID */
        // @ApiMember(Description="Booster Customer ID", IsRequired=true)
        /** @var int */
        public int $boosterCustomerId=0
    ) {
    }

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

PHP GetCustomer DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /customer/{boosterCustomerId} HTTP/1.1 
Host: dev-api-booster.richemont.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetCustomerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel">
  <brand>String</brand>
  <canBeContacted>false</canBeContacted>
  <countryId>String</countryId>
  <customerReference>String</customerReference>
  <emails>
    <CustomerEmail>
      <description>String</description>
      <email>String</email>
      <isMain>false</isMain>
    </CustomerEmail>
  </emails>
  <events>
    <CustomerEvent>
      <comment>String</comment>
      <eventDay>0</eventDay>
      <eventDescription>String</eventDescription>
      <eventId>0</eventId>
      <eventMonth>0</eventMonth>
      <eventTypeOther>String</eventTypeOther>
      <eventYear>0</eventYear>
    </CustomerEvent>
  </events>
  <firstName>String</firstName>
  <firstNameNotLatin>String</firstNameNotLatin>
  <gender>String</gender>
  <id>0</id>
  <language>String</language>
  <lastName>String</lastName>
  <lastNameNotLatin>String</lastNameNotLatin>
  <middleName>String</middleName>
  <personalTitle>String</personalTitle>
  <phones>
    <CustomerPhone>
      <description>String</description>
      <isMain>false</isMain>
      <phone>String</phone>
      <prefixCountryId>String</prefixCountryId>
      <telephonePrefix>String</telephonePrefix>
    </CustomerPhone>
  </phones>
  <registrationDate>0001-01-01T00:00:00</registrationDate>
  <sapId>String</sapId>
</GetCustomerResponse>