Skip to content
Get started

Create Discount Prices

ProductCreateDiscountPricesResponse Products.CreateDiscountPrices(ProductCreateDiscountPricesParams?parameters, CancellationTokencancellationToken = default)
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
ProductCreateDiscountPricesParams parameters
IReadOnlyList<Discount>? discounts

Body param: The list of discount price entries.

string? DiscountDescription

Human-readable description of the discount.

string? DiscountGroup

Optional discount group identifier.

string? DiscountID

Unique discount identifier.

Long? DiscountType

Numeric discount type.

formatint64
Boolean IsDelete

When true, removes the existing discount entry.

Long? LineNumber

Line number on the discount.

formatint64
Float? Price

Discounted price value.

formatfloat
string? ProductNumber

The product number this discount applies to.

DateTimeOffset? ValidFrom

Start of the discount’s validity period.

formatdate-time
DateTimeOffset? ValidTo

End of the discount’s validity period.

formatdate-time
Boolean isExpireDiscounts

Header param: When true, expires related active discount rows not refreshed in this import.

Boolean isFlush

Header param: When true, removes existing discount prices before inserting.

ReturnsExpand Collapse
class ProductCreateDiscountPricesResponse:

Standard success response returned by mutation endpoints.

required Boolean Success

Indicates whether the operation completed successfully.

string? Data

Optional data payload returned by the operation.

string? Message

Human-readable message describing the result.

Create Discount Prices

ProductCreateDiscountPricesParams parameters = new();

var response = await client.Products.CreateDiscountPrices(parameters);

Console.WriteLine(response);
{
  "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."
}