PersonalizationHostApi class
Methods
-
getCategory(String category, int? limit, int? page)
→ Future<String>
-
Returns a category product listing as a JSON string.
limit and page paginate the result; both are optional.
Dart layer parses the result into CategoryResponse.
-
getCollection(String collectionId)
→ Future<String>
-
Returns a merchandised collection's products as a JSON string.
Dart layer parses the result into CollectionResponse.
-
getDid()
→ Future<String?>
-
Returns the device ID assigned by the native SDK, or null before first sync.
-
getLoyaltyStatus(String identifier)
→ Future<String>
-
Returns the loyalty membership status (
loyalty/members/status) as a JSON
string { "status": ..., "payload": { "member": ..., "level": { ... } } }.
identifier is the member identifier (phone).
Dart layer parses the result into LoyaltyStatusResponse.
-
getPlatformVersion()
→ Future<String>
-
-
getProductCounters(String item)
→ Future<String>
-
Returns view / cart / purchase counters for
item as a JSON string.
Dart layer parses the result into ProductCountersResponse.
-
getProductInfo(String itemId)
→ Future<String>
-
Returns a single product's details as a JSON string.
Dart layer parses the result into Product.
-
getProductsList(String? paramsJson)
→ Future<String>
-
Returns a paginated product catalog list as a JSON string.
paramsJson is a JSON object with optional filter fields.
Dart layer parses the result into ProductsListResponse.
-
getProfile()
→ Future<String>
-
Returns the current user's profile as a JSON string.
Dart layer parses the result into ProfileResponse.
-
getRecommendation(String code, String? paramsJson)
→ Future<String>
-
Returns the recommendation block as a JSON string.
paramsJson is a JSON object string with optional filter parameters.
Dart layer parses the result into RecommendationResponse.
-
getSid()
→ Future<String>
-
Returns the current session ID from the native SDK.
-
getStoredPushToken()
→ Future<String?>
-
Returns the push token stored by the native SDK (if any).
-
initialize(InitConfig config)
→ Future<void>
-
-
joinLoyalty(String phone, String? email, String? firstName, String? lastName)
→ Future<String>
-
Joins the loyalty program (
loyalty/members/join) and returns the
response envelope as a JSON string { "status": ..., "payload": { ... } }.
The shop is identified by the SDK's configured shop_id; phone is required.
Dart layer parses the result into LoyaltyJoinResponse.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
searchBlank()
→ Future<String>
-
Returns blank search results (trending/popular) as a JSON string.
No parameters — the native SDK decides what to return based on shop config.
Dart layer parses the result into SearchBlankResponse.
-
searchFull(String query, String? paramsJson)
→ Future<String>
-
Returns full search results as a JSON string.
paramsJson is a JSON object string with optional search parameters.
Dart layer parses the result into SearchFullResponse.
-
searchInstant(String query, String? paramsJson)
→ Future<String>
-
Returns instant (typeahead) search results as a JSON string.
paramsJson may contain optional "locations" (String) and "excluded_brands" (String).
Dart layer parses the result into SearchInstantResponse.
-
setProfile(ProfileParamsWire params)
→ Future<void>
-
-
toString()
→ String
-
A string representation of this object.
inherited
-
trackEvent(String event, int? time, String? category, String? label, int? value, String? customFieldsJson)
→ Future<void>
-
customFieldsJson is JSON object string or null (maps to native custom fields map).
-
trackPurchase(String orderId, double orderPrice, List<PurchaseLineItemWire> items, String? deliveryType, String? deliveryAddress, String? paymentType, bool isTaxFree, String? promocode, double? orderCash, double? orderBonuses, double? orderDelivery, double? orderDiscount, String? channel, String? customJson, String? recommendedSourceJson, String? stream, String? segment)
→ Future<void>
-
customJson and recommendedSourceJson are JSON object strings or null.