| GET | /customer/{boosterCustomerId} | Get customer details | Get Customer info based on the Booster Customer ID |
|---|
import 'package:servicestack/servicestack.dart';
class CustomerEmail implements IConvertible
{
/**
* Description
*/
// @ApiMember(Description="Description", IsRequired=true)
String description = "";
/**
* Email Address
*/
// @ApiMember(Description="Email Address", IsRequired=true)
String email = "";
/**
* Is main email address
*/
// @ApiMember(Description="Is main email address", IsRequired=true)
bool? isMain;
CustomerEmail({this.description="",this.email="",this.isMain});
CustomerEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
description = json['description'] ?? "";
email = json['email'] ?? "";
isMain = json['isMain'];
return this;
}
Map<String, dynamic> toJson() => {
'description': description,
'email': email,
'isMain': isMain
};
getTypeName() => "CustomerEmail";
TypeContext? context = _ctx;
}
class CustomerPhone implements IConvertible
{
/**
* Description
*/
// @ApiMember(Description="Description", IsRequired=true)
String description = "";
/**
* Phone Number
*/
// @ApiMember(Description="Phone Number", IsRequired=true)
String phone = "";
/**
* Is main phone number
*/
// @ApiMember(Description="Is main phone number ", IsRequired=true)
bool? isMain;
/**
* Phone number country prefix
*/
// @ApiMember(Description="Phone number country prefix", IsRequired=true)
String prefixCountryId = "";
/**
* Telephone prefix
*/
// @ApiMember(Description="Telephone prefix", IsRequired=true)
String telephonePrefix = "";
CustomerPhone({this.description="",this.phone="",this.isMain,this.prefixCountryId="",this.telephonePrefix=""});
CustomerPhone.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
description = json['description'] ?? "";
phone = json['phone'] ?? "";
isMain = json['isMain'];
prefixCountryId = json['prefixCountryId'] ?? "";
telephonePrefix = json['telephonePrefix'] ?? "";
return this;
}
Map<String, dynamic> toJson() => {
'description': description,
'phone': phone,
'isMain': isMain,
'prefixCountryId': prefixCountryId,
'telephonePrefix': telephonePrefix
};
getTypeName() => "CustomerPhone";
TypeContext? context = _ctx;
}
class CustomerEvent implements IConvertible
{
/**
* Event Id
*/
// @ApiMember(Description="Event Id", IsRequired=true)
int eventId = 0;
/**
* Event Description
*/
// @ApiMember(Description="Event Description ", IsRequired=true)
String eventDescription = "";
/**
* Event Other
*/
// @ApiMember(Description="Event Other", IsRequired=true)
String eventTypeOther = "";
/**
* Comment
*/
// @ApiMember(Description="Comment", IsRequired=true)
String comment = "";
/**
* Event Day
*/
// @ApiMember(Description="Event Day", IsRequired=true)
int eventDay = 0;
/**
* Event Month
*/
// @ApiMember(Description="Event Month", IsRequired=true)
int eventMonth = 0;
/**
* Event Year
*/
// @ApiMember(Description="Event Year", IsRequired=true)
int eventYear = 0;
CustomerEvent({this.eventId=0,this.eventDescription="",this.eventTypeOther="",this.comment="",this.eventDay=0,this.eventMonth=0,this.eventYear=0});
CustomerEvent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
eventId = json['eventId'] ?? 0;
eventDescription = json['eventDescription'] ?? "";
eventTypeOther = json['eventTypeOther'] ?? "";
comment = json['comment'] ?? "";
eventDay = json['eventDay'] ?? 0;
eventMonth = json['eventMonth'] ?? 0;
eventYear = json['eventYear'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'eventId': eventId,
'eventDescription': eventDescription,
'eventTypeOther': eventTypeOther,
'comment': comment,
'eventDay': eventDay,
'eventMonth': eventMonth,
'eventYear': eventYear
};
getTypeName() => "CustomerEvent";
TypeContext? context = _ctx;
}
class GetCustomerResponse implements IConvertible
{
/**
* Booster Customer ID
*/
// @ApiMember(Description="Booster Customer ID", IsRequired=true)
int id = 0;
/**
* SAP Customer ID
*/
// @ApiMember(Description="SAP Customer ID", IsRequired=true)
String sapId = "";
/**
* Customer Reference
*/
// @ApiMember(Description="Customer Reference", IsRequired=true)
String customerReference = "";
/**
* Gender
*/
// @ApiMember(Description="Gender", IsRequired=true)
String gender = "";
/**
* Personal Title
*/
// @ApiMember(Description="Personal Title", IsRequired=true)
String personalTitle = "";
/**
* First Name
*/
// @ApiMember(Description="First Name", IsRequired=true)
String firstName = "";
/**
* Customer Last Name
*/
// @ApiMember(Description="Customer Last Name", IsRequired=true)
String lastName = "";
/**
* First Name Not Latin
*/
// @ApiMember(Description="First Name Not Latin", IsRequired=true)
String firstNameNotLatin = "";
/**
* Customer Last Name Not Latin
*/
// @ApiMember(Description="Customer Last Name Not Latin", IsRequired=true)
String lastNameNotLatin = "";
/**
* Middle Name
*/
// @ApiMember(Description="Middle Name", IsRequired=true)
String middleName = "";
/**
* Can be contacted or not?
*/
// @ApiMember(Description="Can be contacted or not?", IsRequired=true)
bool? canBeContacted;
/**
* Language
*/
// @ApiMember(Description="Language", IsRequired=true)
String language = "";
/**
* Country
*/
// @ApiMember(Description="Country", IsRequired=true)
String countryId = "";
/**
* Brand Trigram
*/
// @ApiMember(Description="Brand Trigram", IsRequired=true)
String brand = "";
/**
* List of Emails
*/
// @ApiMember(Description="List of Emails", IsRequired=true)
List<CustomerEmail> emails = [];
/**
* List of Phone Numbers
*/
// @ApiMember(Description="List of Phone Numbers", IsRequired=true)
List<CustomerPhone> phones = [];
/**
* List of Events
*/
// @ApiMember(Description="List of Events", IsRequired=true)
List<CustomerEvent> events = [];
/**
* Registration date
*/
// @ApiMember(Description="Registration date")
DateTime? registrationDate;
GetCustomerResponse({this.id=0,this.sapId="",this.customerReference="",this.gender="",this.personalTitle="",this.firstName="",this.lastName="",this.firstNameNotLatin="",this.lastNameNotLatin="",this.middleName="",this.canBeContacted,this.language="",this.countryId="",this.brand="",this.emails=const [],this.phones=const [],this.events=const [],this.registrationDate});
GetCustomerResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'] ?? 0;
sapId = json['sapId'] ?? "";
customerReference = json['customerReference'] ?? "";
gender = json['gender'] ?? "";
personalTitle = json['personalTitle'] ?? "";
firstName = json['firstName'] ?? "";
lastName = json['lastName'] ?? "";
firstNameNotLatin = json['firstNameNotLatin'] ?? "";
lastNameNotLatin = json['lastNameNotLatin'] ?? "";
middleName = json['middleName'] ?? "";
canBeContacted = json['canBeContacted'];
language = json['language'] ?? "";
countryId = json['countryId'] ?? "";
brand = json['brand'] ?? "";
emails = JsonConverters.fromJson(json['emails'],'List<CustomerEmail>',context!) ?? [];
phones = JsonConverters.fromJson(json['phones'],'List<CustomerPhone>',context!) ?? [];
events = JsonConverters.fromJson(json['events'],'List<CustomerEvent>',context!) ?? [];
registrationDate = JsonConverters.fromJson(json['registrationDate'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'sapId': sapId,
'customerReference': customerReference,
'gender': gender,
'personalTitle': personalTitle,
'firstName': firstName,
'lastName': lastName,
'firstNameNotLatin': firstNameNotLatin,
'lastNameNotLatin': lastNameNotLatin,
'middleName': middleName,
'canBeContacted': canBeContacted,
'language': language,
'countryId': countryId,
'brand': brand,
'emails': JsonConverters.toJson(emails,'List<CustomerEmail>',context!),
'phones': JsonConverters.toJson(phones,'List<CustomerPhone>',context!),
'events': JsonConverters.toJson(events,'List<CustomerEvent>',context!),
'registrationDate': JsonConverters.toJson(registrationDate,'DateTime',context!)
};
getTypeName() => "GetCustomerResponse";
TypeContext? context = _ctx;
}
class GetCustomer implements IConvertible
{
/**
* Booster Customer ID
*/
// @ApiMember(Description="Booster Customer ID", IsRequired=true)
int boosterCustomerId = 0;
GetCustomer({this.boosterCustomerId=0});
GetCustomer.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
boosterCustomerId = json['boosterCustomerId'] ?? 0;
return this;
}
Map<String, dynamic> toJson() => {
'boosterCustomerId': boosterCustomerId
};
getTypeName() => "GetCustomer";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'CustomerEmail': TypeInfo(TypeOf.Class, create:() => CustomerEmail()),
'CustomerPhone': TypeInfo(TypeOf.Class, create:() => CustomerPhone()),
'CustomerEvent': TypeInfo(TypeOf.Class, create:() => CustomerEvent()),
'GetCustomerResponse': TypeInfo(TypeOf.Class, create:() => GetCustomerResponse()),
'List<CustomerEmail>': TypeInfo(TypeOf.Class, create:() => <CustomerEmail>[]),
'List<CustomerPhone>': TypeInfo(TypeOf.Class, create:() => <CustomerPhone>[]),
'List<CustomerEvent>': TypeInfo(TypeOf.Class, create:() => <CustomerEvent>[]),
'GetCustomer': TypeInfo(TypeOf.Class, create:() => GetCustomer()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"id":0,"sapId":"String","customerReference":"String","gender":"String","personalTitle":"String","firstName":"String","lastName":"String","firstNameNotLatin":"String","lastNameNotLatin":"String","middleName":"String","canBeContacted":false,"language":"String","countryId":"String","brand":"String","emails":[{"description":"String","email":"String","isMain":false}],"phones":[{"description":"String","phone":"String","isMain":false,"prefixCountryId":"String","telephonePrefix":"String"}],"events":[{"eventId":0,"eventDescription":"String","eventTypeOther":"String","comment":"String","eventDay":0,"eventMonth":0,"eventYear":0}],"registrationDate":"\/Date(-62135596800000-0000)\/"}