Updating Discount Profile
Endpoint: PUT /admin/discount_profiles/{profile_id}
Purpose
This API allows administrators to update an existing discount profile by its ID. Updates may include discount name, activation period, coupon code settings, usage limits, discount type, applicable products or customers, and other promotional configurations. This helps manage targeted campaigns and ensure proper discount application.
Path Parameters
Parameter | Type | Description |
---|---|---|
id |
Integer | The unique ID of the discount profile to update |
Query Parameters
None.
Use Case
Used by administrators to revise discount strategies — for example, changing the discount amount, start and end dates, setting coupon rules, or targeting specific products/customers. This enables flexible, strategic promotions across the platform.
Request Body
Field | Type | Description |
---|---|---|
name | string | Name of the discount profile. |
amount_details | object | Contains amount discount details. |
apply_to | string | Whether it applies to selected products or categories. |
type | string | Type of amount discount. |
singleAmount | number | The discount amount |
singleAmountType | string | Whether it's a FLAT amount or PERCENT. |
{
"name": "DISCOUNT_NAME",
"is_active": true,
"start_date": "START_DATE",
"is_specify_end_date": true,
"end_date": "END_DATE",
"type": "CUSTOMER_TYPE",
"is_exclude_products_on_sale": false,
"is_used_with_other_discounts": false,
"is_maximum_use_limit": true,
"maximum_use_limit": MAXIMUM_USE_LIMIT,
"is_maximum_use_limit_by_customer": true,
"maximum_use_limit_by_customer": MAXIMUM_USE_LIMIT_BY_CUSTOMER,
"is_maximum_discount_allowed": true,
"maximum_discount_allowed": MAXIMUM_DISCOUNT_ALLOWED,
"is_apply_coupon_code": true,
"is_coupon_code_auto_generated": true,
"is_unique_coupon_code": false,
"unique_coupon_code": false,
"is_applied__to_all_customer": true,
"customers": [],
"is_applied_to_all_products": true,
"products": [],
"discount_Details_Type": "DISCOUNT_DETAILS_TYPE",
"amount_details": {
"apply_to": "APPLY_TO",
"type": "AMOUNT_TYPE",
"singleAmount": SINGLE_AMOUNT,
"singleAmountType": "SINGLE_AMOUNT_TYPE"
}
}
Response
The response returns the updated discount profile, including key configurations such as name, status (is_active), type (customer), and defined start and end dates. It also details coupon-related settings like auto-generation, default coupon code, and usage limitations per customer and overall. The discount structure is reflected through the amount_details, specifying flat discount type, application to selected products, and the exact amount.
{
"discount": {
"display_text_coupon": null,
"is_maximum_use_total": true,
"usage": [],
"display_text_partial_discount_condition": null,
"is_active": true,
"type": "DISCOUNT_TYPE",
"is_display_text_coupon": false,
"is_specify_end_date": true,
"start_to": "END_DATE",
"details_id": DETAILS_ID,
"customer_coupons": [],
"is_coupon_code_auto_generate": true,
"is_exclude_products_on_sale": false,
"assoc": ASSOC_ID,
"is_apply_coupon_code": true,
"is_display_text_partial_discount_condition": false,
"details": {
"single_amount_type": "SINGLE_AMOUNT_TYPE",
"apply_to": "APPLY_TO",
"tiers": [],
"single_amount": SINGLE_AMOUNT,
"minimum_amount_on": "MINIMUM_AMOUNT_ON",
"id": DETAILS_ID,
"type": "AMOUNT_TYPE"
},
"id": DISCOUNT_ID,
"is_maximum_discount_allowed": true,
"start_from": "START_DATE",
"coupon": COUPON_ID,
"default_coupon_code": "DEFAULT_COUPON_CODE",
"display_text_cart": null,
"maximum_discount_allowed_amount": MAXIMUM_DISCOUNT_ALLOWED,
"is_imported_coupon": false,
"is_display_text_cart": false,
"is_maximum_use_customer": true,
"discount_details_type": "DISCOUNT_DETAILS_TYPE",
"is_display_discount_information_prod_detail": false,
"is_create_unique_coupon_each_customer": false,
"maximum_use_count": MAXIMUM_USE_LIMIT,
"name": "DISCOUNT_NAME",
"is_discount_used_with_other_discount": false,
"maximum_use_customer_count": MAXIMUM_USE_LIMIT_BY_CUSTOMER,
"exclude_products": []
}
}