vouchersForAccount
Query the voucher purchases for an account.
Arguments
The account number.
An optional date to limit the response to vouchers that are available before the particular date (exclusive).
An optional date to limit the response to vouchers that are available from the particular date (inclusive) onwards.
An optional list of display names to exclude from the results (case-insensitive).
Whether to exclude refunded vouchers from the response. By default, refunded vouchers will be included in the response.
An optional date to limit the response to vouchers that have been purchased before the particular date (exclusive).
An optional date to limit the response to vouchers that have been purchased from the particular date (inclusive) onwards.
Whether to only return vouchers that can be redeemable.
Possible Errors
Allowed Viewers
Required Permissions
Can access customer queriesCan view account vouchers
Query Complexity
1Examples
query VouchersForAccount(
$accountNumber: ID!,
$after: String,
$availableBeforeDate: Date,
$availableFromDate: Date,
$before: String,
$excludeByDisplayName: [String],
$excludeRefunded: Boolean,
$first: Int,
$last: Int,
$purchasedBeforeDate: Date,
$purchasedFromDate: Date,
$redeemableOnly: Boolean!
) {
vouchersForAccount(
accountNumber: $accountNumber,
after: $after,
availableBeforeDate: $availableBeforeDate,
availableFromDate: $availableFromDate,
before: $before,
excludeByDisplayName: $excludeByDisplayName,
excludeRefunded: $excludeRefunded,
first: $first,
last: $last,
purchasedBeforeDate: $purchasedBeforeDate,
purchasedFromDate: $purchasedFromDate,
redeemableOnly: $redeemableOnly
) {
edgeCount
edges {
...VoucherPurchaseConnectionTypeEdgeFragment
}
pageInfo {
...PageInfoFragment
}
totalCount
}
}
Variables
{
"accountNumber": "A-C4517F9B",
"after": "YXJyYXljb25uZWN0aW9uOjEw=",
"availableBeforeDate": "2019-05-05",
"availableFromDate": "1976-08-02",
"before": "YXJyYXljb25uZWN0aW9uOjEw=",
"excludeByDisplayName": "American-region-institution-road-effect",
"excludeRefunded": true,
"first": 10,
"last": 10,
"purchasedBeforeDate": "2005-05-29",
"purchasedFromDate": "2020-10-31",
"redeemableOnly": true
}
Response
{
"data": {
"vouchersForAccount": {
"edgeCount": 8,
"edges": [VoucherPurchaseConnectionTypeEdge],
"pageInfo": PageInfo,
"totalCount": 79
}
}
}