Skip to Content

LoyaltyDiscountProgress

Represents the progress of a loyalty discount for a customer.

Type Definition

type LoyaltyDiscountProgress { title: String description: String totalSpent: Float! isStackable: Boolean! isCombinable: Boolean! levels: [LoyaltyDiscountLevel]! currentLevelValidUntil: String currentLevelThreshold: Float! currentLevelDiscount: Float! nextLevelThreshold: Float nextLevelDiscount: Float }

Fields

FieldTypeNullabilityDescriptionRelated Types
titleStringOptionalThe title of the loyalty discount.
descriptionStringOptionalThe description of the loyalty discount.
totalSpentFloatRequiredThe total amount spent by the customer.Float
isStackableBooleanRequiredWhether the loyalty discount is stackable.Boolean
isCombinableBooleanRequiredWhether the loyalty discount is combinable.Boolean
levels[LoyaltyDiscountLevel]RequiredThe levels of the loyalty discount.[LoyaltyDiscountLevel]
currentLevelValidUntilStringOptionalThe valid until date of the current level.
currentLevelThresholdFloatRequiredThe threshold of the current level.Float
currentLevelDiscountFloatRequiredThe discount of the current level.Float
nextLevelThresholdFloatOptionalThe threshold of the next level.Float
nextLevelDiscountFloatOptionalThe discount of the next level.Float

Relationships

  • levels: This field is a list of LoyaltyDiscountLevel objects representing the different tiers or levels within the loyalty discount program.
  • The LoyaltyDiscountProgress object is accessible via the loyaltyDiscountProgress field on the Customer object, linking a customer’s spending progress to their loyalty discount status.

Usage Examples

Basic Query

{ loyaltyDiscountProgress { title description totalSpent isStackable isCombinable currentLevelThreshold currentLevelDiscount } }

Field Selection

{ loyaltyDiscountProgress { title totalSpent levels { id name discount threshold } nextLevelThreshold nextLevelDiscount } }

Nested Queries

{ loyaltyDiscountProgress { levels { id name discount threshold } currentLevelValidUntil currentLevelDiscount } }

Filtering and Sorting

Note: The LoyaltyDiscountProgress type itself does not support direct filtering or sorting fields. Filtering and sorting should be applied at the query level when retrieving customers or loyalty discount levels.

Example: Fetch customers with totalSpent greater than 1000 (assuming a query supports filtering):

{ customers(filter: { totalSpent_gt: 1000 }) { edges { node { id loyaltyDiscountProgress { totalSpent currentLevelDiscount } } } } }

Implements

This type does not implement any interfaces.

Connections

The levels field is a connection to multiple LoyaltyDiscountLevel objects, representing the various tiers of the loyalty discount.

  • LoyaltyDiscountLevel: Represents individual levels within the loyalty discount program.
  • Scalar types: Float, Boolean, String

Best Practices

  • When querying loyalty discount progress, select only the fields you need to optimize response size and performance.
  • Use the levels field to understand the full structure of the loyalty program and display progress accordingly.
  • Check isStackable and isCombinable flags to determine how discounts can be combined or stacked with other offers.
  • Use currentLevelValidUntil to inform customers about the expiration of their current discount level.
  • Consider caching loyalty discount progress data where appropriate, as it may not change frequently within a session.

Notes

  • The LoyaltyDiscountProgress object provides a snapshot of a customer’s progress in the loyalty program, including current and next discount levels.
  • The API currently requires no authentication, but this may change in future versions.
  • All monetary values are represented as floats and should be handled carefully to avoid precision errors.
  • The levels array is guaranteed to be non-null but may be empty if no levels are defined.
  • Dates such as currentLevelValidUntil are returned as ISO 8601 strings.
  • No computed or derived fields beyond those explicitly defined are present.
  • No field arguments are defined on this type.

For any questions or further assistance, please refer to the API schema or contact the API support team.

Last updated on