Voucher redemption
Voucher redemptions involve the use of provisioned vouchers as tender (payment) for a specific service.
Operations and Messages
The table below lists the transactions that make up digital voucher redemptions and the API calls you will need to implement.
| Transaction | Operation | API Call |
|---|---|---|
| Voucher lookup | lookupVoucher |
|
| Redeem voucher | redeemVoucher |
|
| Confirm voucher redemption | confirmRedeem |
|
| Reverse voucher redemption | reverseRedeem |
|
Important
Stellr does not support advice messages (reversals or confirmations), therefore if implemented Electrum will consume any advice messages sent to the Electrum Switch.
Message Flows
The sections below describe successful voucher redemption transactions and error scenarios.
Successful Voucher Redemption: Dual Messaging
- The originating system performs a successful voucher lookup transaction.
- The originating system sends a
POSTcall to the/redemptionsendpoint of the API (redeemVoucheroperation). - The API responds with a
RedemptionResponsemessage payload. - The originating system sends a
BasicAdviceconfirmation message viaPOSTcall to theredemptions/confirmationsendpoint of the API (confirmRedeemoperation). - Electrum responds immediately with a
BasicAdvicemessage payload. - If the service provider supports dual messaging, Electrum sends a confirmation message to the service provider via a store-and-forward queue until a response is returned.

Successful Voucher Redemption: Single Messaging
- The originating system performs a successful voucher lookup transaction.
- The originating system sends a
POSTcall to the/redemptionsendpoint of the API (redeemVoucheroperation). - The API responds with a
RedemptionResponsemessage payload. - The consumer receives their voucher and the transaction is complete.

Error or Timeout at Originating System
- After a successful voucher lookup transaction, the originating system sends a
POSTcall to the/redemptionsendpoint of the API (redeemVoucheroperation). - An error occurs at the originating system, or a timeout occurs when the originating system does not receive a reponse.
- The originating system sends a
BasicReversalmessage (reverseRedeemoperation). - Electrum responds immediately with a
BasicReversalresponse message. - Electrum sends a reversal message to the service provider – if the provider supports reversal messaging – via a store-and-forward queue until a response is returned.

Error Upstream
- After a successful voucher lookup transaction, the originating system sends a
POSTcall to the/redemptionsendpoint of the API (redeemVoucheroperation). - An error occurs at the service provider.
- Electrum sends an
ErrorDetailmessage to the originating system and the consumer is informed of the error. - The consumer can decide whether to abort the transaction or attempt it again.

Timeout Upstream
- After a successful voucher lookup transaction, the originating system sends a
POSTcall to the/redemptionsendpoint of the API (redeemVoucheroperation). - An timeout error occurs when Electrum does not receive a response from the service provider.
- Electrum returns an
ErrorDetailmessage to the originating system. - The originating system sends a
BasicReversalmessage (reverseRedeemoperation) and Electrum immediately returns aBasicReversalresponse. - Electrum sends a reversal message to the service provider – if the provider supports reversal messaging – via a store-and-forward queue until a response is returned.

Important
You should not attempt transaction lookups until after the initial processing period concludes (after Electrum has received and processed the transaction outcome).