Connect your own systems with the Codes API
Validate, allocate and redeem a campaign's voucher codes from your website backend, app server, till or chatbot with a campaign API key.
For: Admins and developersWhat it does
The Codes API lets any system you run use a campaign's codes. Every request is a JSON POST with the campaign's API key:
| Endpoint | Use it to |
|---|---|
/public/v1/codes/validate | Check a code exists and can still be redeemed. Nothing changes. |
/public/v1/codes/allocate | Give the next unused code, or a named one, to a customer by email, phone or your own ID. |
/public/v1/codes/redeem | Use a code up. It works once, across every channel. |
Get a key
- Open Campaigns, then your campaign, then API access.
- Click Generate key and copy it straight away. It is shown once; VoucherVerse keeps only a hash.
- Send it as
Authorization: Bearer vvb_…on every request.
Keep the key on your server. Never put it in a website's JavaScript or a mobile app: anyone with it can allocate and redeem the campaign's codes. Rotate key replaces it and the old one stops working at once. Deleting the campaign stops its key too, until the campaign is restored.
Full reference
The Codes API docs have every field, status and error, code samples in curl, JavaScript and Python, an OpenAPI file and a live console to try requests (use a test campaign: allocate and redeem change real codes).