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": [],
"position": 1
}
Response schema
Schema: IDiscountsEntity
id: number
The unique identifier of the discount.
attributeSetId: number
The identifier of the discount.
localizeInfos: object
The name of the discount.
version: number
The version of the discount.
identifier: string
The identifier of the discount.
type: string
The type of the discount.
startDate: string
The start date of the discount.
endDate: string
The end date of the discount.
discountValue: Record<string, unknown>
The value of the discount.
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: object
The exclusions of the discount.
gifts: object
The gifts of the discount.
giftsReplaceCartItems: boolean
Whether the gifts replace cart items.
userGroups: object
The user groups of the discount.
userExclusions: object
The user exclusions of the discount.
attributeValues: object
The attribute values of the discount.
attributeSetIdentifier: string
The identifier of the attribute set.