Skip to main content
The validation and redemption mechanisms always work in a transactional way. As a result, the voucher’s usage is registered permanently once redemption is successful. By using the session feature, you can temporarily record (lock) the voucher usage after the voucher has been validated. A lock for a redeemable is released when one of the following happens:
  • Expiration time passes
  • Redemption is registered for the session
  • Manual release for a voucher with Release Validation Session. This unlocks only the voucher in the path, even if other redeemables share the same session key
  • Manual release in the Dashboard:
    • On a redeemable’s details Validations tab, Release session unlocks only that redeemable
    • In Redemptions > Sessions, you can unlock the session for every redeemable that still holds that session key
Once the session is established, the API returns a unique session key. The key must be used with each of the following validation or redemption requests to clearly identify the session. Multiple requests with the same key will always override existing session values. By default, the number of available validation sessions is equal to the Code redemption limit set in the campaign manager. For example:
  • If the code redemption limit is set to 4, Voucherify will be able to lock up to four sessions. Next sessions will result in the quantity_exceeded error.
  • If the code redemption limit is set to unlimited, Voucherify will allow any number of sessions.

How to lock code usage

Step 1: Validate code with session key

You can establish the locking session while validating the code. Put the session object in your request by following the session object reference. To link a request with the given session, always use the same session key for session-related validation and redemption requests. You can use your own session key or the system will generate one for you once the session option is enabled with the request.

Example validation request

If you do not establish a session time frame by passing the session.ttl and session.ttl_unit, it will be active for 7 days.

Step 2: Redeem the code with the session key

Usage of the code is locked and allowed only with the returned session key that identifies the session. Note that multiple requests with the same key will always override existing session values. When redeeming the code, the session object needs to define session.type and session.key.

Step 3: Track redemption

If the redemption request includes a proper session.key value, the request is validated and the redemption is executed. When Voucherify registers a new redemption for the locked resource, the session is automatically released. If you need to unlock a voucher manually, use Release Validation Session. In a stackable validation, several vouchers can share one session key. Releasing the session for one voucher unlocks only that voucher. Other vouchers that still hold the same key stay locked, and only that voucher gets a session-released event in the Activity tab. Calling the endpoint again for a voucher that is no longer locked still returns 204 and does not create another session-released event.
Registering a session will record a temporary usage for the specified time frame. This means it will influence other incoming validation and redemption requests until the session is released.Once redemption is successful the session is removed automatically.

Session keys

The following table presents the type of sessions that can be established. You can unlock a voucher’s session lock with Release Validation Session. To unlock every redeemable still tied to the same session key, use Redemptions > Sessions in the Dashboard.
Go to Voucherify Postman Collection, where you can test the Locking Validation Session mechanism.
Last modified on October 21, 2026