| PATCH | /customer/{boosterCustomerId} | Patch customer | Patch CRM customer |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Email:
# @ApiMember(Description="Email", IsRequired=true)
email: Optional[str] = None
"""
Email
"""
# @ApiMember(Description="Main email", IsRequired=true)
is_main_email: bool = False
"""
Main email
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Phone:
# @ApiMember(Description="Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456", IsRequired=true)
phone: Optional[str] = None
"""
Phone e.g. cn: 13888889999, jp: 352858088, kr: 023123456
"""
# @ApiMember(Description="Prefix Country Id e.g. it, fr, az", IsRequired=true)
country_prefix: Optional[str] = None
"""
Prefix Country Id e.g. it, fr, az
"""
# @ApiMember(Description="Phone type e.g. 'Home', 'Mobile', 'Work', 'Other', 'Secondary Address'")
phone_type: Optional[str] = None
"""
Phone type e.g. 'Home', 'Mobile', 'Work', 'Other', 'Secondary Address'
"""
# @ApiMember(Description="Main Phone", IsRequired=true)
is_main_phone: bool = False
"""
Main Phone
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Address:
# @ApiMember(Description="Address type e.g. Home, Office, Shipping", IsRequired=true)
address_type: Optional[str] = None
"""
Address type e.g. Home, Office, Shipping
"""
# @ApiMember(Description="Country Id e.g. it, cn, az, gb, de", IsRequired=true)
country_id: Optional[str] = None
"""
Country Id e.g. it, cn, az, gb, de
"""
# @ApiMember(Description="House Number")
house_number: Optional[str] = None
"""
House Number
"""
# @ApiMember(Description="Region/State")
state_id: Optional[str] = None
"""
Region/State
"""
# @ApiMember(Description="City Name")
city: Optional[str] = None
"""
City Name
"""
# @ApiMember(Description="Postal Code")
zip_code: Optional[str] = None
"""
Postal Code
"""
# @ApiMember(Description="Street Name and Number")
street: Optional[str] = None
"""
Street Name and Number
"""
# @ApiMember(Description="Street 2")
street2: Optional[str] = None
"""
Street 2
"""
# @ApiMember(Description="Street 3")
street3: Optional[str] = None
"""
Street 3
"""
# @ApiMember(Description="Street 4")
street4: Optional[str] = None
"""
Street 4
"""
# @ApiMember(Description="Street 5")
street5: Optional[str] = None
"""
Street 5
"""
# @ApiMember(Description="Main Address", IsRequired=true)
is_main_address: bool = False
"""
Main Address
"""
# @ApiMember(Description="Post Office Box")
po_box: Optional[str] = None
"""
Post Office Box
"""
# @ApiMember(Description="Additional Information")
additional_information: Optional[str] = None
"""
Additional Information
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Event:
# @ApiMember(Description="Event type e.g. 'Birthday', 'Wedding', 'Anniversary', 'Barmitza', 'Other'", IsRequired=true)
event_type: Optional[str] = None
"""
Event type e.g. 'Birthday', 'Wedding', 'Anniversary', 'Barmitza', 'Other'
"""
# @ApiMember(Description="Event date e.g. '2021-01-20'", IsRequired=true)
event_date: datetime.datetime = datetime.datetime(1, 1, 1)
"""
Event date e.g. '2021-01-20'
"""
# @ApiMember(Description="Event notes")
event_notes: Optional[str] = None
"""
Event notes
"""
# @ApiMember(Description="Event other name")
event_other_name: Optional[str] = None
"""
Event other name
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Interest:
# @ApiMember(Description="Interest description", IsRequired=true)
interest: Optional[str] = None
"""
Interest description
"""
# @ApiMember(Description="SAP Interest ID, e.g. 'CA-1'", IsRequired=true)
sap_interest_id: Optional[str] = None
"""
SAP Interest ID, e.g. 'CA-1'
"""
# @ApiMember(Description="Interest description translation")
translation: Optional[str] = None
"""
Interest description translation
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Hobby:
# @ApiMember(Description="Hobby description", IsRequired=true)
hobby: Optional[str] = None
"""
Hobby description
"""
# @ApiMember(Description="SAP Hobby ID, e.g. 'ART'", IsRequired=true)
sap_hobby_id: Optional[str] = None
"""
SAP Hobby ID, e.g. 'ART'
"""
# @ApiMember(Description="Hobby description translation")
translation: Optional[str] = None
"""
Hobby description translation
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProductCollection:
# @ApiMember(Description="Product Collection description", IsRequired=true)
product_collection: Optional[str] = None
"""
Product Collection description
"""
# @ApiMember(Description="SAP ProductCollection ID, e.g. 'CA-1'", IsRequired=true)
sap_product_collection_id: Optional[str] = None
"""
SAP ProductCollection ID, e.g. 'CA-1'
"""
# @ApiMember(Description="Product Collection description translation", IsRequired=true)
translation: Optional[str] = None
"""
Product Collection description translation
"""
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PatchCustomer:
# @ApiMember(Description="Booster customer Id", IsRequired=true)
booster_customer_id: int = 0
"""
Booster customer Id
"""
# @ApiMember(Description="Title e.g. 'Mr & Mrs', 'Mr.', 'Mrs.', 'Sama', 'Captain' - Mandatory only when customer type is 'Personal'")
title: Optional[str] = None
"""
Title e.g. 'Mr & Mrs', 'Mr.', 'Mrs.', 'Sama', 'Captain' - Mandatory only when customer type is 'Personal'
"""
# @ApiMember(Description="First Name")
first_name: Optional[str] = None
"""
First Name
"""
# @ApiMember(Description="Last Name - Mandatory only when customer type is 'Personal'")
last_name: Optional[str] = None
"""
Last Name - Mandatory only when customer type is 'Personal'
"""
# @ApiMember(Description="First Name Not Latin")
first_name_not_latin: Optional[str] = None
"""
First Name Not Latin
"""
# @ApiMember(Description="Last Name Not Latin")
last_name_not_latin: Optional[str] = None
"""
Last Name Not Latin
"""
# @ApiMember(Description="Middle Name")
middle_name: Optional[str] = None
"""
Middle Name
"""
# @ApiMember(Description="Name Suffix")
name_suffix: Optional[str] = None
"""
Name Suffix
"""
# @ApiMember(Description="Can be Contacted by Maison e.g. true or false", IsRequired=true)
can_be_contacted_by_maison: Optional[bool] = None
"""
Can be Contacted by Maison e.g. true or false
"""
# @ApiMember(Description="clientType e.g. PRIVATE, COMPANY", IsRequired=true)
client_type: Optional[str] = None
"""
clientType e.g. PRIVATE, COMPANY
"""
# @ApiMember(Description="Company Name - Mandatory only when customer type is 'Company'")
company_name: Optional[str] = None
"""
Company Name - Mandatory only when customer type is 'Company'
"""
# @ApiMember(Description="Language Id e.g. ita, chi, aze, eng, ger - Mandatory only when customer type is 'Personal'")
language_id: Optional[str] = None
"""
Language Id e.g. ita, chi, aze, eng, ger - Mandatory only when customer type is 'Personal'
"""
# @ApiMember(Description="Gender e.g. M, F - Mandatory only when customer type is 'Personal'")
gender: Optional[str] = None
"""
Gender e.g. M, F - Mandatory only when customer type is 'Personal'
"""
# @ApiMember(Description="Country Id e.g. it, cn, az, gb, de", IsRequired=true)
country_id: Optional[str] = None
"""
Country Id e.g. it, cn, az, gb, de
"""
# @ApiMember(Description="Birth Date e.g. '2020-12-30'")
birth_date: Optional[datetime.datetime] = None
"""
Birth Date e.g. '2020-12-30'
"""
# @ApiMember(Description="Customer reference")
customer_reference: Optional[str] = None
"""
Customer reference
"""
# @ApiMember(Description="Wedding Date, e.g. '2020-01-18'")
wedding_date: Optional[datetime.datetime] = None
"""
Wedding Date, e.g. '2020-01-18'
"""
# @ApiMember(Description="Preferred Contact Method e.g. 'Fax', 'Tel', 'EMail', 'Mail', 'Survey'")
preferred_contact_method: Optional[str] = None
"""
Preferred Contact Method e.g. 'Fax', 'Tel', 'EMail', 'Mail', 'Survey'
"""
# @ApiMember(Description="Provide 'true' if you want to be contacted by email. Leave empty or 'false' if you do not.")
contact_by_email_flag: Optional[bool] = None
"""
Provide 'true' if you want to be contacted by email. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Provide 'true' if you want to be contacted by mail. Leave empty or 'false' if you do not.")
contact_by_mail_flag: Optional[bool] = None
"""
Provide 'true' if you want to be contacted by mail. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Provide 'true' if you want to be contacted by phone. Leave empty or 'false' if you do not.")
contact_by_phone_flag: Optional[bool] = None
"""
Provide 'true' if you want to be contacted by phone. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Provide 'true' if you want to be contacted by SMS. Leave empty or 'false' if you do not.")
contact_by_s_m_s_flag: Optional[bool] = None
"""
Provide 'true' if you want to be contacted by SMS. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Provide 'true' if you want to be contacted by social media. Leave empty or 'false' if you do not.")
contact_by_social_media_flag: Optional[bool] = None
"""
Provide 'true' if you want to be contacted by social media. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Sale Representative Email e.g. rauf.aliyev@richemont.com")
sale_representative_email: Optional[str] = None
"""
Sale Representative Email e.g. rauf.aliyev@richemont.com
"""
# @ApiMember(Description="Consent for allowing Cross Border Data Transfer")
allow_store_data_abroad: Optional[bool] = None
"""
Consent for allowing Cross Border Data Transfer
"""
# @ApiMember(Description="Consent for allowing Cross Border Data Transfer For TimeVallée")
tv_allow_store_data_abroad: Optional[bool] = None
"""
Consent for allowing Cross Border Data Transfer For TimeVallée
"""
# @ApiMember(Description="Provide 'true' if you allow data sharing consent. Leave empty or 'false' if you do not.")
data_sharing_consent: Optional[bool] = None
"""
Provide 'true' if you allow data sharing consent. Leave empty or 'false' if you do not.
"""
# @ApiMember(Description="Notes")
notes: Optional[str] = None
"""
Notes
"""
# @ApiMember(Description="Reference Sale Representative Email")
reference_sale_representative_email: Optional[str] = None
"""
Reference Sale Representative Email
"""
# @ApiMember(Description="Customer emails")
emails: Optional[List[Email]] = None
"""
Customer emails
"""
# @ApiMember(Description="Customer phones")
phones: Optional[List[Phone]] = None
"""
Customer phones
"""
# @ApiMember(Description="Customer addresses")
addresses: Optional[List[Address]] = None
"""
Customer addresses
"""
# @ApiMember(Description="Customer events")
events: Optional[List[Event]] = None
"""
Customer events
"""
# @ApiMember(Description="Customer interests")
interests: Optional[List[Interest]] = None
"""
Customer interests
"""
# @ApiMember(Description="Customer hobbies")
hobbies: Optional[List[Hobby]] = None
"""
Customer hobbies
"""
# @ApiMember(Description="Customer product collections")
product_collections: Optional[List[ProductCollection]] = None
"""
Customer product collections
"""
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PATCH /customer/{boosterCustomerId} HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
boosterCustomerId: 0,
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: 0001-01-01,
customerReference: String,
weddingDate: 0001-01-01,
preferredContactMethod: String,
contactByEmailFlag: False,
contactByMailFlag: False,
contactByPhoneFlag: False,
contactBySMSFlag: False,
contactBySocialMediaFlag: False,
saleRepresentativeEmail: String,
allowStoreDataAbroad: False,
tvAllowStoreDataAbroad: False,
dataSharingConsent: False,
notes: String,
referenceSaleRepresentativeEmail: String,
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: 0001-01-01,
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
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
}