POST | /customer | Create customer | Create CRM customer |
---|
"use strict";
export class Email {
/** @param {{email?:string,isMainEmail?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Email */
email;
/**
* @type {boolean}
* @description Main email */
isMainEmail;
}
export class Phone {
/** @param {{phone?:string,countryPrefix?:string,phoneType?:string,isMainPhone?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456 */
phone;
/**
* @type {string}
* @description Prefix Country Id e.g. it, fr, az */
countryPrefix;
/**
* @type {string}
* @description Phone type e.g. 'Home', 'Mobile', 'Work', 'Other', 'Secondary Address' */
phoneType;
/**
* @type {boolean}
* @description Main Phone */
isMainPhone;
}
export class Address {
/** @param {{addressType?:string,countryId?:string,houseNumber?:string,stateId?:string,city?:string,zipCode?:string,street?:string,street2?:string,street3?:string,street4?:string,street5?:string,isMainAddress?:boolean,poBox?:string,additionalInformation?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Address type e.g. Home, Office, Shipping */
addressType;
/**
* @type {string}
* @description Country Id e.g. it, cn, az, gb, de */
countryId;
/**
* @type {string}
* @description House Number */
houseNumber;
/**
* @type {string}
* @description Region/State */
stateId;
/**
* @type {string}
* @description City Name */
city;
/**
* @type {string}
* @description Postal Code */
zipCode;
/**
* @type {string}
* @description Street Name and Number */
street;
/**
* @type {string}
* @description Street 2 */
street2;
/**
* @type {string}
* @description Street 3 */
street3;
/**
* @type {string}
* @description Street 4 */
street4;
/**
* @type {string}
* @description Street 5 */
street5;
/**
* @type {boolean}
* @description Main Address */
isMainAddress;
/**
* @type {string}
* @description Post Office Box */
poBox;
/**
* @type {string}
* @description Additional Information */
additionalInformation;
}
export class Event {
/** @param {{eventType?:string,eventDate?:string,eventNotes?:string,eventOtherName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Event type e.g. 'Birthday', 'Wedding', 'Anniversary', 'Barmitza', 'Other' */
eventType;
/**
* @type {string}
* @description Event date e.g. '2021-01-20' */
eventDate;
/**
* @type {string}
* @description Event notes */
eventNotes;
/**
* @type {string}
* @description Event other name */
eventOtherName;
}
export class Interest {
/** @param {{interest?:string,sapInterestId?:string,translation?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Interest description */
interest;
/**
* @type {string}
* @description SAP Interest ID, e.g. 'CA-1' */
sapInterestId;
/**
* @type {string}
* @description Interest description translation */
translation;
}
export class Hobby {
/** @param {{hobby?:string,sapHobbyId?:string,translation?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Hobby description */
hobby;
/**
* @type {string}
* @description SAP Hobby ID, e.g. 'ART' */
sapHobbyId;
/**
* @type {string}
* @description Hobby description translation */
translation;
}
export class ProductCollection {
/** @param {{productCollection?:string,sapProductCollectionId?:string,translation?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Product Collection description */
productCollection;
/**
* @type {string}
* @description SAP ProductCollection ID, e.g. 'CA-1' */
sapProductCollectionId;
/**
* @type {string}
* @description Product Collection description translation */
translation;
}
export class Customer {
/** @param {{title?:string,firstName?:string,lastName?:string,firstNameNotLatin?:string,lastNameNotLatin?:string,middleName?:string,nameSuffix?:string,canBeContactedByMaison?:boolean,clientType?:string,companyName?:string,languageId?:string,gender?:string,countryId?:string,birthDate?:string,customerReference?:string,posCode?:string,brand?:string,weddingDate?:string,preferredContactMethod?:string,contactByEmailFlag?:boolean,contactByMailFlag?:boolean,contactByPhoneFlag?:boolean,contactBySMSFlag?:boolean,contactBySocialMediaFlag?:boolean,saleRepresentativeEmail?:string,allowStoreDataAbroad?:boolean,tvAllowStoreDataAbroad?:boolean,emails?:Email[],phones?:Phone[],addresses?:Address[],events?:Event[],interests?:Interest[],hobbies?:Hobby[],productCollections?:ProductCollection[],dataSharingConsent?:boolean,notes?:string,referenceSaleRepresentativeEmail?:string,registrationDate?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Title e.g. 'Mr & Mrs', 'Mr.', 'Mrs.', 'Sama', 'Captain' - Mandatory only when customer type is 'PRIVATE' */
title;
/**
* @type {string}
* @description First Name */
firstName;
/**
* @type {string}
* @description Last Name - Mandatory only when customer type is 'PRIVATE' */
lastName;
/**
* @type {string}
* @description First Name Not Latin */
firstNameNotLatin;
/**
* @type {string}
* @description Last Name Not Latin */
lastNameNotLatin;
/**
* @type {string}
* @description Middle Name */
middleName;
/**
* @type {string}
* @description Name Suffix */
nameSuffix;
/**
* @type {boolean}
* @description Can be Contacted by Maison e.g. true or false */
canBeContactedByMaison;
/**
* @type {string}
* @description Customer Type e.g. 'PRIVATE' or 'COMPANY' */
clientType;
/**
* @type {string}
* @description Company Name - Mandatory only when customer type is 'COMPANY' */
companyName;
/**
* @type {string}
* @description Language Id e.g. ita, chi, aze, eng, ger - Mandatory only when customer type is 'PRIVATE' */
languageId;
/**
* @type {string}
* @description Gender e.g. M, F - Mandatory only when customer type is 'PRIVATE' */
gender;
/**
* @type {string}
* @description Country Id e.g. it, cn, az, gb, de */
countryId;
/**
* @type {?string}
* @description Birth Date e.g. '2020-12-30' */
birthDate;
/**
* @type {string}
* @description Customer reference */
customerReference;
/**
* @type {string}
* @description POS Code e.g. ES100:102048 */
posCode;
/**
* @type {string}
* @description Brand e.g. CAR, MTB */
brand;
/**
* @type {?string}
* @description Wedding Date, e.g. '2020-01-18' */
weddingDate;
/**
* @type {string}
* @description Preferred Contact Method e.g. 'Fax', 'Tel', 'EMail', 'Mail', 'Survey' */
preferredContactMethod;
/**
* @type {boolean}
* @description Provide 'true' if you want to be contacted by email. Leave empty or 'false' if you do not. */
contactByEmailFlag;
/**
* @type {boolean}
* @description Provide 'true' if you want to be contacted by mail. Leave empty or 'false' if you do not. */
contactByMailFlag;
/**
* @type {boolean}
* @description Provide 'true' if you want to be contacted by phone. Leave empty or 'false' if you do not. */
contactByPhoneFlag;
/**
* @type {boolean}
* @description Provide 'true' if you want to be contacted by SMS. Leave empty or 'false' if you do not. */
contactBySMSFlag;
/**
* @type {boolean}
* @description Provide 'true' if you want to be contacted by social media. Leave empty or 'false' if you do not. */
contactBySocialMediaFlag;
/**
* @type {string}
* @description Sale Representative Email e.g. rauf.aliyev@richemont.com */
saleRepresentativeEmail;
/**
* @type {?boolean}
* @description Consent for allowing Cross Border Data Transfer */
allowStoreDataAbroad;
/**
* @type {?boolean}
* @description Consent for allowing Cross Border Data Transfer For TimeVallée */
tvAllowStoreDataAbroad;
/**
* @type {Email[]}
* @description Customer emails */
emails;
/**
* @type {Phone[]}
* @description Customer phones */
phones;
/**
* @type {Address[]}
* @description Customer addresses */
addresses;
/**
* @type {Event[]}
* @description Customer events */
events;
/**
* @type {Interest[]}
* @description Customer interests */
interests;
/**
* @type {Hobby[]}
* @description Customer hobbies */
hobbies;
/**
* @type {ProductCollection[]}
* @description Customer product collections */
productCollections;
/**
* @type {?boolean}
* @description Provide 'true' if you allow data sharing consent. Leave empty or 'false' if you do not. */
dataSharingConsent;
/**
* @type {string}
* @description Notes */
notes;
/**
* @type {string}
* @description Reference Sale Representative Email */
referenceSaleRepresentativeEmail;
/**
* @type {?string}
* @description Registration Date */
registrationDate;
}
export class CreateCustomerResponse {
/** @param {{boosterCustomerId?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description Booster Customer ID */
boosterCustomerId;
}
export class CreateCustomer extends Customer {
/** @param {{privacyPolicyAcceptanceStorage?:boolean,tvPrivacyPolicyAcceptanceStorage?:boolean,title?:string,firstName?:string,lastName?:string,firstNameNotLatin?:string,lastNameNotLatin?:string,middleName?:string,nameSuffix?:string,canBeContactedByMaison?:boolean,clientType?:string,companyName?:string,languageId?:string,gender?:string,countryId?:string,birthDate?:string,customerReference?:string,posCode?:string,brand?:string,weddingDate?:string,preferredContactMethod?:string,contactByEmailFlag?:boolean,contactByMailFlag?:boolean,contactByPhoneFlag?:boolean,contactBySMSFlag?:boolean,contactBySocialMediaFlag?:boolean,saleRepresentativeEmail?:string,allowStoreDataAbroad?:boolean,tvAllowStoreDataAbroad?:boolean,emails?:Email[],phones?:Phone[],addresses?:Address[],events?:Event[],interests?:Interest[],hobbies?:Hobby[],productCollections?:ProductCollection[],dataSharingConsent?:boolean,notes?:string,referenceSaleRepresentativeEmail?:string,registrationDate?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {boolean}
* @description Privacy policy acceptance for data storage */
privacyPolicyAcceptanceStorage;
/**
* @type {?boolean}
* @description Privacy policy acceptance of data storage for TimeVallée */
tvPrivacyPolicyAcceptanceStorage;
}
JavaScript CreateCustomer DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customer HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"privacyPolicyAcceptanceStorage":false,"tvPrivacyPolicyAcceptanceStorage":false,"title":"String","firstName":"String","lastName":"String","firstNameNotLatin":"String","lastNameNotLatin":"String","middleName":"String","nameSuffix":"String","canBeContactedByMaison":false,"clientType":"String","companyName":"String","languageId":"String","gender":"String","countryId":"String","birthDate":"\/Date(-62135596800000-0000)\/","customerReference":"String","posCode":"String","brand":"String","weddingDate":"\/Date(-62135596800000-0000)\/","preferredContactMethod":"String","contactByEmailFlag":false,"contactByMailFlag":false,"contactByPhoneFlag":false,"contactBySMSFlag":false,"contactBySocialMediaFlag":false,"saleRepresentativeEmail":"String","allowStoreDataAbroad":false,"tvAllowStoreDataAbroad":false,"emails":[{"email":"String","isMainEmail":false}],"phones":[{"phone":"String","countryPrefix":"String","phoneType":"String","isMainPhone":false}],"addresses":[{"addressType":"String","countryId":"String","houseNumber":"String","stateId":"String","city":"String","zipCode":"String","street":"String","street2":"String","street3":"String","street4":"String","street5":"String","isMainAddress":false,"poBox":"String","additionalInformation":"String"}],"events":[{"eventType":"String","eventDate":"\/Date(-62135596800000-0000)\/","eventNotes":"String","eventOtherName":"String"}],"interests":[{"interest":"String","sapInterestId":"String","translation":"String"}],"hobbies":[{"hobby":"String","sapHobbyId":"String","translation":"String"}],"productCollections":[{"productCollection":"String","sapProductCollectionId":"String","translation":"String"}],"dataSharingConsent":false,"notes":"String","referenceSaleRepresentativeEmail":"String","registrationDate":"\/Date(-62135596800000-0000)\/"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"boosterCustomerId":0}