purchaseVouchers
Purchase multiple vouchers.
Arguments
Optional idempotency key to prevent the entire batch from being processed more than once on retry. If provided and already used, the mutation returns an error instead of creating duplicate purchases.
The list of vouchers to purchase.
Possible Errors
- KT-CT-1111: Unauthorized.
- KT-CT-1113: Disabled GraphQL field requested.
- KT-CT-13201: Invalid voucher type.
- KT-CT-13202: Exactly one of chargeAmountInCents or chargeAmountInCentsWithTax expected.
- KT-CT-13203: Multiple account numbers found in voucher batch.
- KT-CT-13204: A voucher purchase with this idempotency key already exists.
- KT-CT-3820: Received both ledger ID and number.
- KT-CT-3924: Unauthorized.
- KT-CT-4178: No account found with given account number.
- KT-CT-7899: An internal error occurred.
Allowed Viewers
Required Permissions
Can create voucher purchaseQuery Complexity
1Examples
The example data in the variables and responses below are autogenerated values designed to resemble real inputs. They do not represent actual customer data, and in some cases may require additional validation.
mutation PurchaseVouchers(
$idempotencyKey: String,
$input: [PurchaseVoucherInput]!
) {
purchaseVouchers(
idempotencyKey: $idempotencyKey,
input: $input
) {
voucherPurchases {
...VoucherPurchaseTypeFragment
}
}
}
Variables
{
"idempotencyKey": "walk-big-air-it-quickly",
"input": PurchaseVoucherInput
}
Response
{
"data": {
"purchaseVouchers": {
"voucherPurchases": [VoucherPurchaseType]
}
}
}