Promotions and Vouchers
Promotions
PromotionResponse
Declared In
SNRPromotionResponse.h
Related To
PromotionResponseMetadata
Promotion
Inherits From
Declaration
class PromotionResponse: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
metadata | PromotionResponseMetadata |
yes | Metadata of the promotion response |
items | [Promotion] |
no | List of promotion items |
PromotionResponseMetadata
Declared In
SNRPromotionResponseMetadata.h
Related To
Inherits From
Declaration
class PromotionResponseMetadata: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
totalCount | Int |
no | Total count of promotions |
totalPages | Int |
no | Total count of pages |
page | Int |
no | Current page |
limit | Int |
no | Limit of promotions per page |
code | Int |
no | HTTP code of the response |
Promotion
Declared In
SNRPromotion.h
Related To
PromotionResponse
PromotionStatus
PromotionType
PromotionDiscountType
Inherits From
Declaration
class Promotion: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
uuid | String |
no | Promotion’s UUID |
code | String |
no | Promotion’s code |
status | PromotionStatus |
no | Promotion’s status |
type | PromotionType |
no | Promotion’s type |
details | PromotionDetails |
yes | Promotion’s details |
redeemLimitPerClient | NSNumber |
yes | Redemption limit per client |
redeemQuantityPerActivation | NSNumber |
yes | Redemption quantity per activation |
currentRedeemedQuantity | NSNumber |
no | Current redemption quantity |
currentRedeemLimit | NSNumber |
no | Current redemption limit |
activationCounter | NSNumber |
no | Promotion’s activation counter |
possibleRedeems | NSNumber |
no | Maximum number of promotion redemptions |
requireRedeemedPoints | NSNumber |
yes | Required redeemed points |
discountType | PromotionDiscountType |
no | Discount type |
discountValue | NSNumber |
no | Discount value |
discountMode | PromotionDiscountMode |
no | Discount mode |
discountModeDetails | PromotionDiscountModeDetails |
yes | Discount mode details |
priority | NSNumber |
no | Promotion’s priority |
price | NSNumber |
no | Item price |
itemScope | PromotionItemScope |
no | Promotion’s item scope |
minBasketValue | NSNumber |
yes | Minimum basket value |
maxBasketValue | NSNumber |
yes | Maximum basket value |
name | String |
no | Promotion’s name |
headline | String |
yes | Promotion’s headline |
descriptionText | String |
yes | Promotion’s description |
images | [PromotionImage] |
yes | List of promotion images |
startAt | Date |
yes | Start time of a promotion |
expireAt | Date |
yes | Expiration time of the promotion |
lastingAt | Date |
yes | How long the promotion lasts |
lastingTime | NSNumber |
yes | Duration of the promotion in seconds |
displayFrom | String |
yes | Date as string when the promotion starts being displayed |
displayTo | String |
yes | Date as string when the promotions ends being displayed |
catalogIndexItems | [String] |
yes | List of item indexes |
params | [AnyHashable: Any] |
yes | Promotion’s custom parameters |
tags | [AnyObject] |
yes | Promotion’s custom tags |
PromotionIdentifier
Declared In
SNRPromotionIdentifier.h
Inherits From
Declaration
class PromotionIdentifier: BaseModel
Initializers
init(uuid: String)
init(code: String)
PromotionStatus
Declared In
SNRPromotionStatus.h
Related To
Declaration
enum PromotionStatus: Int {
none,
active,
assigned,
redeemed
}
Functions
Converts from PromotionStatus
to String
.
func SNR_PromotionStatusToString(_: PromotionStatus) -> String
Converts from String
to PromotionStatus
.
func SNR_StringToPromotionStatus(_: String) -> PromotionStatus
Note
The following string constants can be used in PromotionsApiQuery
object:
SNR_PROMOTION_STATUS_NONE
SNR_PROMOTION_STATUS_ACTIVE
SNR_PROMOTION_STATUS_ASSIGNED
SNR_PROMOTION_STATUS_REDEEMED
PromotionType
Declared In
SNRPromotionType.h
Related To
Declaration
enum PromotionType: Int {
unknown,
membersOnly,
custom,
general,
handbill
}
Functions
Converts from PromotionType
to String
.
func SNR_PromotionTypeToString(_: PromotionType) -> String
Converts from String
to PromotionType
.
func SNR_StringToPromotionType(_: String) -> PromotionType
Note
The following string constants can be used in PromotionsApiQuery
object:
SNR_PROMOTION_TYPE_UNKNOWN
SNR_PROMOTION_TYPE_MEMBERS_ONLY
SNR_PROMOTION_TYPE_CUSTOM
SNR_PROMOTION_TYPE_GENERAL
PromotionItemScope
Declared In
SNRPromotionItemScope.h
Related To
Declaration
enum PromotionItemScope: Int {
lineItem,
basket
}
Functions
Converts from PromotionItemScope
to String
.
func SNR_PromotionItemScopeToString(_: PromotionItemScope) -> String
Converts from String
to PromotionItemScope
.
func SNR_StringToPromotionItemScope(_: String) -> PromotionItemScope
PromotionDetails
Declared In
SNRPromotionDetails.h
Related To
Promotion
PromotionDiscountTypeDetails
Inherits From
Declaration
class PromotionDetails: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
discountType | PromotionDiscountTypeDetails |
no | Discount details |
PromotionDiscountTypeDetails
Declared In
SNRPromotionDiscountTypeDetails.h
Related To
Inherits From
Declaration
class PromotionDiscountTypeDetails: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
name | String |
no | Discount’s name |
outerScope | Bool |
no | Outer scope |
requiredItemsCount | Int |
no | Number of required items to meet the discount |
discountedItemsCount | Int |
no | Number of discounted items |
PromotionDiscountMode
Declared In
SNRPromotionDiscountType.h
Related To
Declaration
enum PromotionDiscountMode: Int {
static,
step
}
Functions
Converts from PromotionDiscountMode
to String
.
func SNR_PromotionDiscountModeToString(_: PromotionDiscountMode) -> String
Converts from String
to PromotionDiscountMode
.
func SNR_StringToPromotionDiscountMode(_: String) -> PromotionDiscountMode
PromotionDiscountModeDetails
Declared In
SNRPromotionDiscountModeDetails.h
Related To
Promotion
PromotionDiscountStep
Inherits From
Declaration
class PromotionDiscountModeDetails: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
discountSteps | [SNRPromotionDiscountStep] |
no | List of discount steps |
discountUsageTrigger | PromotionDiscountUsageTrigger |
no | Usage trigger for discount |
PromotionDiscountStep
Declared In
SNRPromotionDiscountStep.h
Related To
Inherits From
Declaration
class PromotionDiscountStep: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
discountValue | NSNumber |
no | Value of discount |
usageThreshold | [NSNumber ] |
no | Usage threshold |
PromotionDiscountUsageTrigger
Declared In
SNRPromotionDiscountUsageTrigger.h
Related To
Declaration
enum PromotionDiscountUsageTrigger: Int {
transaction,
redeem
}
Functions
Converts from PromotionDiscountUsageTrigger
to String
.
func SNR_PromotionDiscountUsageTriggerToString(_: PromotionDiscountUsageTrigger) -> String
Converts from String
to PromotionDiscountUsageTrigger
.
func SNR_StringToPromotionDiscountUsageTrigger(_: String) -> PromotionDiscountUsageTrigger
PromotionImage
Declared In
SNRPromotion.h
Related To
Inherits From
Declaration
class PromotionImage: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
url | String |
no | Image’s URL |
type | PromotionImageType |
no | Image type |
PromotionImageType
Declared In
SNRPromotionImageType.h
Related To
Declaration
enum PromotionImageType: Int {
image,
thumbnail
}
Functions
Converts from PromotionImageType
to String
.
func SNR_PromotionImageTypeToString(_: PromotionImageType) -> String
Converts from String
to PromotionImageType
.
func SNR_StringToPromotionImageType(_: String) -> PromotionImageType
PromotionDiscountType
Declared In
SNRPromotionDiscountType.h
Related To
Declaration
enum PromotionDiscountType: Int {
none,
percent,
amount,
2For1,
points,
multibuy,
exactPrice
}
Functions
Converts from PromotionDiscountType
to String
.
func SNR_PromotionDiscountTypeToString(_: PromotionDiscountType) -> String
Converts from String
to PromotionDiscountType
.
func SNR_StringToPromotionDiscountType(_: String) -> PromotionDiscountType
PromotionsApiQuery
The object to set parameters easily for fetching promotions from API.
Declared In
SNRPromotionsApiQuery.h
Related To
Inherits From
Declaration
class PromotionsApiQuery: NSObject
Properties
Property | Type | Optional | Default | Description |
---|---|---|---|---|
statuses | [SNRPromotionStatusString] |
no | [] | List of promotion statuses for query |
types | [SNRPromotionTypeString] |
no | [] | List of promotion types for query |
sorting | [[SNRPromotionSortingKey: SNRApiQuerySortingOrderString]] |
yes | [] | Specifies sorting rules for items in the response |
limit | Int |
no | 100 | Limit of items per page in the response |
page | Int |
no | 1 | Page number |
includeMeta | Bool |
no | false | Specifies if meta data should be included in the response |
- Check the list of promotion sorting keys available in Loyalty - Promotion sorting options section.
- See
ApiQuerySortingOrderString
to check ordering options.
Initializers
init()
Vouchers
AssignVoucherResponse
Declared In
SNRAssignVoucherResponse.h
Related To
Inherits From
Declaration
class AssignVoucherResponse: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
message | String |
no | Message from Voucher assignment response |
assignVoucherData | AssignVoucherData |
yes | List of voucher data items |
VoucherCodesResponse
Declared In
SNRVoucherCodesResponse.h
Related To
Inherits From
Declaration
class VoucherCodesResponse: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
items | [VoucherCodesData] |
no | List of voucher items |
AssignVoucherData
Declared In
SNRAssignVoucherData.h
Related To
Inherits From
Declaration
class AssignVoucherData: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
code | String |
no | Voucher’s code |
expireIn | Date |
yes | Voucher’s expiration date |
redeemAt | Date |
yes | Voucher’s redeem date |
assignedAt | Date |
yes | Voucher’s assignment date |
createdAt | Date |
no | Voucher’s creation date |
updatedAt | Date |
no | Voucher’s update date |
VoucherCodesData
Declared In
SNRVoucherCodesData.h
Inherits From
Declaration
class VoucherCodesData: BaseModel
Properties
Property | Type | Optional | Description |
---|---|---|---|
code | String |
no | Voucher’s code |
status | VoucherStatus |
no | Voucher’s status |
clientId | String |
no | Voucher’s client ID |
clientUuid | String |
no | Voucher’s client UUID |
poolUuid | String |
no | Voucher’s pool ID |
expireIn | Date |
no | Voucher’s expiration date |
redeemAt | Date |
no | Voucher’s redemption date |
assignedAt | Date |
no | Voucher’s assignment date |
createdAt | Date |
no | Voucher’s creation date |
updatedAt | Date |
no | Voucher’s update date |
VoucherStatus
Declared In
SNRVoucherStatus.h
Declaration
enum VoucherStatus: Int {
unassigned,
assigned,
redeemed,
canceled
}
Functions
Converts from VoucherStatus
to String
.
func SNR_VoucherStatusToString(_: VoucherStatus) -> String
Converts from String
to VoucherStatus
.
func SNR_StringToVoucherStatus(_: String) -> VoucherStatus