Product Details (Android SDK - Kotlin)
- Andrey Veprikov
Owned by Andrey Veprikov
Nov 19, 2024
3 min read
Loading data...
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 } } )
Page Navigation
Related Pages
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
Copyright 2018-2024 PersonaClick