The default validation/redemption mechanism always works in a transactional way, therefore the voucher's usage is registered permanently once redemption is successful. In case, the resource usage is needed to be recorded temporary right after the voucher is being validated the session mechanism will come in handy.
Once the session is established the session key is being returned. The key must be used with the following requests (another validation or redemption) to identify clearly the session. Multiple requests with the same key will always override existing session values.
The session can be released in one of the following ways:
- expiration time passes
- redemption is being registered for the session
- manual release using a dedicated API endpoint (for vouchers only: Release Validation Session )
To link 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 system will generate one for you once session option is enabled with the request.
Please note that if you want to use the established session during all validations/redemptions of the code, you need to pass the same session key in each validation and redemption request.
Validation and Redemption with Session
Registering a session will record a temporary usage for the specified timeframe. It means it will influence other incoming validation and redemption requests until the session is released.
Once redemption is successful the session is removed automatically.
The following table presents the type of sessions that can be established.
Locks the following parameters within the session:
Type of the session. Required to establish a new session.
Unique session identifier.
Defines the type of unit in which session time is counted. Allowed values: DAYS, HOURS, MICROSECONDS, MILLISECONDS, MINUTES, NANOSECONDS, SECONDS
Value for the period of time that the session is active. Units for this parameter are defines by session.ttl_unit
Default session time
If you won't establish session timeframe by passing the session.ttl and session.ttl_unit, it'll be active throughout 7 days.
You can always release established sessions by calling Release Validation Session endpoint.