Skip to content
Get started

Create Discount Prices

products.create_discount_prices(ProductCreateDiscountPricesParams**kwargs) -> ProductCreateDiscountPricesResponse
POST/api/v2/public/products/discountprices

Creates or updates promotional prices, which override the standard price while they are valid. The is_flush header replaces all existing discount prices instead of merging, so only use it when sending the complete set.

ParametersExpand Collapse
discounts: Optional[Iterable[Discount]]

The list of discount price entries.

discount_description: Optional[str]

Human-readable description of the discount.

discount_group: Optional[str]

Optional discount group identifier.

discount_id: Optional[str]

Unique discount identifier.

discount_type: Optional[int]

Numeric discount type.

formatint64
is_delete: Optional[bool]

When true, removes the existing discount entry.

line_number: Optional[int]

Line number on the discount.

formatint64
price: Optional[float]

Discounted price value.

formatfloat
product_number: Optional[str]

The product number this discount applies to.

valid_from: Optional[Union[str, datetime, null]]

Start of the discount’s validity period.

formatdate-time
valid_to: Optional[Union[str, datetime, null]]

End of the discount’s validity period.

formatdate-time
is_expire_discounts: Optional[bool]
is_flush: Optional[bool]
ReturnsExpand Collapse
class ProductCreateDiscountPricesResponse: …

Standard success response returned by mutation endpoints.

success: bool

Indicates whether the operation completed successfully.

data: Optional[str]

Optional data payload returned by the operation.

message: Optional[str]

Human-readable message describing the result.

Create Discount Prices

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.products.create_discount_prices()
print(response.success)
{
  "success": true,
  "data": "data",
  "message": "message"
}
{
  "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
{
  "success": true,
  "data": "data",
  "message": "message"
}
{
  "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."
}