Async Products Module
This wrapper class facilitates asynchronous integration with Paystack Products API. The Products API allows you to create and manage inventories on your integration.
- class AsyncProductClientAPI(secret_key: str = None)
Paystack Product API Reference: Products
- async create_product(name: str, description: str, amount: int, currency: str, unlimited: bool | None = None, quantity: int | None = None)→ PayStackResponse
Create a product
- Parameters:
name (str) – The name of the product
description (str) – The description of the product
amount (int) – The amount of the product
currency (str) – The currency of the product
unlimited (bool, optional) – Whether or not the product is unlimited
quantity (int, optional) – The quantity of the product
- Returns:
The response from the API
- Return type:
PayStackResponse object
- async fetch_product(product_id: str)→ PayStackResponse
Fetch a product
- Parameters:
product_id (str) – The ID of the product
- Returns:
The response from the API
- Return type:
PayStackResponse object
- async list_products(per_page: int | None = 50, page: int | None = 1, from_date: date | None = None, to_date: date | None = None)→ PayStackResponse
List products
- Parameters:
per_page (int, optional) – The number of products to return per page. (default: 50)
page (int, optional) – The page to return. (default: 1)
from_date (date, optional) – The date from which to list products
to_date (date, optional) – The date until which to list products
- Returns:
The response from the API
- Return type:
PayStackResponse object
- async update_product(product_id: str, name: str, description: str, amount: int, currency: str, unlimited: bool | None = None, quantity: int | None = None)→ PayStackResponse
Update a product
- Parameters:
product_id (str) – The ID of the product
name (str) – The name of the product
description (str) – The description of the product
amount (int) – The amount of the product
currency (str) – The currency of the product
unlimited (bool, optional) – Whether the product is unlimited
quantity (int, optional) – The quantity of the product
- Returns:
The response from the API
- Return type:
PayStackResponse object