getDiscountByMarker
Getting a single discount object by its textual identifier (marker).
Description
This method retrieves a single discount object by its textual identifier (marker). It returns a Promise that resolves to an IDiscountEntity object.
Discounts.getDiscountByMarker(
marker*,
langCode
);
Parameters schema
Schema
marker(required): string
Textual identifier of the discount storage object
example: "discount_storage"
langCode: string
Language code. Default: "en_US"
example: "en_US"
Examples
Minimal example
const response = await Discounts.getDiscountByMarker('summer_sale');
Example with attributes
const response = await Discounts.getDiscountByMarker('summer_sale', 'en_US');
Example response
{
"id": 1,
"type": "DISCOUNT",
"attributeSetId": 31,
"conditionLogic": "AND",
"discountValue": {
"value": 10,
"maxAmount": 5,
"discountType": "FIXED_AMOUNT",
"applicability": "TO_PRODUCT"
},
"exclusions": null,
"gifts": null,
"giftsReplaceCartItems": false,
"userGroups": null,
"userExclusions": null,
"localizeInfos": {
"title": "Example discount"
},
"version": 0,
"total": "1",
"identifier": "example_discount",
"startDate": "2026-03-14T14:55:19.928Z",
"endDate": "2026-07-31T13:55:24.647Z",
"attributeValues": {
"example_discount": {
"type": "string",
"value": "test value",
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
}
},
"conditions": [],
"bonusEvent": null,
"position": 1
}
Response schema
Schema: IDiscountsEntity
id: number
The unique identifier of the discount.
attributeSetId: number
The identifier of the discount.
localizeInfos: ILocalizeInfo
The name of the discount.
version: number
The version of the discount.
identifier: string
The identifier of the discount.
type: IDiscountType
The type of the discount.
startDate: string
The start date of the discount.
endDate: string
The end date of the discount.
discountValue: IDiscountValue
The value of the discount, including its type and amount limits.
discountValue.applicability: 'TO_PRODUCT' | 'TO_ORDER'
What the discount applies to.
example: "TO_PRODUCT"
discountValue.discountType: 'FIXED_AMOUNT' | 'PERCENT'
How the discount value is interpreted.
example: "FIXED_AMOUNT"
discountValue.value: number
Discount amount (currency units for FIXED_AMOUNT, percentage points for PERCENT).
example: 10
discountValue.maxAmount: number
Optional cap on the absolute discount applied.
example: 5
conditionLogic: string
The logic of the discount. Possible values are "AND" | "OR".
conditions: IDiscountCondition[]
The conditions of the discount.
conditions.type: string
The type of discount condition.
conditions.value: string
The value associated with the discount condition.
exclusions: Record<string, unknown> | null
The exclusions of the discount.
gifts: Record<string, unknown> | null
The gifts of the discount.
giftsReplaceCartItems: boolean
Whether the gifts replace cart items.
userGroups: Record<string, unknown> | null
The user groups of the discount.
userExclusions: Record<string, unknown> | null
The user exclusions of the discount.
attributeValues: IAttributeValues
The attribute values of the discount.
attributeSetIdentifier: string
The identifier of the attribute set.
bonusEvent: Record<string, unknown>
Bonus event configuration.
position: number
Position number for sorting.
example: 1
total: number | string
Total count of related entries.
example: "1"