/
Product Details (Android SDK - Kotlin)
Product Details (Android SDK - Kotlin)
Andrey Veprikov
Owned by Andrey Veprikov
Get Product List
Method Objective
The method allows getting a list of products in stock.
Syntax and parameters
sdk.productsManager.getProductsList(params, callback)
Name | Type | Requirement | Description |
---|---|---|---|
params | required | Request parameters. | |
callback | function | required | Callback-function, where the API response will be passed to. |
Request Parameters
Name | Type | Requirement | Description |
---|---|---|---|
limit | number | optionally | The maximum number of products in the API response (by default - 10). |
page | number | optionally | Page number (first page - 1, by default - 1). |
categories | string | optionally | Comma-separated category IDs. If used, the API response will return only those products that are in the specified categories. |
locations | string | optionally | Comma-separated location IDs. If used, the API will return only products available in the specified locations. Locations must be specified in the imported product catalog (XML, HTTP API). |
brands | string | optionally | Comma-separated vendor names. If used, the API response will return only the products of the listed vendors. The vendors must be listed in the product feed. |
filters | list | optionally |
API response
Name | Type | Description |
---|---|---|
products | array | An array of objects with product information. Each object has the following properties:
|
products_total | number | The total number of products. The following request parameters don't affect this value: page, limit. |
brands | Object array | An array of objects with information about available brands. Each object has the following properties:
|
filters | Object | |
price_range | Object | The object containing the values of the minimum and maximum price of the products in the API response. Available properties:
|
Example of use
sdk.productsManager.getProductsList( brands = PRODUCTS_BRANDS, categories = PRODUCTS_CATEGORIES, locations = PRODUCTS_LOCATIONS, limit = PRODUCTS_LIMIT, page = PRODUCTS_PAGE, filters = PRODUCTS_FILTERS, listener = object : OnApiCallbackListener() { override fun onSuccess(response: JSONObject?) { super.onSuccess(response) // Handle your response } override fun onError(code: Int, msg: String?) { super.onError(code, msg) // Handle errors } } )
Get Product Details
Method Objective
The method allows getting product details.
Syntax and parameters
sdk.productsManager.getProductInfo(itemId, callback)
Name | Type | Requirement | Description |
---|---|---|---|
id | string | required | Product ID |
callback | function | required | Callback-function, where the API response will be passed to. |
API response
Name | Type | Description |
---|---|---|
products | array | An array of objects with product information. Each object has the following properties:
|
Example of use
sdk.productsManager.getProductInfo( itemId = YOUR_ITEM_ID, listener = object : OnApiCallbackListener() { override fun onSuccess(response: JSONArray) { super.onSuccess(response) // Handle your response } override fun onError(code: Int, msg: String?) { super.onError(code, msg) // Handle your error } } )
Get User's Current Cart
Method Objective
The method allows getting the current profile's cart.
Syntax and parameters
Name | Type | Requirement | Description |
---|---|---|---|
success | function | required | Callback-function, where the API response will be passed to. |
error | function | optionally | Error callback-function. |
API response
Name | Type | Description |
---|---|---|
status | string | The status of the request |
data.items | array | An array of objects with product information. Each object has the following properties:
|
Example of use
sdk.cartManager.getClientShoppingCartContent( onGetCartContent = { cartContent: CartContent -> // Handle your response }, onError = { code: Int, msg: String? -> // Handle your response } )
Page Navigation
Related Pages
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
, multiple selections available,
Related content
Product Details (iOS SDK)
Product Details (iOS SDK)
More like this
Product Details (JS SDK)
Product Details (JS SDK)
More like this
Product Details (REST API)
Product Details (REST API)
More like this
Search Engine (Android SDK - Kotlin)
Search Engine (Android SDK - Kotlin)
More like this
Product Recommendations (Android SDK - Kotlin)
Product Recommendations (Android SDK - Kotlin)
More like this
Search Engine (Android SDK - Java)
Search Engine (Android SDK - Java)
More like this
Copyright 2018-2024 PersonaClick