Get discount by code
GET/openapi/2026-01/discounts/by-code/:discount_code
Gets a discount by discount code.
Request
Path Parameters
Discount code used for lookup, read from URL path
Responses
- 200
OK
- application/json
- Schema
- Example
Schema
product: Product discountorder: Order discountshipping: Shipping discountbuy_one_get_one: Buy one get onebuy_x_get_y: Buy X get Ybundle: Bundle discountrebate: Rebate discountm_n_discount: M-for-N discountflash_sale: Flash salecode: Discount codecoupon_old: Legacy couponplugin_old: Legacy pluginrebate_old: Legacy rebatecycle_subscribe_old: Legacy cycle subscriptionrebate_cta_otr: Amount-threshold fixed reductionrebate_ctq_otr: Quantity-threshold fixed reductionrebate_cta_otp: Amount-threshold percentage discountrebate_ctq_otp: Quantity-threshold percentage discountm_n_discount: M-for-N discountflashsale: Flash sale discountcode_percent: Discount-code percentage discountcode_fix_price_reduction: Discount-code fixed reductioncode_bxgy: Discount-code buy X get Ycode_free_shipping: Discount-code free shippingautomatic: Applied automaticallydiscount_code: Applied by discount codeongoing: Ongoingnot_started: Not startedfinished: Finishedpaused: Pausedentitled: Only entitled products are includedexclude: Entitled products are excludedall: All products are includedproduct: Follow product stockdiscount: Use discount stockentitled: Only entitled products are includedexclude: Entitled products are excludedall: All products are includedproduct: Follow product stockdiscount: Use discount stockno_limit: No per-product purchase limitcustomer_all_product: Per customer per discount, accumulated across all eligible variantscustomer_product: Per customer per discount per productcustomer_variant: Per customer per discount per variantproduct: use product stockdiscount: set a custom promotion stockprice: Use sale pricecompare_at_price: Use compare-at/original pricedesc: Apply by product price in descending orderasc: Apply by product price in ascending orderproduct: Can combine with product discountsorder: Can combine with order discountsshipping: Can combine with shipping discountshighest: Apply the highest matched layer onlyall: Apply all matched layershighest_all: Apply all matched layers; quantities above the highest layer use the highest-layer benefitno_condition: No condition requiredpurchase_quantity: Requires purchase quantitypurchase_amount: Requires purchase amountno_discount: No discountfree_acquisition: Free acquisitionpercent: Percentage discountfixed_price_reduction: Fixed amount reductionfixed_price: Fixed final pricefixed_quantity: Fixed quantity grantedproduct_price_reduction: Product-level price reduction- Array [
- ]
- Array [
- ]
error code
error message
data object
discount object
Discount detail payload returned by code lookup
discount_info object
Core discount information
Discount ID
Merchant-facing discount name
Storefront display name
Discount target category:
Discount category, top-level discount type:
Discount type identifier:
Discount application method identifier:
Primary discount code
All discount codes under this discount
Start datetime string in center/store format
End datetime string in center/store format
Start timestamp
End timestamp
Creation datetime string
Last update datetime string
Whether this discount is old discount
Current progress status:
Whether all customers are enabled
Backoffice visibility marker
Number of times this discount has been used
entitled_customer object
Customer scope of the discount
Explicit customer IDs that can use the discount
Customer segment IDs that can use the discount
entitled_product object
Product scope of the discount
Product IDs included in the entitled scope
Variant IDs included in the entitled scope
Collection IDs included in the entitled scope
sort object
Sorting settings for entitled products
The field used to sort selected products
The sort direction
If non-empty, sort by time range for legacy flash sale compatibility. Unit: seconds
Selection strategy identifier:
sku_extends object
Per-variant extended settings keyed by variant ID
property name* SkuExtendResp
Discount value for this variant. Currently only supports fixed price reduction; stored as a string
Minimum purchase quantity for this variant
Custom display sequence number for sorting
Virtual sales count configured for this variant
Whether the activity stock follows the product stock:
Activity-level stock limit for this variant
Collection ID if this variant was selected via a collection
obtain_product object
Product scope that receives the obtained benefit. Only present for automatic discounts
Product IDs included in the entitled scope
Variant IDs included in the entitled scope
Collection IDs included in the entitled scope
sort object
Sorting settings for entitled products
The field used to sort selected products
The sort direction
If non-empty, sort by time range for legacy flash sale compatibility. Unit: seconds
Selection strategy identifier:
sku_extends object
Per-variant extended settings keyed by variant ID
property name* SkuExtendResp
Discount value for this variant. Currently only supports fixed price reduction; stored as a string
Minimum purchase quantity for this variant
Custom display sequence number for sorting
Virtual sales count configured for this variant
Whether the activity stock follows the product stock:
Activity-level stock limit for this variant
Collection ID if this variant was selected via a collection
discount_rule object
Rule settings for limit and behavior
Maximum total usage count of the discount; -1 means unlimited
Maximum usage count per customer; -1 means unlimited
Maximum usage count per order; -1 means unlimited
Per-customer product limit strategy type:
Max times a customer can purchase each eligible product under the discount
Discount stock when stock-based limiting is enabled
Whether the promotion stock follows the product stock:
Virtual sales value used for display or ranking
Price base used for discount calculation:
Reserved extension payload
Product ordering strategy used when applying discounts:
Other discount categories that can be combined:
Whether all required items must be fully met
Scope strategy for multi-layer discount evaluation:
Maximum usage count per discount code; -1 means unlimited. Only applicable to non-automatic discounts
Maximum usage count per customer per discount code. Only applicable to non-automatic discounts
Whether per-product extension discount settings are enabled
discount_layer object
Layered discount settings
Condition type:
Benefit type:
layers object[]
Layered discount rules from lower to higher thresholds
Condition threshold value for this layer
Discount value granted when the condition is met
Number of items granted as the discount benefit
discount_combine object
Combined-discount settings
Whether this discount can be combined with other promotions
entitled_area object
Geographic areas where the discount can be applied. Only present for non-automatic discounts
areas object[]
Geographic areas where the discount can be applied
ISO country code
Province or region codes under the country
{
"code": "string",
"message": "string",
"data": {
"discount": {
"discount_info": {
"id": "string",
"discount_name": "string",
"display_name": "string",
"discount_target": "string",
"category": "string",
"discount_type": "string",
"discount_method": "string",
"discount_code": "string",
"discount_codes": [
"string"
],
"starts_date": "string",
"ends_date": "string",
"starts_at": 0,
"ends_at": 0,
"created_at": "string",
"updated_at": "string",
"is_old_discount": true,
"progress": "string",
"enable_all_customer": true,
"is_show_admin": "string",
"time_used": 0
},
"entitled_customer": {
"customer_ids": [
"string"
],
"customer_segment_ids": [
"string"
]
},
"entitled_product": {
"product_ids": [
"string"
],
"variant_ids": [
"string"
],
"collection_ids": [
"string"
],
"sort": {
"by": "string",
"direction": "string",
"before": "string"
},
"selection": "string",
"sku_extends": {}
},
"obtain_product": {
"product_ids": [
"string"
],
"variant_ids": [
"string"
],
"collection_ids": [
"string"
],
"sort": {
"by": "string",
"direction": "string",
"before": "string"
},
"selection": "string",
"sku_extends": {}
},
"discount_rule": {
"limit_max_discount": 0,
"limit_user_discount": 0,
"limit_order_discount": 0,
"limit_user_product_type": "string",
"limit_user_product_discount": 0,
"stock": 0,
"follow_stock": "string",
"virtual_sales": 0,
"price_rule": "string",
"extends": "string",
"product_discount_order": "string",
"discount_combines": [
"string"
],
"obtain_full": true,
"mn_discount_scope": "string",
"limit_code_max_discount": 0,
"limit_code_user_discount": 0,
"enable_product_extends": true
},
"discount_layer": {
"condition_type": "string",
"obtain_type": "string",
"layers": [
{
"condition_value": "string",
"obtain_value": "string",
"obtain_count": 0
}
]
},
"discount_combine": {
"use_with_other": true
},
"entitled_area": {
"areas": [
{
"country_code": "string",
"province_codes": [
"string"
]
}
]
}
}
}
}