Use the Origin Voucher API to create vouchers for redeeming digital content (like eBooks or audiobooks). This guide walks you through the full process — from setup to handling API responses and errors.

API Documentation can be found on our developer portal.


You can optionally use the Snapplify Ecommerce plugin to manage vouchers with Wordpress.


Prerequisites

Before you start:

API Endpoint

KeyValue
Endpoint

https://api.snapplify.com/vouchers

MethodPost
Formatapplication/json


Define Voucher Parameters

Use the following parameters to define your voucher in the request body:


ParameterRequiredDescription
labelYesThe name of the voucher (used for internal reference)
codeNoProvide a custom voucher code. If omitted, one will be generated.
referenceYesYour internal reference for tracking
quantityYesNumber of times a voucher can be redeemed
sessionsNoRestrict redemptions to a specific number of sessions
recipientEmailNo

An optional email address. If supplied, this email address will receive the newly created voucher via email.

autoRedeemNo

If True, the voucher will Auto-redeem for the user


Field Rules and Defaults

How voucher fields behave depends on how the voucher is created:

  • Both voucher.reference and voucher.label are optional.
  • If voucher.label is not provided, it defaults to the value of voucher.reference.
  • If voucher.reference is not provided, it defaults to the value of voucher.code.
  • If voucher.code is not specified, a code is generated automatically.

Example Request 

{
  "label": "SNAPVOUCHER",
  "reference": "ORDER123",
  "quantity": 1,
  "email": "user@example.com"
}

API Response

A successful request returns:

{
  "label": "Snapplify Voucher",
  "code": "SNAPVOUCHER123",
  "reference": "Snapplify Voucher",
  "quantity": 1,
  "quantityRemaining": 1,
  "email": "user@example.com",
  "sessions": 1,
  "autoRedeem": false,
  "createdAt": "2023-09-02T07:21:14+00:00"
}

Handling Errors

CodeMessageDescription
400Validation errorLikely, a required field is missing
401UnauthorizedCheck your API key
409ConflictVoucher code already exists
500Server ErrorInternal issue, try again later


Advanced Use Cases and Notes

Redeem limits and multiple use

You can control how many times a voucher can be used (quantity) and whether it can be used by multiple users or just one (sessions).


Example – Single user, multiple redemptions

{
  "label": "Single User Multi-Redeem",
  "reference": "STUDENT456",
  "quantity": 3,
  "sessions": 1
}

JSON Error Example

{
  "status": 400,
  "message": "Could not create voucher: {Your Custom Error}"
}

Once your voucher is created, test it in your application or platform to confirm it works as expected. If needed, use the API responses and error messages to troubleshoot.


To learn more about using vouchers or managing redemptions, explore the related articles below.


Need help? Use the live chat in the bottom right corner of your screen, email us at help@snapplify.com or reach out via Whatsapp +27 60 011 8065.