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
Field | Type | Nullability | Description | Related Types |
---|---|---|---|---|
title | String | Optional | The title of the loyalty discount. | |
description | String | Optional | The description of the loyalty discount. | |
totalSpent | Float | Required | The total amount spent by the customer. | Float |
isStackable | Boolean | Required | Whether the loyalty discount is stackable. | Boolean |
isCombinable | Boolean | Required | Whether the loyalty discount is combinable. | Boolean |
levels | [LoyaltyDiscountLevel] | Required | The levels of the loyalty discount. | [LoyaltyDiscountLevel] |
currentLevelValidUntil | String | Optional | The valid until date of the current level. | |
currentLevelThreshold | Float | Required | The threshold of the current level. | Float |
currentLevelDiscount | Float | Required | The discount of the current level. | Float |
nextLevelThreshold | Float | Optional | The threshold of the next level. | Float |
nextLevelDiscount | Float | Optional | The 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 theloyaltyDiscountProgress
field on theCustomer
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.
Related Types
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
andisCombinable
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