Skip to main content
Sometimes it’s important to validate a promo code or promotion on the client side, e.g., you want to calculate and display a discounted price on the fly. That’s why Voucherify comes with client-side features built into Voucherify JS SDK - an open-source JavaScript library that enables you to query the API. Among other features, it delivers Voucherify React Widgets Voucherify JS SDK offers many client-side features:
  • validate widget which enables your customers to validate their codes and check its validity in a given context.
  • redeem widget which enables your customers to redeem the promo codes.
  • publish widget which enables your customers to a unique voucher from a given campaign in exchange for providing an email address.
  • subscribe widget which adds a customer to Voucherify. You can then use one of the automatic delivery channels to send him/her a coupon. Read more here.

API requests rate limit

To keep your vouchers and promotions safe from fraudulent customer behavior, Voucherify limits the rate of public client requests coming from a single IP address. The current limit can be found at Limits section. When the limit is exceeded, Voucherify returns:
{
    "code": 429,
    "message": "Too many requests hit the API too quickly."
}

Installation & reference

Visit Github repository to get the current documentation.

Client-side Settings

Use Client-side Settings in the general tab of the Project Settings to configure which actions can be performed directly from your website or client application using the Voucherify API.

Website URL

Enter your website or app domain to allow Voucherify’s client-side SDK or API to make requests. Use * to allow requests from any domain (not recommended for production). Danger Zone
These settings control which Voucherify API endpoints can be accessed directly from a client app (browser or mobile). Client-side access is limited and should be enabled only if necessary.

Enable client-side redemption

Allows redemptions to be made directly from a client app using the Client-side API.
This is insecure because users may change request data. Use server-side redemption whenever possible.

Enable client-side publication

Allows publishing vouchers via client-side SDK or API.

Enable client-side vouchers listing

Enables fetching available vouchers directly from the client (e.g., to display user-specific rewards).

Enable client-side customer creation

Lets the client create customer profiles via the Client-side API. Use carefully β€” this can expose customer metadata creation to the browser.

Enable client-side voucher expiration date update

Allows updating voucher expiration dates from the client. Rarely needed; use only for controlled test cases.

Enable client-side loyalty and referral programs events

Allows the client to send loyalty and referral events (e.g., β€œpurchase made”, β€œfriend invited”) directly from a user device.
⌘I