| GET | /customer/{brand}/slim | Get customers list | Get slim list of customers paginated and sorted |
|---|
import Foundation
import ServiceStack
public class GetCustomerPaginated : SearchCustomer, IPagedRequest
{
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned")
public var page:Int
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned")
public var items:Int
/**
* Omit precise record count - save on performance
*/
// @ApiMember(Description="Omit precise record count - save on performance")
public var noCount:Bool
/**
* Values can be 'NameDESC', 'NameASC', 'RegASC', 'RegDESC'
*/
// @ApiMember(Description="Values can be 'NameDESC', 'NameASC', 'RegASC', 'RegDESC'")
public var sortBy:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case page
case items
case noCount
case sortBy
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
page = try container.decodeIfPresent(Int.self, forKey: .page)
items = try container.decodeIfPresent(Int.self, forKey: .items)
noCount = try container.decodeIfPresent(Bool.self, forKey: .noCount)
sortBy = try container.decodeIfPresent(String.self, forKey: .sortBy)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if page != nil { try container.encode(page, forKey: .page) }
if items != nil { try container.encode(items, forKey: .items) }
if noCount != nil { try container.encode(noCount, forKey: .noCount) }
if sortBy != nil { try container.encode(sortBy, forKey: .sortBy) }
}
}
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 GetCustomerPaginatedResponse : Codable
{
/**
* Total Pages
*/
// @ApiMember(Description="Total Pages", IsRequired=true)
public var totalPages:Int
/**
* Total Results
*/
// @ApiMember(Description="Total Results", IsRequired=true)
public var totalResults:Int
/**
* Index of the result set returned
*/
// @ApiMember(Description="Index of the result set returned", IsRequired=true)
public var page:Int
/**
* Size of the result set returned
*/
// @ApiMember(Description="Size of the result set returned", IsRequired=true)
public var items:Int
/**
* List of customers
*/
// @ApiMember(Description="List of customers", IsRequired=true)
public var elements:[GetCustomerPaginatedElement] = []
required public init(){}
}
public class GetCustomerPaginatedElement : Codable
{
/**
* Booster Customer Id
*/
// @ApiMember(Description="Booster Customer Id", IsRequired=true)
public var boosterCustomerId:Int
/**
* First name
*/
// @ApiMember(Description="First name", IsRequired=true)
public var firstName:String
/**
* Middle name
*/
// @ApiMember(Description="Middle name", IsRequired=true)
public var middleName:String
/**
* Last name
*/
// @ApiMember(Description="Last name", IsRequired=true)
public var lastName:String
/**
* First name Not Latin
*/
// @ApiMember(Description="First name Not Latin", IsRequired=true)
public var firstNameNotLatin:String
/**
* Last name Not Latin
*/
// @ApiMember(Description="Last name Not Latin", IsRequired=true)
public var lastNameNotLatin:String
/**
* Customer phone
*/
// @ApiMember(Description="Customer phone", IsRequired=true)
public var phone:String
/**
* Phone Country Prefix
*/
// @ApiMember(Description="Phone Country Prefix", IsRequired=true)
public var countryPrefix:String
/**
* Customer email
*/
// @ApiMember(Description="Customer email", IsRequired=true)
public var email:String
/**
* Data Sharing Consent
*/
// @ApiMember(Description="Data Sharing Consent", IsRequired=true)
public var dataSharingConsent:Bool?
/**
* Sellout Transaction Count
*/
// @ApiMember(Description="Sellout Transaction Count", IsRequired=true)
public var selloutTransactionCount:Int
/**
* Elevate Customer ID
*/
// @ApiMember(Description="Elevate Customer ID")
public var elevateCustomerId:String
/**
* Elevate Consent Status
*/
// @ApiMember(Description="Elevate Consent Status")
public var elevateConsentStatus:String
/**
* Customer Country Id
*/
// @ApiMember(Description="Customer Country Id")
public var countryId:String
/**
* Registration date
*/
// @ApiMember(Description="Registration date")
public var registrationDate:Date?
/**
* Sap Crm Error Message
*/
// @ApiMember(Description="Sap Crm Error Message")
public var sapCrmErrorMessage:String
required public init(){}
}
Swift GetCustomerPaginated 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.
GET /customer/{brand}/slim HTTP/1.1
Host: dev-api-booster.richemont.com
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"totalPages":0,"totalResults":0,"page":0,"items":0}