Create Product List
product_lists.create_product_list(strstore_number, ProductListCreateProductListParams**kwargs) -> ProductListCreateProductListResponse
POST/api/v2/public/stores/{store_number}/productlists
Creates a product list, optionally with its first lines. product_list_type must already exist. The response returns the new list id, which the lines endpoint needs.
Parameters
product_list_name: str
Name of the product list. Must contain only letters, numbers, spaces, dots, hyphens, or underscores.
minLength1
app_username: Optional[str]
Name of the app user creating the product list. Defaults to “unknown” when omitted.
is_allow_duplicate_products: Optional[bool]
When true (default), duplicate products may appear on multiple lines. When false, lines for the same product are merged and quantities are summed.
Create Product List
import os
from colleqtive_sdk import Colleqtive
client = Colleqtive(
bearer_token=os.environ.get("COLLEQTIVE_BEARER_TOKEN"), # This is the default and can be omitted
)
response = client.product_lists.create_product_list(
store_number="store_number",
product_list_name="Produce",
free_fields=[{
"key": "department",
"value": "produce",
}],
is_allow_duplicate_products=True,
lines=[{
"product_number": "PRD-001",
"quantity": 5,
}, {
"product_number": "PRD-002",
"quantity": 12,
}],
product_list_type=1,
)
print(response.product_list_id){
"product_list_id": 0
}{
"code": 401,
"status": "error",
"message": "Authentication failed.",
"error": "unauthorized",
"error_description": "Authentication failed."
}{
"code": 500,
"status": "fail",
"message": "The request could not be processed.",
"error": "internal_error",
"error_description": "The request could not be processed."
}Returns Examples
{
"product_list_id": 0
}{
"code": 401,
"status": "error",
"message": "Authentication failed.",
"error": "unauthorized",
"error_description": "Authentication failed."
}{
"code": 500,
"status": "fail",
"message": "The request could not be processed.",
"error": "internal_error",
"error_description": "The request could not be processed."
}