Create a loyalty voucher (Deprecated)

post

/crmRestApi/resources/11.13.18.05/loyaltyVouchers

Request

Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
  • When set to true, the server will perform an Upsert operation instead of a Create. In an Upsert operation the server attempts to find an existing resource that matches the payload. If found, the server updates the existing resource instead of creating a new one. If not found, or when set to false (the default), a Create is performed.
Supported Media Types
Request Body - application/json ()
The following table describes the body parameters in the request for this task.
Root Schema : schema
Type: object
Show Source
  • The date used by Oracle Loyalty Cloud to fetch a valid voucher for a given activity date. The ActivityDate attribute is a parameter used in the availableVoucherFinder and the validateVoucherFinder finders. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Currency Amount
    The currency value of the voucher if the DiscountType attribute is set to Absolute Value. This value is provided by the user when creating a voucher and is required if the voucher is of type Absolute Value. This attribute depends up on the DiscountType attribute setting. There is no default value or limitation associated with this attribute.
  • Title: Discount Type
    The discount type that the voucher offers. A voucher discount can be set to Percentage or Absolute Value. It is provided as input from a user when creating the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Expiration Date
    The expiration date of the voucher. Oracle Loyalty Cloud generates this attribute value when it assigns a voucher action or the attribute value can be provided as an input when creating a voucher using the resource. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Member Voucher ID
    The primary key to identify a voucher. Oracle Loyalty Cloud generates this attribute value when it assigns a voucher action. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Member ID
    The identity of a member for the assigned voucher. Oracle Loyalty Cloud assigns this attribute value when it assigns a voucher action or the attribute value can be set indirectly by deriving MemberId from the MemberNumber attribute which is input when creating voucher using the resource. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Member Number
    The member number of the loyaltyMember attribute to whom the voucher is assigned. The MemberNumber attribute is used when assigning a voucher or creating a voucher using the resource. The MemberNumber attribute is also used as a parameter in the availableVoucherFinder finder. There is no default value or dependency associated with this attribute.
  • Title: Object Version Number
    The voucher object version number. Oracle Loyalty Cloud sets this attribute. There is no default value, dependency, or limitation associated with this attribute.
  • The identifier of the product for an existing voucher. Although its not a best practice to expose the identifier of a product, this attribute is used for building mobile UIs and drop downs, and provides information on the product that is in use. This value cannot be set through the Oracle Loyally Cloud UI. To specify product information, use Voucher Type as input while creating the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Quantity
    Default Value: 1
    The quantity of vouchers that are assigned to a member. The value is a positive integer. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Used Date
    The date when a valid voucher that is available is changed to the Used status. This date gets assigned when the voucher status is changed from Available to Used status through a PATCH request. There is no default value, dependency, or limitation associated with this attribute.
  • This flag returns true if the voucherStatus attribute is set to Available and its ActivityDate attribute falls in between the voucherEffectiveStartDt and ExpirationDt attributes. This is a calculated field which shows the validity of the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Basis
    The voucher assignment based on the transaction type. Oracle Loyalty Cloud sets it to Accrual for accrual type transactions and Redemption for redemption type of transactions. This is provided as an input value from a user when creating the voucher. There is no default value or limitation associated with this attribute.
  • Title: Discount Percentage
    The voucher discount value. If the DiscountType attribute of a voucher is set to Percentage, the value of discount must be a positive integer. This value is provided as input value from a user when creating the voucher. There is no default value or limitation associated with this attribute.
  • Title: Voucher Effective Start Date
    The date when the voucher is effective. This date is assigned during an assign voucher action or when voucher is created using the resource.
  • Title: Voucher Number
    Maximum Length: 30
    The alternative way to identify a voucher. The UI shows voucher number but the VoucherNumber attribute is used in the URI to update a voucher record using the resource. The VoucherNumber attribute can also be used as parameter for the validateVoucherFinder finder. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Status
    The text that defines the voucher status. A list of accepted values are Available, Expired or Used. The VoucherStatus attribute can be changed from Available to Used only through a PATCH request. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Type
    The product description for the voucher. The user enters the description of product as the VoucherType, which is displayed as the product description on the Loyalty Voucher UI page. Oracle Loyalty Cloud assigns the ProdId attribute value with the identifier of the product when the user inputs the product description. There is no default value, dependency, or limitation associated with this attribute.
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Body ()
Root Schema : loyaltyVouchers-item-response
Type: object
Show Source
  • The date used by Oracle Loyalty Cloud to fetch a valid voucher for a given activity date. The ActivityDate attribute is a parameter used in the availableVoucherFinder and the validateVoucherFinder finders. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Currency Amount
    The currency value of the voucher if the DiscountType attribute is set to Absolute Value. This value is provided by the user when creating a voucher and is required if the voucher is of type Absolute Value. This attribute depends up on the DiscountType attribute setting. There is no default value or limitation associated with this attribute.
  • Title: Discount Type
    The discount type that the voucher offers. A voucher discount can be set to Percentage or Absolute Value. It is provided as input from a user when creating the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Expiration Date
    The expiration date of the voucher. Oracle Loyalty Cloud generates this attribute value when it assigns a voucher action or the attribute value can be provided as an input when creating a voucher using the resource. There is no default value, dependency, or limitation associated with this attribute.
  • Links
  • Title: Member Voucher ID
    The primary key to identify a voucher. Oracle Loyalty Cloud generates this attribute value when it assigns a voucher action. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Member ID
    The identity of a member for the assigned voucher. Oracle Loyalty Cloud assigns this attribute value when it assigns a voucher action or the attribute value can be set indirectly by deriving MemberId from the MemberNumber attribute which is input when creating voucher using the resource. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Member Number
    The member number of the loyaltyMember attribute to whom the voucher is assigned. The MemberNumber attribute is used when assigning a voucher or creating a voucher using the resource. The MemberNumber attribute is also used as a parameter in the availableVoucherFinder finder. There is no default value or dependency associated with this attribute.
  • Title: Object Version Number
    The voucher object version number. Oracle Loyalty Cloud sets this attribute. There is no default value, dependency, or limitation associated with this attribute.
  • The identifier of the product for an existing voucher. Although its not a best practice to expose the identifier of a product, this attribute is used for building mobile UIs and drop downs, and provides information on the product that is in use. This value cannot be set through the Oracle Loyally Cloud UI. To specify product information, use Voucher Type as input while creating the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Quantity
    Default Value: 1
    The quantity of vouchers that are assigned to a member. The value is a positive integer. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Loyalty Transaction ID
    Read Only: true
    The transaction identifier of the transaction. This attribute is the primary key identifier for a loyalty transaction. This loyalty transaction is shown as read-only child of the vouchers resource. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Transaction Number
    Read Only: true
    Maximum Length: 30
    The transaction number of the transaction. This is an alternative identifier for a transaction, and is displayed in the Oracle Loyalty Cloud UI. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Used Date
    The date when a valid voucher that is available is changed to the Used status. This date gets assigned when the voucher status is changed from Available to Used status through a PATCH request. There is no default value, dependency, or limitation associated with this attribute.
  • This flag returns true if the voucherStatus attribute is set to Available and its ActivityDate attribute falls in between the voucherEffectiveStartDt and ExpirationDt attributes. This is a calculated field which shows the validity of the voucher. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Basis
    The voucher assignment based on the transaction type. Oracle Loyalty Cloud sets it to Accrual for accrual type transactions and Redemption for redemption type of transactions. This is provided as an input value from a user when creating the voucher. There is no default value or limitation associated with this attribute.
  • Title: Discount Percentage
    The voucher discount value. If the DiscountType attribute of a voucher is set to Percentage, the value of discount must be a positive integer. This value is provided as input value from a user when creating the voucher. There is no default value or limitation associated with this attribute.
  • Title: Voucher Effective Start Date
    The date when the voucher is effective. This date is assigned during an assign voucher action or when voucher is created using the resource.
  • Title: Voucher Number
    Maximum Length: 30
    The alternative way to identify a voucher. The UI shows voucher number but the VoucherNumber attribute is used in the URI to update a voucher record using the resource. The VoucherNumber attribute can also be used as parameter for the validateVoucherFinder finder. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Status
    The text that defines the voucher status. A list of accepted values are Available, Expired or Used. The VoucherStatus attribute can be changed from Available to Used only through a PATCH request. There is no default value, dependency, or limitation associated with this attribute.
  • Title: Voucher Type
    The product description for the voucher. The user enters the description of product as the VoucherType, which is displayed as the product description on the Loyalty Voucher UI page. Oracle Loyalty Cloud assigns the ProdId attribute value with the identifier of the product when the user inputs the product description. There is no default value, dependency, or limitation associated with this attribute.
Back to Top

Examples

The following example shows how to assign a voucher, Supremo Discount Voucher, to a member with member number 300100111350326 .

Use POST with the following URI syntax to assign the voucher:

https://example.com/crmRestApi/resources/11.13.18.05/loyaltyVouchers

Request Body Example

{
"VoucherType" : "Supremo Discount Voucher",
"MemberNumber": 300100111350326,
"ExpirationDt": "2017-12-12",
"voucherStatus" : "Available",
"Quantity" : 1,
"VoucherBasis" : "Redemption"
}

Example of Response Header

cache-control -no-cache, no-store, must-revalidate
connection -Keep-Alive
content-encoding -gzip
content-language -en
content-length -686
content-type -application/vnd.oracle.adf.resourceitem+json
date -Wed, 23 Aug 2017 08:22:27 GMT
etag-"ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
keep-alive -timeout=61, max=100
link -<https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111425917>;rel="self";kind="item";name="loyaltyVouchers"
location -https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111425917
rest-framework-version -1
server -Oracle-HTTP-Server-11g
vary -User-Agent
x-oracle-dms-ecid -005LqTdYea6Fw0GLIys1yf0006cp00031Z

Example of Response Body

{
    "ExpirationDt": "2017-12-12T00:00:00+00:00",
    "MemberId": 300100111350325,
    "LoyMemVchrId": 300100111387918,
    "ProdId": 300100111353118,
    "Quantity": 1,
    "UsedDt": null,
    "voucherEffectiveStartDt": null,
    "VoucherNumber": "300100111387918",
    "validFlag": "false",
    "voucherStatus": "Available",
    "ActivityDate": null,
    "VoucherDiscountValue": null,
    "CurrencyAmount": null,
    "VoucherType": "Supremo Discount Voucher",
    "ObjectVersionNumber": 1,
    "MemberNumber": "300100111350326",
    "DiscountType": null,
    "VoucherBasis": "Redemption",
    "links": [
        {
            "rel": "self",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918",
            "name": "loyaltyVouchers",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918",
            "name": "loyaltyVouchers",
            "kind": "item"
        },
        {
            "rel": "lov",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918/lov/MemberPVO1",
            "name": "MemberPVO1",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918/lov/ProductVO1",
            "name": "ProductVO1",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918/lov/BasisCodeLookupPVO",
            "name": "BasisCodeLookupPVO",
            "kind": "collection"
        },
        {
            "rel": "lov",
            "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyaltyVouchers/300100111387918/lov/VoucherBasisLookupPVO",
            "name": "VoucherBasisLookupPVO",
            "kind": "collection"
        }
    ]
}
Back to Top