Create and Process a Transaction
Suppose you want to create and process a transaction coming from an external system such as a Point of Sale (PoS), or a Web channel, or a mobile application, and so on. This use case shows you how you can create such an application using the Oracle Loyalty Cloud REST API. This example use case tracks user behavior as a transaction, which is created and processed in the Loyalty system. The transactions are recorded at different external channels like a Point of Sale system. You can create and process these transactions with a single REST API call to Oracle Loyalty Cloud where the transaction type can be an Accrual or Redemption transaction.
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.
{
"MemberNumber" : 300100129329081,
"ProgramName" : "A2Z Bank",
"ProductNumber" : "CRMITEM-AS54888-00182745",
"InvOrgId": 204,
"AmountValue" : 100,
"TransactionDate" : "2018-08-23",
"Points" : 11,
"TypeCode": "ORA_TXN_ACC",
"SubTypeCode": "ORA_ACC_PROD"
}
Example Response
The following is an example of the response body.
{
"LoyTransactionId": 300100129329995,
"TransactionNumber": "300100129329995",
"TransactionDate": "2018-08-23T00:00:00+00:00",
"TypeCode": "ORA_TXN_ACC",
"SubTypeCode": "ORA_ACC_PROD",
"StatusCode": "ORA_TXN_STAT_PROCESSED",
"ActivityDay": null,
"ActivityHour": null,
"AdjustedListPrice": null,
"AmountValue": 100,
"ApproveDt": null,
"BidTransaction": "N",
"BookClassCode": null,
"BookingDt": null,
"BulkReferenceId": null,
"CancReasonCode": null,
"CancelledTransactionId": null,
"ChildTransactionId": null,
"Comments": null,
"CorporateReferenceNumber": null,
"CreatedBy": "LOYALTY_PROGRAM_ADMINISTRATOR",
"CreationDate": "2018-08-23T19:47:55+00:00",
"CurcyCode": "USD",
"CurcyExchDt": null,
"DestAirportCode": null,
"DestCityCode": null,
"DestZoneCode": null,
"DocumentNumber": null,
"EndDt": null,
"EnrolPromoId": null,
"ExpireInDays": null,
"ExternalReservationNumber": null,
"ExternalTransaction": "N",
"FareBasis": null,
"FareBasisCode": null,
"FareTypeCode": null,
"FlightNumber": null,
"FltTypeCode": null,
"GdsRecLocator": null,
"IncentivChoice": null,
"InternalDest": null,
"InternalFlightDt": null,
"InternalOrigin": null,
"ItemNumber": null,
"LastUpdateDate": "2018-08-23T19:47:57.044+00:00",
"LastUpdateLogin": "74078F0F807BA1E3E05334C4F00A77B7",
"LastUpdatedBy": "LOYALTY_PROGRAM_ADMINISTRATOR",
"LoanBalance": null,
"LoanRepaymentDt": null,
"LocationCode": null,
"LocationName": null,
"MarketingFlightNumber": null,
"Points": 11,
"OperFltNum": null,
"OptyCost": null,
"OrderNumber": null,
"OrderQuantity": null,
"OrigAirportCode": null,
"OrigAmount": null,
"OrigOrdItmId": null,
"OrigOrderId": null,
"OrigPoints": null,
"OrigZoneCode": null,
"OriginCityCode": null,
"OvrDupCheck": "N",
"PriceOverriden": "N",
"OwnerId": null,
"PackageCode": null,
"ParentTransactionId": null,
"PartitionName": null,
"PeriodDurCode": null,
"PeriodTypeCode": null,
"PnrName": null,
"PostDt": null,
"ProcFlowId": null,
"ProcessDt": "2018-08-23T19:47:57.238+00:00",
"ProcessingComment": null,
"ProcessingLog": "Assigned Points: 100.0 Bits, Expiry Date: null (Bits Per Dollar)<br>",
"PtnrProcDt": null,
"PtnrStatusCode": null,
"PymtTypeCode": null,
"QualifyingPointUsed": "N",
"RdmItmId": null,
"RedemptionQuantity": null,
"RedemptionQuantityUOMCode": null,
"ReasonCode": null,
"RefundBasisCode": null,
"RefundPct": null,
"RfndOvrdCmnts": null,
"RfndOvrdRsnCode": null,
"SmActionTypeCode": null,
"SourceCode": null,
"StartDt": "2018-08-23T19:47:55.657+00:00",
"SubStatusCode": "ORA_TXN_SUB_STAT_SUCCESS",
"SubmitDt": null,
"TaxAmount": null,
"TicketNumber": null,
"ToMemberNumber": null,
"TotalLines": null,
"TrvClassCode": null,
"TrvlDistance": null,
"TransactionChannelCode": null,
"TransactionSourceCode": null,
"UnaccMinor": "N",
"ValStatusCode": null,
"VoucherQuantity": null,
"ActivityDate": "2018-08-23T19:47:55.657+00:00",
"PaymentType": null,
"InvOrgId": 204,
"LineItemNumber": null,
"PnrNumber": null,
"Description": "Pro 400",
"CorpRefName": null,
"CurcyConvRateType": "Corporate",
"CorpCurrencyCode": "USD",
"MemberNumber": "300100129329081",
"PointTypeName": null,
"TransferPoints": null,
"TransferToMember": null,
"ExternalProductName": null,
"ExternalProductType": null,
"ExternalProductLine": null,
"TotalDays": null,
"CorpRefMemberId": null,
"CorpRefMemberType": null,
"ProgramName": "A2Z Bank",
"PrConId": 300100129329082,
"DisplayName": null,
"LoyAttrdefnBId": null,
"ProductNumber": "CRMITEM-AS54888-00182745",
"PartnerNumber": null,
"PartyNumber": null,
"AccrualDisputeStatusCode": null,
"AccrualDisputeTypeCode": null,
"AccrualDisputedTransactionNumber": null,
"AccItmList": "[{\"PointTypeName\":\"Bits\",\"LoyAttrdefnBId\":300100129323724,\"AccrualedValue\":100}]",
"links": [
{
"rel": "self",
"href": "https:/example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995",
"name": "loyTransactions",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278"
}
},
{
"rel": "canonical",
"href": "https://example.com:port:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995",
"name": "loyTransactions",
"kind": "item"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/lov/ProgramPVO2",
"name": "ProgramPVO2",
"kind": "collection"
},
{
"rel": "lov",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/lov/TransactionTravelClassPVO1",
"name": "TransactionTravelClassPVO1",
"kind": "collection"
},
.
.
.
{
"rel": "child",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/child/RedemptionItems",
"name": "RedemptionItems",
"kind": "collection"
},
{
"rel": "child",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/child/AccrualItems",
"name": "AccrualItems",
"kind": "collection"
},
{
"rel": "child",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/child/Promotions",
"name": "Promotions",
"kind": "collection"
},
{
"rel": "child",
"href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100129329995/child/Vouchers",
"name": "Vouchers",
"kind": "collection"
}
]
}