| POST | /customer/{brand}/export | Export Customer Data |
|---|
import Foundation
import ServiceStack
public class ExportCustomer : SearchCustomer
{
/**
* Export Request ID of the API Consumers
*/
// @ApiMember(Description="Export Request ID of the API Consumers", IsRequired=true)
public var downloadRequestId:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case downloadRequestId
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
downloadRequestId = try container.decodeIfPresent(String.self, forKey: .downloadRequestId)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if downloadRequestId != nil { try container.encode(downloadRequestId, forKey: .downloadRequestId) }
}
}
public class SearchCustomer : Codable
{
/**
* Brand
*/
// @ApiMember(Description="Brand", IsRequired=true)
public var brand:String
/**
* POS Legacy
*/
// @ApiMember(Description="POS Legacy", IsRequired=true)
public var posCodes:[String] = []
/**
* Search key could be: 'Name', 'Email', 'Phone' without prefix, 'BoosterCustomerId' OR 'SapCRMId'
*/
// @ApiMember(Description="Search key could be: 'Name', 'Email', 'Phone' without prefix, 'BoosterCustomerId' OR 'SapCRMId'")
public var searchKey:String
/**
* Search by phone number - exact match
*/
// @ApiMember(Description="Search by phone number - exact match")
public var phoneNumber:String
/**
* Search by email address - exact match
*/
// @ApiMember(Description="Search by email address - exact match")
public var email:String
/**
* Values can be 'it', 'en' etc.
*/
// @ApiMember(Description="Values can be 'it', 'en' etc.")
public var locationCountryIds:[String] = []
/**
* Client Spending From e.g. '100'
*/
// @ApiMember(Description="Client Spending From e.g. '100'")
public var clientSpendingFrom:Double?
/**
* Client Spending To e.g. '50000'
*/
// @ApiMember(Description="Client Spending To e.g. '50000'")
public var clientSpendingTo:Double?
/**
* Customer Creation Date From e.g. '2022-01-01'
*/
// @ApiMember(Description="Customer Creation Date From e.g. '2022-01-01'")
public var creationDateFrom:Date?
/**
* Customer Creation Date To e.g. '2023-11-01'
*/
// @ApiMember(Description="Customer Creation Date To e.g. '2023-11-01'")
public var creationDateTo:Date?
/**
* Transaction Date From e.g. '2022-01-01'
*/
// @ApiMember(Description="Transaction Date From e.g. '2022-01-01'")
public var transactionDateFrom:Date?
/**
* Transaction Date To e.g. '2023-11-01'
*/
// @ApiMember(Description="Transaction Date To e.g. '2023-11-01'")
public var transactionDateTo:Date?
/**
* Values can be 'true' or 'false'
*/
// @ApiMember(Description="Values can be 'true' or 'false'")
public var canBeContactedByMaison:Bool?
/**
* Values can be 1 for 'January', 2 for 'February', 3 for 'March', 4 for 'April', 5 for 'May', 6 for 'June', 7 for 'July', 8 for 'August', 9 for 'September', 10 for 'October', 11 for 'November', 12 for 'December'
*/
// @ApiMember(Description="Values can be 1 for 'January', 2 for 'February', 3 for 'March', 4 for 'April', 5 for 'May', 6 for 'June', 7 for 'July', 8 for 'August', 9 for 'September', 10 for 'October', 11 for 'November', 12 for 'December'")
public var birthdateMonths:[Int] = []
/**
* Customer interest filter
*/
// @ApiMember(Description="Customer interest filter")
public var interests:[GetCustomerInterest] = []
/**
* Customer hobby filter
*/
// @ApiMember(Description="Customer hobby filter")
public var hobbies:[GetCustomerHobby] = []
/**
* Customer product collection filter
*/
// @ApiMember(Description="Customer product collection filter")
public var productCollections:[GetCustomerProductCollection] = []
/**
* Customer Status e.g. 'Prospect', 'Client'
*/
// @ApiMember(Description="Customer Status e.g. 'Prospect', 'Client'")
public var customerStatus:[String] = []
/**
* List of BoosterCustomerIds, e.g. 1234567,1231231,12323423
*/
// @ApiMember(Description="List of BoosterCustomerIds, e.g. 1234567,1231231,12323423")
public var boosterCustomerIds:[Int] = []
/**
* Values can be 'true' or 'false'
*/
// @ApiMember(Description="Values can be 'true' or 'false'")
public var hasSapCrmError:Bool?
/**
* Product Categories
*/
// @ApiMember(Description="Product Categories")
public var productCategories:[ProductCategory] = []
/**
* Sale Reprentative Emails
*/
// @ApiMember(Description="Sale Reprentative Emails")
public var saleRepresentativeEmails:[String] = []
required public init(){}
}
public class GetCustomerInterest : Codable
{
/**
* Interest description
*/
// @ApiMember(Description="Interest description", IsRequired=true)
public var interest:String
/**
* SAP Interest ID, e.g. 'CA-1'
*/
// @ApiMember(Description="SAP Interest ID, e.g. 'CA-1'", IsRequired=true)
public var sapInterestId:String
required public init(){}
}
public class GetCustomerHobby : Codable
{
/**
* Hobby description
*/
// @ApiMember(Description="Hobby description")
public var hobby:String
/**
* SAP Hobby ID, e.g. 'ART'
*/
// @ApiMember(Description="SAP Hobby ID, e.g. 'ART'")
public var sapHobbyId:String
required public init(){}
}
public class GetCustomerProductCollection : Codable
{
/**
* Product Collection description
*/
// @ApiMember(Description="Product Collection description", IsRequired=true)
public var productCollection:String
/**
* SAP ProductCollection ID, e.g. 'CA-1'
*/
// @ApiMember(Description="SAP ProductCollection ID, e.g. 'CA-1'", IsRequired=true)
public var sapProductCollectionId:String
required public init(){}
}
public class ProductCategory : Codable
{
/**
* Brand Category ID
*/
// @ApiMember(Description="Brand Category ID")
public var brandCategoryId:String
/**
* Grand Category ID
*/
// @ApiMember(Description="Grand Category ID", IsRequired=true)
public var grandCategoryId:String
/**
* Master Category ID
*/
// @ApiMember(Description="Master Category ID")
public var masterCategoryId:String
/**
* Category ID
*/
// @ApiMember(Description="Category ID")
public var categoryId:String
/**
* Sub Category ID
*/
// @ApiMember(Description="Sub Category ID")
public var subCategoryId:String
required public init(){}
}
public class ExportCustomerResponse : Codable
{
/**
* Unique Identifier of the Export Request created
*/
// @ApiMember(Description="Unique Identifier of the Export Request created", IsRequired=true)
public var asyncTaskId:String
required public init(){}
}
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}/export HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<ExportCustomer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel">
<birthdateMonths xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</birthdateMonths>
<boosterCustomerIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:int>0</d2p1:int>
</boosterCustomerIds>
<brand>String</brand>
<canBeContactedByMaison>false</canBeContactedByMaison>
<clientSpendingFrom>0</clientSpendingFrom>
<clientSpendingTo>0</clientSpendingTo>
<creationDateFrom>0001-01-01T00:00:00</creationDateFrom>
<creationDateTo>0001-01-01T00:00:00</creationDateTo>
<customerStatus xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</customerStatus>
<email>String</email>
<hasSapCrmError>false</hasSapCrmError>
<hobbies>
<GetCustomerHobby>
<hobby>String</hobby>
<sapHobbyId>String</sapHobbyId>
</GetCustomerHobby>
</hobbies>
<interests>
<GetCustomerInterest>
<interest>String</interest>
<sapInterestId>String</sapInterestId>
</GetCustomerInterest>
</interests>
<locationCountryIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</locationCountryIds>
<phoneNumber>String</phoneNumber>
<posCodes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</posCodes>
<productCategories xmlns:d2p1="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Common.ServiceModel">
<d2p1:ProductCategory>
<d2p1:brandCategoryId>String</d2p1:brandCategoryId>
<d2p1:categoryId>String</d2p1:categoryId>
<d2p1:grandCategoryId>String</d2p1:grandCategoryId>
<d2p1:masterCategoryId>String</d2p1:masterCategoryId>
<d2p1:subCategoryId>String</d2p1:subCategoryId>
</d2p1:ProductCategory>
</productCategories>
<productCollections>
<GetCustomerProductCollection>
<productCollection>String</productCollection>
<sapProductCollectionId>String</sapProductCollectionId>
</GetCustomerProductCollection>
</productCollections>
<saleRepresentativeEmails xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</saleRepresentativeEmails>
<searchKey>String</searchKey>
<transactionDateFrom>0001-01-01T00:00:00</transactionDateFrom>
<transactionDateTo>0001-01-01T00:00:00</transactionDateTo>
<downloadRequestId>String</downloadRequestId>
</ExportCustomer>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ExportCustomerResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.CRM.ServiceModel"> <asyncTaskId>00000000-0000-0000-0000-000000000000</asyncTaskId> </ExportCustomerResponse>