Stock figures
Every voucher set carriesstock:
Stock figures are eventually consistent: they follow redemptions, uploads and revocations within about two minutes. The figures never decide a redemption: a redemption either gets a voucher or fails.
remaining and used are 64-bit integers.
Read them on the set, or for all sets at once:
stockStatus, never your numbers.
Threshold alerts
Each set has one stock alert rule, created with the set (thresholds 50, 75, 90 and 100 % used; the creating user as recipient, or your partner’s operations contact when an API key created the set).thresholds: any subset of 50, 75, 90, 100 ([]for none).recipientUserIds: up to 20 active members who can view voucher sets (others →recipient-not-eligible);extraEmails: up to 5 addresses.- Each threshold fires once when usage crosses it, and is armed again when new vouchers lower the usage below it.
- Several thresholds crossed at once send one email listing them all.
- Thresholds you add at or below the current usage are marked as fired without an email.
- Each alert sends emails and the
voucher-set-stock-threshold-reachedwebhook (levels,usagePercent). When nothing remains, you also getvoucher-set-depleted.
GET …/stock-alert-firings lists the alerts sent. Updating the rule needs manage-provider-stock-alerts and no change request.
Unlimited sets
A set with at least one unlimitedmultiple voucher has remaining: null and usagePercent: null. Threshold alerts never fire for it; the rule shows applicable: false. It can still become depleted if those vouchers are revoked or expire.