| POST | /customer/{brand}/{elevateCustomerId}/grantElevateConsent | Update Elevate customer consent to 'Approved' | Currently the API sets Elevate customer consent only to 'Approved' status |
|---|
<?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 GrantElevateConsentResponse implements JsonSerializable
{
public function __construct(
/** @description Salesforce Standard ID */
// @ApiMember(Description="Salesforce Standard ID", IsRequired=true)
/** @var string */
public string $salesforceStandardId=''
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['salesforceStandardId'])) $this->salesforceStandardId = $o['salesforceStandardId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->salesforceStandardId)) $o['salesforceStandardId'] = $this->salesforceStandardId;
return empty($o) ? new class(){} : $o;
}
}
class GrantElevateConsent implements JsonSerializable
{
public function __construct(
/** @description Elevate customer ID */
// @ApiMember(Description="Elevate customer ID")
/** @var string|null */
public ?string $elevateCustomerId=null,
/** @description POS Legacy */
// @ApiMember(Description="POS Legacy", IsRequired=true)
/** @var string */
public string $posCode='',
/** @description Brand e.g. CAR, MTB */
// @ApiMember(Description="Brand e.g. CAR, MTB", IsRequired=true)
/** @var string */
public string $brand='',
/** @description Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456. Email or full phone required */
// @ApiMember(Description="Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456. Email or full phone required")
/** @var string|null */
public ?string $phone=null,
/** @description Prefix Country Id e.g. it, fr, az. Email or full phone required */
// @ApiMember(Description="Prefix Country Id e.g. it, fr, az. Email or full phone required")
/** @var string|null */
public ?string $phoneCountryPrefix=null,
/** @description Customer email. Email or full phone required */
// @ApiMember(Description="Customer email. Email or full phone required")
/** @var string|null */
public ?string $email=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['elevateCustomerId'])) $this->elevateCustomerId = $o['elevateCustomerId'];
if (isset($o['posCode'])) $this->posCode = $o['posCode'];
if (isset($o['brand'])) $this->brand = $o['brand'];
if (isset($o['phone'])) $this->phone = $o['phone'];
if (isset($o['phoneCountryPrefix'])) $this->phoneCountryPrefix = $o['phoneCountryPrefix'];
if (isset($o['email'])) $this->email = $o['email'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->elevateCustomerId)) $o['elevateCustomerId'] = $this->elevateCustomerId;
if (isset($this->posCode)) $o['posCode'] = $this->posCode;
if (isset($this->brand)) $o['brand'] = $this->brand;
if (isset($this->phone)) $o['phone'] = $this->phone;
if (isset($this->phoneCountryPrefix)) $o['phoneCountryPrefix'] = $this->phoneCountryPrefix;
if (isset($this->email)) $o['email'] = $this->email;
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.
POST /customer/{brand}/{elevateCustomerId}/grantElevateConsent HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GrantElevateConsent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel">
<brand>String</brand>
<elevateCustomerId>String</elevateCustomerId>
<email>String</email>
<phone>String</phone>
<phoneCountryPrefix>String</phoneCountryPrefix>
<posCode>String</posCode>
</GrantElevateConsent>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <GrantElevateConsentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel"> <salesforceStandardId>String</salesforceStandardId> </GrantElevateConsentResponse>