Promotions and Vouchers
Promotions
PromotionResponse
Declared In:
Headers/SNRPromotionResponse.h
Related To:
PromotionResponseMetadata
Promotion
Inherits From:
BaseModel
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:
Headers/SNRPromotionResponseMetadata.h
Related To:
PromotionResponse
Inherits From:
BaseModel
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:
Headers/SNRPromotion.h
Related To:
PromotionResponse
PromotionStatus
PromotionType
PromotionDetails
PromotionItemScope
PromotionDiscountType
PromotionDiscountMode
PromotionDiscountModeDetails
PromotionImage
Inherits From:
BaseModel
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 customer |
| 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 | Date when the promotion expires for the current profile |
| lastingTime | NSNumber | yes | Duration of the promotion in seconds |
| displayFrom | String | yes | Date as a string when the promotion starts being displayed |
| displayTo | String | yes | Date as a 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 |
PromotionStatus
Declared In:
Headers/SNRPromotionStatus.h
Related To:
Promotion
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:
Headers/SNRPromotionType.h
Related To:
Promotion
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:
Headers/SNRPromotionItemScope.h
Related To:
Promotion
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:
Headers/SNRPromotionDetails.h
Related To:
Promotion
PromotionDiscountTypeDetails
Inherits From:
BaseModel
Declaration:
class PromotionDetails: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| discountType | PromotionDiscountTypeDetails | no | Discount details |
PromotionDiscountTypeDetails
Declared In:
Headers/SNRPromotionDiscountTypeDetails.h
Related To:
PromotionDetails
Inherits From:
BaseModel
Declaration:
class PromotionDiscountTypeDetails: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| name | String | no | Discount’s name |
| outerScope | Bool | no | When true, the items required to trigger the promotion are different than the items included in that promotion. |
| requiredItemsCount | Int | no | Number of items required to qualify for the discount |
| discountedItemsCount | Int | no | Number of discounted items |
PromotionDiscountMode
Declared In:
Headers/SNRPromotionDiscountType.h
Related To:
Promotion
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:
Headers/SNRPromotionDiscountModeDetails.h
Related To:
Promotion
PromotionDiscountStep
Inherits From:
BaseModel
Declaration:
class PromotionDiscountModeDetails: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| discountSteps | [SNRPromotionDiscountStep] | no | List of discount steps |
| discountUsageTrigger | PromotionDiscountUsageTrigger | no | Usage trigger for the discount |
PromotionDiscountStep
Declared In:
Headers/SNRPromotionDiscountStep.h
Related To:
PromotionDiscountModeDetails
Inherits From:
BaseModel
Declaration:
class PromotionDiscountStep: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| discountValue | NSNumber | no | Value of the discount |
| usageThreshold | NSNumber | no | Usage threshold |
PromotionDiscountUsageTrigger
Declared In:
Headers/SNRPromotionDiscountUsageTrigger.h
Related To:
PromotionDiscountModeDetails
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:
Headers/SNRPromotion.h
Related To:
Promotion
PromotionImageType
Inherits From:
BaseModel
Declaration:
class PromotionImage: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| url | String | no | Image’s URL |
| type | PromotionImageType | no | Image type |
PromotionImageType
Declared In:
Headers/SNRPromotionImageType.h
Related To:
Promotion
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:
Headers/SNRPromotionDiscountType.h
Related To:
Promotion
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
PromotionIdentifier
Declared In:
Headers/SNRPromotionIdentifier.h
Inherits From:
BaseModel
Declaration:
class PromotionIdentifier: BaseModel
Initializers:
init(uuid: String)
init(code: String)
PromotionsApiQuery
Object for setting parameters to facilitate fetching promotions from the API.
Declared In:
Headers/SNRPromotionsApiQuery.h
Related To:
PromotionResponse
Promotion
ApiQuerySortingOrderString
Inherits From:
NSObject
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:
Headers/SNRAssignVoucherResponse.h
Related To:
AssignVoucherData
Inherits From:
BaseModel
Declaration:
class AssignVoucherResponse: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| message | String | no | Message from the Voucher assignment response |
| assignVoucherData | AssignVoucherData | yes | List of vouchers in a pool |
VoucherCodesResponse
Declared In:
Headers/SNRVoucherCodesResponse.h
Related To:
SNRVoucherCodesData
Inherits From:
BaseModel
Declaration:
class VoucherCodesResponse: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| items | [VoucherCodesData] | no | List of voucher items |
AssignVoucherData
Declared In:
Headers/SNRAssignVoucherData.h
Related To:
AssignVoucherResponse
Inherits From:
BaseModel
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 redemption 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:
Headers/SNRVoucherCodesData.h
Inherits From:
BaseModel
Declaration:
class VoucherCodesData: BaseModel
Properties:
| Property | Type | Optional | Description |
|---|---|---|---|
| code | String | no | Voucher’s code |
| status | VoucherStatus | no | Voucher’s status |
| clientId | String | no | ID of the customer to whom the voucher is assigned |
| clientUuid | String | no | UUID of the customer to whom the voucher is assigned |
| 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:
Headers/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