Getting discount profile list
Endpoint: GET /admin/discount_profiles
Purpose
This endpoint retrieves a list of discount profiles configured in the system. Discount profiles include rules, conditions, and coupon configurations used to apply promotional discounts to customer purchases.
Path Parameters
This endpoint does not require any path parameters
Query Parameters
Field | Type | Description |
---|---|---|
limit | integer | Maximum number of discount profiles to return per request (default: 20) |
offset | integer | Starting point for fetching discount profiles (used for pagination) |
order_by | string | Field to sort by (created_at, name) |
direction | string | Sort direction (asc or desc) |
Use Case
An admin retrieves the list of all configured discount profiles, including flat rate or tiered discounts, coupon details, usage restrictions, and applicability. This helps in managing promotional strategies, analyzing active/inactive offers, and setting up new marketing campaigns.
Request Body
This endpoint does not require a request body.
Response
The response contains a list of discount profiles, each with details such as discount amount, type ( FLAT), whether a coupon is required, usage limits, and product applicability. Profiles also include flags for start dates, exclusions, display texts, and whether discounts can be combined with others. This allows for comprehensive management of marketing discounts and promotional rules in the system.
{
"discounts": [
{
"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",
"is_display_text_coupon": IS_DISPLAY_TEXT_COUPON,
"display_text_coupon": "COUPON_DISPLAY_TEXT",
"is_display_text_cart": IS_DISPLAY_TEXT_CART,
"display_text_cart": "CART_DISPLAY_TEXT",
"is_display_text_partial_discount_condition": IS_PARTIAL_TEXT,
"display_text_partial_discount_condition": "PARTIAL_DISCOUNT_TEXT",
"is_display_discount_information_prod_detail": IS_DISPLAY_ON_PRODUCT,
"is_create_unique_coupon_each_customer": IS_UNIQUE_COUPON_PER_CUSTOMER,
"is_imported_coupon": IS_IMPORTED,
"exclude_products": [],
"details": {
"id": DETAILS_ID,
"type": "DETAIL_TYPE",
"apply_to": "APPLY_TO_SCOPE",
"single_amount_type": "FLAT",
"single_amount": DISCOUNT_AMOUNT,
"tiers": [],
"minimum_amount_on": "MINIMUM_CONDITION"
}
}
]
}
Getting specific discount profile by id
Endpoint: GET /admin/discount_profiles/{profile_id}
Purpose
This endpoint retrieves detailed information about a specific discount profile, including its configuration, rules, coupon usage, and discount amount settings. It is used to view or manage the full definition of a discount rule applied to customer orders.
Path Parameters
Field | Type | Description |
---|---|---|
profile_id | integer | The unique identifier of the discount profile |
Query Parameters
This endpoint does not require any query parameters.
Use Case
A user retrieves the full configuration of a single discount profile for review, editing, or analysis. This is useful for managing existing discount logic, including coupon settings, applicability rules, limits, and how the discount is applied to products or orders.
Request Body
This endpoint does not require a request body.
Response
The response provides complete information about the discount profile, including activation status, discount type, discount value, applicability to products/orders, usage restrictions, and coupon settings. It also includes whether coupons are required, the discount can be combined, or display texts are shown, helping businesses maintain transparent and effective promotional rules.
{
"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",
"is_display_text_coupon": IS_DISPLAY_TEXT_COUPON,
"display_text_coupon": "COUPON_DISPLAY_TEXT",
"is_display_text_cart": IS_DISPLAY_TEXT_CART,
"display_text_cart": "CART_DISPLAY_TEXT",
"is_display_text_partial_discount_condition": IS_PARTIAL_TEXT,
"display_text_partial_discount_condition": "PARTIAL_DISCOUNT_TEXT",
"is_display_discount_information_prod_detail": IS_DISPLAY_ON_PRODUCT,
"is_create_unique_coupon_each_customer": IS_UNIQUE_COUPON_PER_CUSTOMER,
"is_imported_coupon": IS_IMPORTED,
"exclude_products": [],
"details": {
"id": DETAILS_ID,
"type": "DETAIL_TYPE",
"apply_to": "APPLY_TO_SCOPE",
"single_amount_type": "FLAT",
"single_amount": DISCOUNT_AMOUNT,
"tiers": [],
"minimum_amount_on": "MINIMUM_CONDITION"
},
"usage": [],
"customer_coupons": [],
"assoc": ASSOCIATION_ID,
"coupon": COUPON_ID
}
}