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
| Name | Type | Description |
|---|---|---|
_id | ID! | Internal database identifier. |
type | VoucherTypes! | Type of voucher (coupon or gift card). |
id | String! | Voucher identifier code. |
value | Float! | Current remaining value of the voucher. |
originalValue | Float | Original value of the voucher when it was created. |
redeemType | RedeemType! | How the voucher discount is calculated (fixed value or percentage). |
redeemed | Boolean | Whether the voucher has been fully redeemed. |
isInRange | Boolean | Whether the voucher is currently within its valid date range. |
singleSpending ⚠️ | Boolean | Whether the voucher can only be used once. Use spendingLimit instead. ⚠️ Deprecated: No longer supported |
unlimited ⚠️ | Boolean | Whether the voucher has unlimited usage. Use spendingLimit instead. ⚠️ Deprecated: No longer supported |
spendings | [VoucherSpending!] | History of spending transactions where this voucher was used. |
spendingLimit | Int | Maximum number of times the voucher can be used. |
startDate | Date | Start date when the voucher becomes valid. |
expires | Date | Expiration date when the voucher becomes invalid. |
resourcePath | String | URL path to the voucher resource. |
user | UserReference | User who owns or is assigned to this voucher. |
created | Date | Date when the voucher was created. |
createdBy | UserReference | User who created the voucher. |
note | Note | Note or comment associated with the voucher. |
logs | [LogEntry!] | Historical log entries tracking changes to the voucher. |
recipients | [VoucherEmailRecipient!] | Email recipients who received this voucher. |
pdf | String | URL to the PDF document for the voucher. |