ProductsAPI

Provides suspend and callback-based methods for managing products in the Frame API.

Each operation has two overloads: a coroutine-based suspend function that returns a Pair and a callback-based variant for use outside of coroutine scopes.

Functions

Link copied to clipboard

Creates a new product.

Creates a new product and delivers the result via a callback.

Link copied to clipboard

Deletes a product by its identifier.

Deletes a product by its identifier and delivers the result via a callback.

Link copied to clipboard
suspend fun getProducts(page: Int? = null, perPage: Int? = null): Pair<ProductsResponses.ListProductsResponse?, NetworkingError?>

Retrieves a paginated list of products.

fun getProducts(page: Int? = null, perPage: Int? = null, completionHandler: (ProductsResponses.ListProductsResponse?, NetworkingError?) -> Unit)

Retrieves a paginated list of products and delivers the result via a callback.

Link copied to clipboard
suspend fun getProductWith(productId: String): Pair<Product?, NetworkingError?>

Retrieves a single product by its identifier.

fun getProductWith(productId: String, completionHandler: (Product?, NetworkingError?) -> Unit)

Retrieves a single product by its identifier and delivers the result via a callback.

Link copied to clipboard
suspend fun searchProducts(name: String? = null, active: Boolean? = null, shippable: Boolean? = null): Pair<List<Product>?, NetworkingError?>

Searches products by optional filter criteria.

fun searchProducts(name: String? = null, active: Boolean? = null, shippable: Boolean? = null, completionHandler: (List<Product>?, NetworkingError?) -> Unit)

Searches products by optional filter criteria and delivers the result via a callback.

Link copied to clipboard

Updates an existing product.

fun updateProduct(productId: String, request: ProductsRequests.UpdateProductRequest, completionHandler: (Product?, NetworkingError?) -> Unit)

Updates an existing product and delivers the result via a callback.