Field | Type | Description | Example |
---|
allocation_limit | number | Allocation limit. | 10 |
allocation_limit_amount | string | Allocation limit amount. | "100.00" |
allocation_method | string | Allocation method. | "manual" |
buysPrerequisiteValue | number | Value required to meet the prerequisite for the discount. | 5 |
code | string | Coupon code. | "SAVE10" |
config | Config Object | Coupon display configuration. | See Config interface. |
customer_selection | string | Customer selection. | "all" |
discount_type | DiscountType | Discount threshold type (enum). | "percentage" |
ends_at | number | End time. -1 indicates long-term validity. | -1 |
entitled_area_list | string[] | List of applicable areas. | ["US", "CA"] |
entitled_collection_ids | string[] | IDs of applicable collections. | ["123", "456"] |
entitled_extra_list | null | Extra applicable conditions. | null |
entitled_product_ids | string[] | IDs of applicable products. | ["789", "101"] |
entitled_sort | string[] | Sorting of entitled products. | ["price", "popularity"] |
entitled_variant_ids | string[] | IDs of applicable product variants. | ["111", "222"] |
getsDiscountValue | number | Discount value received. | 10 |
getsMaxOrderUseValue | number | Maximum order use value. | 100 |
is_admin_show | number | Whether it is shown in admin view. | 1 |
life_cycle_type | string | Lifecycle type: begin_end or survival . | "begin_end" |
once_per_customer | number | Limit per customer. | 1 |
only_valid_first_order_customer | boolean | Whether it is valid only for the customer's first order. | false |
prerequisite | number | Whether there is a discount threshold (1: yes, 0: no). | 1 |
prerequisite_customer_ids | string[] | IDs of applicable customers. | ["customer1", "customer2"] |
prerequisite_customer_range | null | Range of applicable customers. | null |
prerequisite_customer_segment_ids | string[] | IDs of applicable customer segments. | ["segment1", "segment2"] |
prerequisite_quantity_range | Array of PrerequisiteQuantityRange | Thresholds for quantity. | See PrerequisiteQuantityRange . |
prerequisite_subtotal_range | PrerequisiteSubtotalRange[] | Thresholds for subtotal. | See PrerequisiteSubtotalRange . |
progress | string | Coupon status (use this field instead of status ).Activity status: ongoing in progress, not_started not started, finished ended, | "ongoing" |
sort | Sort | Product sorting. | See Sort . |
starts_at | number | Start time. Relevant for life_cycle_type=survival . | 1673246985 |
status | number | Deprecated: Internal field for coupon status. Use progress instead. | 0 |
stock | number | Remaining stock. | 50 |
store_id | number | Store ID. | 11218 |
survival_time | number | Valid time (in seconds). Relevant for life_cycle_type=survival . | 86400 |
target_selection | string | Target range (e.g., all for all products). | "all" |
target_type | string | Type of target. | "product" |
times_used | number | Number of times the coupon has been used. | 10 |
tips | Tips | Additional tips for the coupon. | See Tips . |
title | string | Title of the coupon. | "Spring Sale" |
usage_limit | number | Usage limit. -1 indicates no limit. | -1 |
use_with_other | number | Whether it can be used with other discounts (1: yes, 0: no). | 0 |
using_state | string | Current state of usage. | "active" |
value | number | Rule discount value. For thresholds, this is 0 . | 10 |
value_type | ValueType | Type of discount value (enum). | "percentage" |
Field | Type | Description | Example |
---|
banner_size | string | Size of the banner. | "large" |
banner_url | string | URL of the banner image. | "https://example.com/banner.jpg" |
count_down | CountDown | Countdown display configuration. | See CountDown . |
Field | Type | Description | Example |
---|
background_color_end | string | End color for the background. | "#FFFFFF" |
background_color_start | string | Start color for the background. | "#000000" |
color | string | Text color. | "#FF0000" |
count_down_background_color | string | Background color for the countdown. | "#333333" |
count_down_color | string | Countdown text color. | "#00FF00" |
detail_page_show_code | boolean | Whether the code is shown on detail pages. | true |
format | string | Format of the countdown. | "DD:HH:MM" |
show_count_down | boolean | Whether to display the countdown. | true |
Field | Type | Description | Example |
---|
greater_than_or_equal_to | string | Minimum quantity threshold. | "5" |
value | string | Discount value (e.g., amount or percentage). | "10%" |
Field | Type | Description | Example |
---|
greater_than_or_equal_to | string | Minimum subtotal threshold. | "100" |
value | string | Discount value (e.g., amount or percentage). | "15%" |
Field | Type | Description | Example |
---|
by | string | Sort by this field. | "sales" |
direction | string | Sort direction (asc or desc ). | "desc" |
Field | Type | Description | Example |
---|
copy_code | string | Message to copy the code. | "Copy the code!" |
countdown | string | Countdown message. | "Limited time!" |
countdown_day | string | Countdown in days. | "2 days left" |
msg | string | General message. | "Enjoy your discount!" |
use_code | string | Instructions for using the code. | "Apply at checkout" |
Value | Description | Example |
---|
amount_percentage | Discount as a percentage. | "10%" |
fixed_amount | Fixed discount amount. | "5.00" |
item_fixed_amount | Fixed discount for items. | "2.00" |
percentage | Percentage discount. | "20%" |
Value | Description | Example |
---|
fixed_amount | Fixed discount amount. | "5.00" |
percentage | Percentage discount. | "15%" |
{
"title": "新的优惠券",
"code": "",
"value": 11,
"life_cycle_type": "survival",
"starts_at": 1673335773,
"ends_at": -1,
"survival_time": 86400,
"value_type": "percentage",
"prerequisite": 0,
"usage_limit": -1,
"once_per_customer": 0,
"target_selection": "all",
"progress": "",
"using_state": "",
"entitled_area_list": [],
"target_type": "line_item",
"prerequisite_quantity_range": [
{
"greater_than_or_equal_to": "",
"value": ""
}
],
"prerequisite_subtotal_range": [
{
"greater_than_or_equal_to": "",
"value": ""
}
],
"entitled_product_ids": [],
"entitled_variant_ids": [],
"entitled_sort": [],
"times_used": 0,
"stock": -1,
"sort": {
"by": "sales",
"direction": "desc"
},
"use_with_other": 0,
"prerequisite_customer_ids": [],
"prerequisite_customer_segment_ids": [],
"config": {
"banner_url": "",
"banner_size": "fill",
"count_down": {
"show_count_down": true,
"format": "HH:mm:ss:SSS",
"background_color_start": "rgba(255, 248, 232, 1)",
"background_color_end": "rgba(255, 230, 172, 1)",
"color": "rgba(249, 103, 69, 1)",
"count_down_background_color": "rgba(249, 103, 69, 1)",
"count_down_color": "rgba(255, 255, 255, 1)",
"detail_page_show_code": false
}
},
"store_id": 180543,
"status": 0,
"discount_type": "percentage",
"is_admin_show": 0,
"allocation_limit_amount": "0",
"allocation_method": "",
"allocation_limit": 0,
"customer_selection": "",
"entitled_collection_ids": [],
"tips": {
"msg": "",
"countdown": "",
"countdown_day": "",
"use_code": "",
"copy_code": ""
},
"entitled_extra_list": null,
"prerequisite_customer_range": null,
"buysPrerequisiteValue": 0,
"getsMaxOrderUseValue": 0,
"getsDiscountValue": 0,
"only_valid_first_order_customer": false
}