Skip to content

Types

The object types and scalars returned by the schema.

Shop-level configuration for the loyalty program.

type Shop {
programName: String
stampBrandingPlural: String
stampCardValue: Int
currency: String
currencySymbol: String
}
FieldTypeDescription
programNameStringThe loyalty program’s display name.
stampBrandingPluralStringThe merchant’s plural noun for stamps (e.g. “stamps”, “beans”).
stampCardValueIntNumber of stamps that make up one stamp card.
currencyStringISO currency code.
currencySymbolStringDisplay currency symbol.

A way customers can earn stamps.

type EarnRule {
id: ID!
name: String
type: String
step: Int
multiplier: Float
iconUrl: String
}
FieldTypeDescription
idID!Unique identifier.
nameStringDisplay name (branded/translated).
typeStringRule type (e.g. order, social, birthday).
stepIntBase stamps awarded per qualifying action.
multiplierFloatMultiplier applied to step.
iconUrlStringIcon URL if set.

Something customers can redeem stamps for.

type Reward {
id: ID!
name: String
price: Int
exchangeType: String
iconUrl: String
}
FieldTypeDescription
idID!Unique identifier.
nameStringDisplay name (branded/translated).
priceIntCost in stamps.
exchangeTypeStringHow the reward is exchanged.
iconUrlStringIcon URL if set.

A VIP tier in the loyalty program.

type Tier {
id: ID!
name: String
milestone: Int
multiplier: Float
iconUrl: String
benefits: String
rewards: [Reward!]!
}
FieldTypeDescription
idID!Unique identifier.
nameStringTier name.
milestoneIntStamps required to reach the tier.
multiplierFloatStamp-earning multiplier for members.
iconUrlStringIcon URL.
benefitsStringDescription of the tier’s benefits.
rewards[Reward!]!Reward products granted by this tier.

An announcement shown to customers.

type Beacon {
id: ID!
name: String
message: String
icon: String
active: Boolean
}
FieldTypeDescription
idID!Unique identifier.
nameStringBeacon name.
messageStringAnnouncement text shown to customers.
iconStringIcon identifier.
activeBooleanWhether currently active.

A loyalty member, identified everywhere by their Shopify customer ID.

type Customer {
id: ID!
firstName: String
lastName: String
email: String
stampBalance: Int
cards: Int
stampsToNextReward: Int
stampsExpireAt: String
vipTierId: Int
vipTierName: String
dateOfBirth: String
state: String
mergedIntoCustomerId: Int
nextReward: NextReward
}
FieldTypeDescription
idID!The Shopify customer ID (the customer’s identity everywhere).
firstNameStringThe customer’s first name.
lastNameStringThe customer’s last name.
emailStringThe customer’s email address.
stampBalanceIntCurrent redeemable stamp balance.
cardsIntNumber of completed stamp cards.
stampsToNextRewardIntStamps still needed to reach the next reward.
stampsExpireAtStringWhen the current stamp balance expires, if stamp expiry is enabled.
vipTierIdIntCurrent VIP tier ID (if any).
vipTierNameStringCurrent VIP tier name.
dateOfBirthString”dd-mm” string.
stateStringLoyalty state of the customer.
mergedIntoCustomerIdIntIf the customer was merged, the kept customer’s ID.
nextRewardNextRewardThe next reward the customer is working towards. Populated only when fetching a single customer.

The reward a customer is closest to earning.

type NextReward {
id: ID!
name: String
}
FieldTypeDescription
idID!The reward’s identifier.
nameStringThe reward’s display name.

A single entry in a customer’s stamp ledger.

type Activity {
id: ID!
label: String
stampChange: Int
createdAt: DateTime
}
FieldTypeDescription
idID!Unique identifier.
labelStringHuman-readable description of the activity.
stampChangeIntStamps added or removed (negative for deductions).
createdAtDateTimeISO-8601 timestamp.

A discount code issued to a customer for a reward.

type RewardCode {
id: ID!
name: String
code: String
used: Boolean
createdAt: DateTime
}
FieldTypeDescription
idID!Unique identifier.
nameStringReward name.
codeStringThe discount code.
usedBooleanWhether it has been used.
createdAtDateTimeISO-8601 timestamp.

The outcome of a stamp-changing mutation (awardStamps, adjustStamps, processActivity).

type StampResult {
customerId: ID!
stampChange: Int!
stampBalance: Int!
}
FieldTypeDescription
customerIdID!The affected customer’s ID.
stampChangeInt!The stamp change applied.
stampBalanceInt!Resulting stamp balance.

The outcome of a redeemReward mutation.

type Redemption {
code: String
name: String
stampBalance: Int!
}
FieldTypeDescription
codeStringThe issued discount code.
nameStringReward name.
stampBalanceInt!Resulting stamp balance after deduction.

A cursor-paginated page of customers.

type CustomerConnection {
items: [Customer!]!
pageInfo: PageInfo!
}
FieldTypeDescription
items[Customer!]!The records for this page.
pageInfoPageInfo!Pagination metadata.

A cursor-paginated page of activities.

type ActivityConnection {
items: [Activity!]!
pageInfo: PageInfo!
}
FieldTypeDescription
items[Activity!]!The records for this page.
pageInfoPageInfo!Pagination metadata.

Pagination metadata returned by every connection.

type PageInfo {
hasNext: Boolean!
hasPrevious: Boolean!
nextCursor: String
previousCursor: String
count: Int
}
FieldTypeDescription
hasNextBoolean!Whether another page follows.
hasPreviousBoolean!Whether a previous page exists.
nextCursorStringCursor to fetch the next page (pass as after).
previousCursorStringCursor for the previous page (pass as before).
countIntTotal matching records (only when hasCount: true, otherwise null).
scalar DateTime
ScalarDescription
DateTimeAn ISO-8601 timestamp string.