Product Details (iOS SDK)
- 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.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 | array | 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.getProductsList(brands: "BRAND_1,BRAND_2", categories: "CATEGORY_1,CATEGORY_2", locations: "LOCATION_1,LOCATION_2", limit: 100, page: 3, filters: ["PARAM_NAME_1": ["PARAM_VALUE_1", "PARAM_VALUE_2"], "PARAM_NAME_2": ["PARAM_VALUE_1", "PARAM_VALUE_2"]]) { Result<ProductsListResponse, SDKError> in // productsListResponse in // Result response }
Get Product Details
Method Objective
The method allows getting product details.
Syntax and parameters
sdk.getProductInfo(id) { 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.getProductInfo(id: String) { Result<ProductInfo, SDKError> in // productInfoResponse in // Result response }
Get User's Current Cart
Method Objective
The method allows getting the current profile's cart.
Syntax and parameters
sdk.getProductsFromCart { callback }
Name | Type | Requirement | Description |
---|---|---|---|
callback | function | required | Callback-function, where the API response will be passed to. |
API response
Name | Type | Description |
---|---|---|
items | array | An array of objects with product information. Each object has the following properties:
|
Example of use
sdk.getProductsFromCart { result in switch result { case .success(let items): print("cart items: \n \(items)") case .failure(let error): print("error: \(error)") } }
Page Navigation
Related Pages
-
Page:
-
Page:
-
Page:
-
Page:
-
Page:
Copyright 2018-2024 PersonaClick