Redeem a Voucher in a Single Step

To redeem a member voucher in prior versions of Oracle Loyalty Cloud, you would've had to make multiple REST API calls in the following order:

  1. Check the voucher for availability using a GET call on the member voucher resource.
  2. Create and process the redemption transaction using a POST call on the transaction
  3. Change the voucher status using a PATCH call on the voucher number.

But now you can redeem a voucher in a single step by specifying the VoucherNumber parameter in the input payload, provided you have completed the required one-time setup in the UI.

In this use case, the example REST API call does the following in one go:
  • Validates that the voucher number specified actually belongs to the member number before Oracle Loyalty Cloud saves the redemption transaction.

    Note:

    If the voucher specified doesn't belong to the member in the transaction you will receive an LOV validation error at the time of transaction creation.
  • Processes the transaction successfully, but only after the Redeem Voucher engine action checks the following items for the specified voucher:
    • The voucher belongs to the member.
    • The voucher is in effect (the voucher's start date is greater than or equal to Sysdate).
    • The voucher has not expired in case the expiration is NOT NULL.
    • The voucher's status is Available.

    Note:

    If any of these checks fail, Oracle Loyalty Cloud rejects the redemption transaction and places it into the Rejected status..

This use case demonstrates that redeeming a voucher is now a single step process and is an atomic transaction, that is, either Oracle Loyalty Cloud processes the redemption transaction successfully and changes the voucher's status to Used, or it rejects the redemption transaction and leaves the voucher unused. This helps to prevent any fraud scenarios related to concurrent voucher usage, and also improves performance when redeeming a voucher.

Prerequisite Setup

You must complete the following one-time prerequisite setup in the Oracle Loyalty Cloud UI for the REST call to work:

  • Program Level Attributes Setup. Define the Voucher Number attribute to be used in Redeem Voucher Action in the UI:
    This image shows an example of Program Level Attribute setup.
  • Redeem Voucher Action Setup. Define a new action, for example, Redeem Voucher, in the promotion that applies to any Type or Subtype combination.

    Note:

    You can add the action (Redeem Voucher) to an existing rule or to a new rule under the promotion that is applied to the redemption transaction. Make sure the transaction attribute (for example, Txn Voucher Number) added under the program is selected by clicking the Attribute toggle icon (that is, the mouse symbol) for redeeming a voucher.
    This image shows an example of Redeem Voucher Action setup.
    The rule could be something similar to:
    IF 
    	[Txn Voucher Number] is not blank 
    		THEN DO 
    			Redeem Voucher 
    				Voucher: [Txn Voucher Number] 
    				Notes: "Redeem voucher"

Example URL

The following is an example of the resource URL.

POST

https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions

Example Request Body

The following is an example of the request body.

{
"ProgramName" : "Vinay",
"MemberNumber" : "MEM0000004544",
"ProductNumber" : "CRMITEM-AS54888-00182744",
"TypeCode" : "ORA_TXN_RED",
"SubTypeCode" : "ORA_RED_PROD",
"VoucherNumber":"VCHR0000000006"
}

Example Response

{
  "LoyTransactionId": 300100180888454,
  "TransactionNumber": "TXN0000011865",
  "TransactionDate": "2019-09-12T11:21:57.527+00:00",
  "ProgramNumber": "PRG0000001001",
  "ProgramName": "Vinay",
  "TypeCode": "ORA_TXN_RED",
  "TypeMeaning": "Redemption",
  "SubTypeCode": "ORA_RED_PROD",
  "SubTypeMeaning": "Product",
  "ProdId": 999994000663204,
  "StatusCode": "ORA_TXN_STAT_PROCESSED",
  "StatusMeaning": "Processed",
  "ActivityDay": null,
  "ActivityHour": null,
  "AdjustedListPrice": null,
  "AmountValue": null,
  "ApproveDt": null,
  "BookClassCode": null,
  "BookingClass": null,
  "BookingDt": null,
  "CancReasonCode": null,
  "CancelledTransactionId": null,
  "ChildTransactionId": null,
  "Comments": null,
  "CorporateReferenceNumber": null,
  "CreatedBy": "LOYALTY_PROGRAM_ADMINISTRATOR",
  "CreationDate": "2019-09-12T11:21:57+00:00",
  "CurcyCode": "USD",
  "CurcyExchDt": null,
  "DestAirportCode": null,
  "DestAirport": null,
  "DestCityCode": null,
  "DestZoneCode": null,
  "DestZone": null,
  "DocumentNumber": null,
  "EndDt": null,
  "ExpireInDays": null,
  "ExternalReservationNumber": null,
  "ExternalTransaction": "N",
  "FareBasis": null,
  "FareBasisMeaning": null,
  "FareBasisCode": null,
  "FareTypeCode": null,
  "FareType": null,
  "FlightNumber": null,
  "FltTypeCode": null,
  "GdsRecLocator": null,
  "IncentivChoice": null,
  "IntegrationId": null,
  "InternalDest": null,
  "InternalFlightDt": null,
  "InternalOrigin": null,
  "ItemNumber": null,
  "LastUpdateDate": "2019-09-12T11:22:02+00:00",
  "LastUpdateLogin": "923FE2F901632162E05392BDF20A4EA3",
  "LastUpdatedBy": "LOYALTY_PROGRAM_ADMINISTRATOR",
  "LoanBalance": null,
  "LoanRepaymentDt": null,
  "LocationName": null,
  "MarketingFlightNumber": null,
  "Points": null,
  "OperFltNum": null,
  "OptyCost": null,
  "OrderNumber": null,
  "OrderQuantity": null,
  "OrigAirportCode": null,
  "OrigAirport": null,
  "OrigAmount": null,
  "OrigOrdItmId": null,
  "OrigOrderId": null,
  "OrigPoints": null,
  "OrigZoneCode": null,
  "OrigZone": null,
  "OriginCityCode": null,
  "OvrDupCheck": "N",
  "PriceOverriden": "N",
  "OwnerId": null,
  "PackageCode": null,
  "ParentTransactionId": null,
  "PartitionName": null,
  "PeriodDurCode": null,
  "PeriodTypeCode": null,
  "PnrName": null,
  "PostDt": null,
  "ProcessDt": "2019-09-12T11:22:01.698+00:00",
  "ProcessingComment": null,
  "ProcessingLog": "Redeemed Voucher Number :  VCHR0000000006 Voucher Used Date : 2019-09-12 11:22:01.293 () <br>",
  "PtnrProcDt": null,
  "PtnrStatusCode": null,
  "PymtTypeCode": null,
  "QualifyingPointUsed": "N",
  "RedemptionQuantity": null,
  "RedemptionQuantityUOMCode": null,
  "ReasonCode": null,
  "RefundPct": null,
  "RfndOvrdCmnts": null,
  "RfndOvrdRsnCode": null,
  "SmActionTypeCode": null,
  "SmActionType": null,
  "SourceCode": null,
  "Source": null,
  "StartDt": "2019-09-12T11:21:57.526+00:00",
  "SubStatusCode": "ORA_TXN_SUB_STAT_SUCCESS",
  "SubStatus": "Success",
  "SubmitDt": null,
  "TaxAmount": null,
  "TicketNumber": null,
  "ToMemberNumber": null,
  "TotalLines": null,
  "TrvClassCode": null,
  "TrvClass": null,
  "TrvlDistance": null,
  "TransactionChannelCode": null,
  "TransactionChannel": null,
  "TransactionSourceCode": null,
  "UnaccMinor": "N",
  "ValStatusCode": null,
  "VoucherQuantity": null,
  "ActivityDate": "2019-09-12T11:21:57.527+00:00",
  "PaymentTypeMeaning": null,
  "InvOrgId": 204,
  "BackupInvOrgId": null,
  "LineItemNumber": null,
  "PnrNumber": null,
  "Description": "Pro 500",
  "CurcyConvRateType": "Corporate",
  "CorpCurrencyCode": "USD",
  "MemberNumber": "MEM0000004544",
  "PointTypeName": null,
  "TransferPoints": null,
  "ExternalProductName": null,
  "ExternalProductType": null,
  "ExternalProductTyeMeaning": null,
  "ExternalProductLine": null,
  "ExternalProductLineMeaning": null,
  "TotalDays": null,
  "PrConId": 300100180883117,
  "LoyAttrdefnBId": null,
  "ProductNumber": "CRMITEM-AS54888-00182744",
  "BackupProductNumber": null,
  "PartnerNumber": null,
  "AccrualDisputeStatusCode": null,
  "AccrualDisputeStatus": null,
  "AccrualDisputeTypeCode": null,
  "AccrualDisputeType": null,
  "AccrualDisputedTransactionNumber": null,
  "AccItmList": null,
  "CancelledTransactionNumber": null,
  "ChildTransactionNumber": null,
  "ParentTransactionNumber": null,
  "ReferredByMemNumber": null,
  "EventName": null,
  "QueuedProcessingFlag": false,
  "PartnerCompanyNumber": null,
  "CorpRefMemberId": null,
  "CorpRefName": null,
  "VoucherNumber": "VCHR0000000006",
  "links": [
    {
      "rel": "self",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100180888454",
      "name": "loyTransactions",
      "kind": "item",
      "properties": {
        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278"
      }
    },
.
.
.
        {
      "rel": "child",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100180888454/child/Vouchers",
      "name": "Vouchers",
      "kind": "collection"
    }
  ]
}