Skip to main content

Voucher Object

Description

Represents a voucher (coupon or gift card) with redemption rules and spending history.

Declaration

type Voucher {
_id: ID!
type: VoucherTypes!
id: String!
value: Float!
originalValue: Float
redeemType: RedeemType!
redeemed: Boolean
isInRange: Boolean
singleSpending: Boolean
unlimited: Boolean
spendings: [VoucherSpending!]
spendingLimit: Int
startDate: Date
expires: Date
resourcePath: String
user: UserReference
created: Date
createdBy: UserReference
note: Note
logs: [LogEntry!]
recipients: [VoucherEmailRecipient!]
pdf: String
}

Fields

NameTypeDescription
_idID!Internal database identifier.
typeVoucherTypes!Type of voucher (coupon or gift card).
idString!Voucher identifier code.
valueFloat!Current remaining value of the voucher.
originalValueFloatOriginal value of the voucher when it was created.
redeemTypeRedeemType!How the voucher discount is calculated (fixed value or percentage).
redeemedBooleanWhether the voucher has been fully redeemed.
isInRangeBooleanWhether the voucher is currently within its valid date range.
singleSpending ⚠️BooleanWhether the voucher can only be used once. Use spendingLimit instead. ⚠️ Deprecated: No longer supported
unlimited ⚠️BooleanWhether the voucher has unlimited usage. Use spendingLimit instead. ⚠️ Deprecated: No longer supported
spendings[VoucherSpending!]History of spending transactions where this voucher was used.
spendingLimitIntMaximum number of times the voucher can be used.
startDateDateStart date when the voucher becomes valid.
expiresDateExpiration date when the voucher becomes invalid.
resourcePathStringURL path to the voucher resource.
userUserReferenceUser who owns or is assigned to this voucher.
createdDateDate when the voucher was created.
createdByUserReferenceUser who created the voucher.
noteNoteNote or comment associated with the voucher.
logs[LogEntry!]Historical log entries tracking changes to the voucher.
recipients[VoucherEmailRecipient!]Email recipients who received this voucher.
pdfStringURL to the PDF document for the voucher.