Generate Random Code

Create a standalone voucher. You can choose to create a GIFT_VOUCHER, a DISCOUNT_VOUCHER, or a LOYALTY_CARD.

When you create a new voucher, you can specify a type to create it.
Creating a new voucher will create a new standalone voucher if no campaign name or campaign_id is provided. However, if an ID or name of a campaign with the type set to STANDALONE is provided, the voucher will be added to such campaign. In case of the loyalty card, a campaign name is required.

You can optionally use the code parameter to define a specific code or the code_config parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.

This method will return an error when trying to create a voucher that already exists.

🚧

Standalone Vouchers and Campaigns

In version v20241004, standalone vouchers created through the Voucherify dashboard create a campaign for that voucher. However, vouchers created through the API do not have a campaign attached, so the values for campaign and campaign_id are null.

Voucherify developers work on adding an optional feature to create a standalone voucher campaign through the API.

Follow the Voucherify Release Notes for more details about released features.

Language
Credentials
URL
Click Try It! to start a request and see the response here!