Loyalties
Loyalty card object
| Method | Type | Description |
|---|---|---|
| id | ID! |
|
| pk | Int |
|
| merchant | UserNode |
|
| stores | StoreNodeConnection! |
|
| storeGroups | StoreGroupNodeConnection! |
|
| products | ProductNodeConnection! |
|
| campaign | CampaignNode |
|
| name | String! |
|
| shortDescription | String |
|
| longDescription | String |
|
| placement | LoyaltyCardPlacement |
|
| startTime | DateTime! |
|
| endTime | DateTime! |
|
| redemptionCodeType | LoyaltyCardRedemptionCodeType! |
|
| enrollmentLimit | Int |
|
| repeatable | Boolean |
|
| repeatDelayHours | Int |
|
| dayStartTime | Time |
|
| dayEndTime | Time |
|
| daysOfWeek | [String] |
|
| weather | String |
|
| termsAndConditions | String |
|
| minimumSpendCurrency | LoyaltyCardMinimumSpendCurrency |
|
| minimumSpend | String |
|
| minPriceCurrency | LoyaltyCardMinPriceCurrency |
|
| minPrice | String |
|
| maxPriceCurrency | LoyaltyCardMaxPriceCurrency |
|
| maxPrice | String |
|
| loyaltyType | LoyaltyCardLoyaltyType! |
|
| pointsLoyaltyType | LoyaltyCardPointsLoyaltyType |
|
| code | String |
|
| redemptionExpirationDays | Int |
|
| initialPoints | Int |
|
| validityInMonths | Int |
|
| stampsNeeded | Int |
|
| stampExpirationDays | Int |
|
| maxPointsPerDay | Int |
|
| maxStampsPerDay | Int |
|
| pointsNeeded | Int |
|
| incrementalPoints | Int |
|
| dollarWorth | Int |
|
| pointWorthCurrency | LoyaltyCardPointWorthCurrency |
|
| pointWorth | String |
|
| status | LoyaltyCardStatus! |
|
| pictures | LoyaltyCardPictureNodeConnection! |
|
| rewards | LoyaltyRewardNodeConnection! |
|
| stampsRedemptionIntents | StampsRedemptionIntentNodeConnection! |
|
| stampsRedemptions | StampsRedemptionNodeConnection! |
|
| pointsRedemptionIntents | PointsRedemptionIntentNodeConnection! |
|
| pointsRedemptions | PointsRedemptionNodeConnection! |
|
| stamps | StampNodeConnection |
|
| minimumSpendAmount | Float |
|
| minPriceAmount | Float |
|
| maxPriceAmount | Float |
|
| pointWorthAmount | Float |
|
| checkedStamps | Int |
|
| earnedPoints | Int |
|
| rewardAvailable | Boolean |
|
| visits | VisitNodeConnection |
|
| extraInfo | JSONString |
|
| createdAt | DateTime! |
|
| updatedAt | DateTime! |
Create a points loyalty
Reward flat amount
mutation CreateLoyalty(
stores: [ID]!
storeGroups: [ID]!
campaignId: ID
weather: String
name: String!
shortDescription: String
longDescription: String
placement: String
startTime: DateTime!
endTime: DateTime!
redemptionCodeType: String!
enrollmentLimit: Int!
dayStartTime: Time
dayEndTime: Time
daysOfWeek: [String]!
termsAndConditions: String
loyaltyType: String!
code: String
pictures: [LoyaltyImageInput]!
repeatable: Boolean!
repeatDelayHours: Int
redemptionExpirationDays: Int!
minPrice: Decimal!
minPriceCurrency: String
maxPrice: Decimal!
maxPriceCurrency: String
minimumSpend: Decimal
minimumSpendCurrency: String
pointsLoyaltyType: String
dollarWorth: Int
maxPointsPerDay: Int
initialPoints: Int
pointWorth: Decimal
pointWorthCurrency: String
pointsNeeded: Int
incrementalPoints: Int
rewards: [LoyaltyRewardInput]
products: [ID]
stampsNeeded: Int
stampExpirationDays: Int
validityInMonths: Int
maxStampsPerDay: Int
){
createLoyaltyCard(
input: {
stores: $stores
storeGroups: $storeGroups
campaignId: $campaignId
weather: $weather
name: $name
shortDescription: $shortDescription
longDescription: $longDescription
placement: $placement
startTime: $startTime
endTime: $endTime
redemptionCodeType: $redemptionCodeType
enrollmentLimit: $enrollmentLimit
dayStartTime: $dayStartTime
dayEndTime: $dayEndTime
daysOfWeek: $daysOfWeek
termsAndConditions: $termsAndConditions
loyaltyType: $loyaltyType
code: $code
pictures: $pictures
repeatable: $repeatable
repeatDelayHours: $repeatDelayHours
redemptionExpirationDays: $redemptionExpirationDays
minPrice: $minPrice
minPriceCurrency: $minPriceCurrency
maxPrice: $maxPrice
maxPriceCurrency: $maxPriceCurrency
minimumSpend: $minimumSpend
minimumSpendCurrency: $minimumSpendCurrency
pointsLoyaltyType: $pointsLoyaltyType
dollarWorth: $dollarWorth
maxPointsPerDay: $maxPointsPerDay
initialPoints: $initialPoints
pointWorth: $pointWorth
pointWorthCurrency: $pointWorthCurrency
pointsNeeded: $pointsNeeded
incrementalPoints: $incrementalPoints
rewards: $rewards
products: $products
stampsNeeded: $stampsNeeded
stampExpirationDays: $stampExpirationDays
validityInMonths: $validityInMonths
maxStampsPerDay: $maxStampsPerDay
}
) {
success
errors
loyaltyCard {
pk
id
}
}
}
{
"name": "Points loyalty",
"shortDescription": "Points loyalty short description",
"longDescription": "Points loyalty long description",
"loyaltyType": "POINTS",
"redemptionCodeType": "AUTOGENERATED",
"enrollmentLimit": 2000,
"repeatable": true,
"repeatDelayHours": 48,
"redemptionExpirationDays": 24,
"minPrice": "10.00",
"maxPrice": "100.00",
"pointsLoyaltyType": "FLAT",
"dollarWorth": 5,
"maxPointsPerDay": 20,
"initialPoints": 5,
"pointWorth": "1.00",
"pointsNeeded": 200,
"incrementalPoints": 10,
"products": [1, 2, 3],
"startTime": "2022-04-25T11:40",
"endTime": "2023-12-31T23:40",
"dayStartTime": "06:11",
"dayEndTime": "23:41",
"daysOfWeek": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"campaignId": 5,
"stores": [7, 8, 9],
"storeGroups": [20, 23, 25]
}
Reward a product
mutation CreateLoyalty(
stores: [ID]!
storeGroups: [ID]!
campaignId: ID
weather: String
name: String!
shortDescription: String
longDescription: String
placement: String
startTime: DateTime!
endTime: DateTime!
redemptionCodeType: String!
enrollmentLimit: Int!
dayStartTime: Time
dayEndTime: Time
daysOfWeek: [String]!
termsAndConditions: String
loyaltyType: String!
code: String
pictures: [LoyaltyImageInput]!
repeatable: Boolean!
repeatDelayHours: Int
redemptionExpirationDays: Int!
minPrice: Decimal!
minPriceCurrency: String
maxPrice: Decimal!
maxPriceCurrency: String
minimumSpend: Decimal
minimumSpendCurrency: String
pointsLoyaltyType: String
dollarWorth: Int
maxPointsPerDay: Int
initialPoints: Int
pointWorth: Decimal
pointWorthCurrency: String
pointsNeeded: Int
incrementalPoints: Int
rewards: [LoyaltyRewardInput]
products: [ID]
stampsNeeded: Int
stampExpirationDays: Int
validityInMonths: Int
maxStampsPerDay: Int
){
createLoyaltyCard(
input: {
stores: $stores
storeGroups: $storeGroups
campaignId: $campaignId
weather: $weather
name: $name
shortDescription: $shortDescription
longDescription: $longDescription
placement: $placement
startTime: $startTime
endTime: $endTime
redemptionCodeType: $redemptionCodeType
enrollmentLimit: $enrollmentLimit
dayStartTime: $dayStartTime
dayEndTime: $dayEndTime
daysOfWeek: $daysOfWeek
termsAndConditions: $termsAndConditions
loyaltyType: $loyaltyType
code: $code
pictures: $pictures
repeatable: $repeatable
repeatDelayHours: $repeatDelayHours
redemptionExpirationDays: $redemptionExpirationDays
minPrice: $minPrice
minPriceCurrency: $minPriceCurrency
maxPrice: $maxPrice
maxPriceCurrency: $maxPriceCurrency
minimumSpend: $minimumSpend
minimumSpendCurrency: $minimumSpendCurrency
pointsLoyaltyType: $pointsLoyaltyType
dollarWorth: $dollarWorth
maxPointsPerDay: $maxPointsPerDay
initialPoints: $initialPoints
pointWorth: $pointWorth
pointWorthCurrency: $pointWorthCurrency
pointsNeeded: $pointsNeeded
incrementalPoints: $incrementalPoints
rewards: $rewards
products: $products
stampsNeeded: $stampsNeeded
stampExpirationDays: $stampExpirationDays
validityInMonths: $validityInMonths
maxStampsPerDay: $maxStampsPerDay
}
) {
success
errors
loyaltyCard {
pk
id
}
}
}
{
"name": "Points loyalty",
"shortDescription": "Points loyalty short description",
"longDescription": "Points loyalty long description",
"loyaltyType": "POINTS",
"redemptionCodeType": "AUTOGENERATED",
"enrollmentLimit": 2000,
"repeatable": true,
"repeatDelayHours": 48,
"redemptionExpirationDays": 24,
"minPrice": "10.00",
"maxPrice": "100.00",
"pointsLoyaltyType": "PRODUCT",
"rewards": [5, 6, 7],
"dollarWorth": 5,
"maxPointsPerDay": 20,
"initialPoints": 5,
"pointWorth": "1.00",
"pointsNeeded": 200,
"incrementalPoints": 10,
"products": [1, 2, 3],
"startTime": "2022-04-25T11:40",
"endTime": "2023-12-31T23:40",
"dayStartTime": "06:11",
"dayEndTime": "23:41",
"daysOfWeek": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"campaignId": 5,
"stores": [7, 8, 9],
"storeGroups": [20, 23, 25]
}
Create a stamps loyalty
mutation CreateLoyalty(
stores: [ID]!
storeGroups: [ID]!
campaignId: ID
weather: String
name: String!
shortDescription: String
longDescription: String
placement: String
startTime: DateTime!
endTime: DateTime!
redemptionCodeType: String!
enrollmentLimit: Int!
dayStartTime: Time
dayEndTime: Time
daysOfWeek: [String]!
termsAndConditions: String
loyaltyType: String!
code: String
pictures: [LoyaltyImageInput]!
repeatable: Boolean!
repeatDelayHours: Int
redemptionExpirationDays: Int!
minPrice: Decimal!
minPriceCurrency: String
maxPrice: Decimal!
maxPriceCurrency: String
minimumSpend: Decimal
minimumSpendCurrency: String
pointsLoyaltyType: String
dollarWorth: Int
maxPointsPerDay: Int
initialPoints: Int
pointWorth: Decimal
pointWorthCurrency: String
pointsNeeded: Int
incrementalPoints: Int
rewards: [LoyaltyRewardInput]
products: [ID]
stampsNeeded: Int
stampExpirationDays: Int
validityInMonths: Int
maxStampsPerDay: Int
){
createLoyaltyCard(
input: {
stores: $stores
storeGroups: $storeGroups
campaignId: $campaignId
weather: $weather
name: $name
shortDescription: $shortDescription
longDescription: $longDescription
placement: $placement
startTime: $startTime
endTime: $endTime
redemptionCodeType: $redemptionCodeType
enrollmentLimit: $enrollmentLimit
dayStartTime: $dayStartTime
dayEndTime: $dayEndTime
daysOfWeek: $daysOfWeek
termsAndConditions: $termsAndConditions
loyaltyType: $loyaltyType
code: $code
pictures: $pictures
repeatable: $repeatable
repeatDelayHours: $repeatDelayHours
redemptionExpirationDays: $redemptionExpirationDays
minPrice: $minPrice
minPriceCurrency: $minPriceCurrency
maxPrice: $maxPrice
maxPriceCurrency: $maxPriceCurrency
minimumSpend: $minimumSpend
minimumSpendCurrency: $minimumSpendCurrency
pointsLoyaltyType: $pointsLoyaltyType
dollarWorth: $dollarWorth
maxPointsPerDay: $maxPointsPerDay
initialPoints: $initialPoints
pointWorth: $pointWorth
pointWorthCurrency: $pointWorthCurrency
pointsNeeded: $pointsNeeded
incrementalPoints: $incrementalPoints
rewards: $rewards
products: $products
stampsNeeded: $stampsNeeded
stampExpirationDays: $stampExpirationDays
validityInMonths: $validityInMonths
maxStampsPerDay: $maxStampsPerDay
}
) {
success
errors
loyaltyCard {
pk
id
}
}
}
{
"name": "Stamps loyalty",
"shortDescription": "Stamps loyalty short description",
"longDescription": "Stamps loyalty long description",
"loyaltyType": "STAMPS",
"redemptionCodeType": "AUTOGENERATED",
"enrollmentLimit": 2000,
"repeatable": true,
"repeatDelayHours": 48,
"redemptionExpirationDays": 24,
"minPrice": "10.00",
"maxPrice": "100.00",
"stampsNeeded": 5,
"stampExpirationDays": 3,
"maxStampsPerDay": 1,
"products": [1, 2, 3],
"startTime": "2022-04-25T11:40",
"endTime": "2023-12-31T23:40",
"dayStartTime": "06:11",
"dayEndTime": "23:41",
"daysOfWeek": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"campaignId": 5,
"stores": [7, 8, 9],
"storeGroups": [20, 23, 25]
}
Update a loyalty card
mutation UpdateLoyalty(
id: ID!
stores: [ID]
storeGroups: [ID]
campaignId: ID
weather: String
name: String
shortDescription: String
longDescription: String
placement: String
startTime: DateTime
endTime: DateTime
redemptionCodeType: String
enrollmentLimit: Int
dayStartTime: Time
dayEndTime: Time
daysOfWeek: [String]
termsAndConditions: String
loyaltyType: String
code: String
pictures: [LoyaltyImageInput]
repeatable: Boolean
repeatDelayHours: Int
redemptionExpirationDays: Int
minPrice: Decimal
minPriceCurrency: String
maxPrice: Decimal
maxPriceCurrency: String
minimumSpend: Decimal
minimumSpendCurrency: String
pointsLoyaltyType: String
dollarWorth: Int
maxPointsPerDay: Int
initialPoints: Int
pointWorth: Decimal
pointWorthCurrency: String
pointsNeeded: Int
incrementalPoints: Int
rewards: [LoyaltyRewardInput]
products: [ID]
stampsNeeded: Int
stampExpirationDays: Int
validityInMonths: Int
maxStampsPerDay: Int
){
updateLoyaltyCard(
input: {
id: $id
stores: $stores
storeGroups: $storeGroups
campaignId: $campaignId
weather: $weather
name: $name
shortDescription: $shortDescription
longDescription: $longDescription
placement: $placement
startTime: $startTime
endTime: $endTime
redemptionCodeType: $redemptionCodeType
enrollmentLimit: $enrollmentLimit
dayStartTime: $dayStartTime
dayEndTime: $dayEndTime
daysOfWeek: $daysOfWeek
termsAndConditions: $termsAndConditions
loyaltyType: $loyaltyType
code: $code
pictures: $pictures
repeatable: $repeatable
repeatDelayHours: $repeatDelayHours
redemptionExpirationDays: $redemptionExpirationDays
minPrice: $minPrice
minPriceCurrency: $minPriceCurrency
maxPrice: $maxPrice
maxPriceCurrency: $maxPriceCurrency
minimumSpend: $minimumSpend
minimumSpendCurrency: $minimumSpendCurrency
pointsLoyaltyType: $pointsLoyaltyType
dollarWorth: $dollarWorth
maxPointsPerDay: $maxPointsPerDay
initialPoints: $initialPoints
pointWorth: $pointWorth
pointWorthCurrency: $pointWorthCurrency
pointsNeeded: $pointsNeeded
incrementalPoints: $incrementalPoints
rewards: $rewards
products: $products
stampsNeeded: $stampsNeeded
stampExpirationDays: $stampExpirationDays
validityInMonths: $validityInMonths
maxStampsPerDay: $maxStampsPerDay
}
) {
success
errors
loyaltyCard {
pk
id
}
}
}