Creating Discount profile
Endpoint: POST /admin/discount_profiles
Purpose
This endpoint allows administrators to create a new discount profile, including its name, rules, coupon settings, usage limits, and discount details. It supports configuring flat or tiered discounts applicable to products or orders.
Path Parameters
This endpoint does not require any path parameters.
Query Parameters
This endpoint does not require any query parameters.
Use Case
An admin sets up a new discount campaign or promotion by defining how the discount applies, any coupon settings, usage limits, and product or customer scope. This is useful for running targeted marketing promotions, loyalty discounts, or seasonal offers.
{
"name": "DISCOUNT_NAME",
"is_active": true,
"start_date": "START_DATETIME",
"is_specify_end_date": true,
"end_date": "END_DATETIME",
"type": "customer",
"is_exclude_products_on_sale": false,
"is_used_with_other_discounts": false,
"is_maximum_use_limit": true,
"maximum_use_limit": 10,
"is_maximum_use_limit_by_customer": true,
"maximum_use_limit_by_customer": 10,
"is_maximum_discount_allowed": true,
"maximum_discount_allowed": 10.0,
"is_apply_coupon_code": true,
"is_coupon_code_auto_generated": true,
"default_coupon_code": "COUPON_CODE",
"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": "amount",
"amount_details": {
"apply_to": "selected_products",
"type": "single",
"singleAmount": 10,
"singleAmountType": "FLAT"
}
}
Response
The response returns the created discount profile, including its configuration, status, coupon behavior, discount type and amount, and flags for visibility and application. This ensures full visibility of the created promotion and allows immediate use in the system.
{
"discount": {
"id": DISCOUNT_ID,
"name": "DISCOUNT_NAME",
"type": "DISCOUNT_TYPE",
"is_active": IS_ACTIVE,
"discount_details_type": "DISCOUNT_AMOUNT_TYPE",
"default_coupon_code": "COUPON_CODE",
"is_apply_coupon_code": IS_COUPON_REQUIRED,
"is_coupon_code_auto_generate": IS_AUTO_GENERATE,
"is_exclude_products_on_sale": IS_EXCLUDE_SALE_PRODUCTS,
"is_maximum_discount_allowed": IS_MAX_DISCOUNT_ENABLED,
"maximum_discount_allowed_amount": MAX_DISCOUNT_AMOUNT,
"is_maximum_use_total": IS_MAX_USE_TOTAL,
"maximum_use_count": MAX_USE_COUNT,
"is_maximum_use_customer": IS_MAX_USE_PER_CUSTOMER,
"maximum_use_customer_count": MAX_USE_CUSTOMER_COUNT,
"is_discount_used_with_other_discount": IS_COMBINABLE,
"is_specify_end_date": IS_END_DATE_SPECIFIED,
"start_from": "START_DATE",
"start_to": "END_DATE",
"details_id": DETAILS_ID,
"coupon": COUPON_ID,
"assoc": ASSOCIATION_ID,
"details": {
"id": DETAILS_ID,
"type": "DETAIL_TYPE",
"apply_to": "APPLY_TO_SCOPE",
"single_amount_type": "FLAT",
"single_amount": DISCOUNT_AMOUNT,
"tiers": [],
"minimum_amount_on": "each_item"
},
"customer_coupons": [],
"exclude_products": [],
"usage": [],
"is_imported_coupon": false,
"is_create_unique_coupon_each_customer": false,
"is_display_text_coupon": false,
"display_text_coupon": null,
"is_display_text_cart": false,
"display_text_cart": null,
"is_display_text_partial_discount_condition": false,
"display_text_partial_discount_condition": null,
"is_display_discount_information_prod_detail": false
}
}