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 developers

What 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:

EndpointUse it to
/public/v1/codes/validateCheck a code exists and can still be redeemed. Nothing changes.
/public/v1/codes/allocateGive the next unused code, or a named one, to a customer by email, phone or your own ID.
/public/v1/codes/redeemUse a code up. It works once, across every channel.

Get a key

  1. Open Campaigns, then your campaign, then API access.
  2. Click Generate key and copy it straight away. It is shown once; VoucherVerse keeps only a hash.
  3. 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).

Next guideFind and manage vouchers and customers