Assign a Voucher to a Loyalty Member
So you want to assign a voucher to a Loyalty member in Oracle Loyalty Cloud using the REST API? Well, this example shows you how to do just that. After you have assigned the voucher, you can then view the voucher details by querying the member voucher for that particular member.
Assign a Voucher to a Loyalty Program
In this use case, a two day voucher for 20 dollars is issued to member number 300100152563636.
Example URL
The following is an example of the resource URL.
POST
https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers
Example Request
The following is an example of the request body.
{
"MemberNumber": "300100152563636",
"InvOrgId": 204,
"ProductNumber": "UH7",
"VoucherEffectiveStartDt": "2018-10-25",
"ExpirationDt": "2018-10-27",
"VchrBasisCode": "ORA_VOUC_BASIS_ABSOLUTE",
"BasisCode": "ORA_VOUC_BASIS_RED",
"Quantity": 1,
"CurrencyAmount": 20
}
Example Response
{
"MemberNumber": "300100152563636",
"VoucherNumber": "300100153927885",
"BasisCode": "ORA_VOUC_BASIS_RED",
"ConsumedTxnId": null,
"CurrencyAmount": 20,
"VoucherEffectiveStartDt": "2018-10-25",
"VoucherDiscountValue": null,
"ExpirationDt": "2018-10-27T00:00:00+00:00",
"LoyMemVchrId": 300100153927885,
"MemberId": 300100152563635,
"Quantity": 1,
"TxnId": null,
"StatusCode": "ORA_VOUC_STATUS_AVLBL",
"TxnItemId": null,
"UsedDt": null,
"VchrBasisCode": "ORA_VOUC_BASIS_ABSOLUTE",
"Description": "Stellent SealedMedia eRoom Custom User Provisioning",
"InvOrgId": 204,
"DiscountValue": null,
"ActionNote": null,
"ActivityDate": null,
"validFlag": "false",
"Name": null,
"PrConId": 300100152563637,
"TxnNum": null,
"ProductNumber": "UH7",
"links": [
{
"rel": "self",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885",
"name": "vouchers",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885",
"name": "vouchers",
"kind": "item"
},
{
"rel": "parent",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636",
"name": "loyMembers",
"kind": "item"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/BasisCodeLookupPVO",
"name": "BasisCodeLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/SalesCatalogProductProgPVO1",
"name": "SalesCatalogProductProgPVO1",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/SatusCodeLookupPVO",
"name": "SatusCodeLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/VoucherBasisLookupPVO",
"name": "VoucherBasisLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/MemberVO2",
"name": "MemberVO2",
"kind": "collection"
}
]
}
Get the Voucher Details Using the Member Voucher Inquiry API
After you have created a voucher, you can get the details for that voucher.
Example URL
The following is an example of the resource URL.
GET
https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885
Example Response
The following is an example of the response body.
{
"MemberNumber": "300100152563636",
"VoucherNumber": "300100153927885",
"BasisCode": "ORA_VOUC_BASIS_RED",
"ConsumedTxnId": null,
"CurrencyAmount": 20,
"VoucherEffectiveStartDt": "2018-10-25",
"VoucherDiscountValue": null,
"ExpirationDt": "2018-10-27T00:00:00+00:00",
"LoyMemVchrId": 300100153927885,
"MemberId": 300100152563635,
"Quantity": 1,
"TxnId": null,
"StatusCode": "ORA_VOUC_STATUS_AVLBL",
"TxnItemId": null,
"UsedDt": null,
"VchrBasisCode": "ORA_VOUC_BASIS_ABSOLUTE",
"Description": "Stellent SealedMedia eRoom Custom User Provisioning",
"InvOrgId": 204,
"DiscountValue": null,
"ActionNote": null,
"ActivityDate": null,
"validFlag": "false",
"Name": null,
"PrConId": 300100152563637,
"TxnNum": null,
"ProductNumber": "UH7",
"links": [
{
"rel": "self",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885",
"name": "vouchers",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885",
"name": "vouchers",
"kind": "item"
},
{
"rel": "parent",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636",
"name": "loyMembers",
"kind": "item"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/BasisCodeLookupPVO",
"name": "BasisCodeLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/SalesCatalogProductProgPVO1",
"name": "SalesCatalogProductProgPVO1",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/SatusCodeLookupPVO",
"name": "SatusCodeLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/VoucherBasisLookupPVO",
"name": "VoucherBasisLookupPVO",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/300100152563636/child/vouchers/300100153927885/lov/MemberVO2",
"name": "MemberVO2",
"kind": "collection"
}
]
}