Create and Process a Queued Transaction

Loyalty administrators can now set a transaction status to the Queued state from a REST call on an In Progress transaction, or they can directly create a transaction in Queued status using REST. These queued transactions will get picked up and processed by the Loyalty Batch Engine. You can create and process a transaction asynchronously as a queued transaction by setting the transaction QueuedProcessingFlag to Y.

Example of Creating and Processing a Queued 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.

{
"ProgramName" : "Vinay",
"MemberNumber" : "MEM0000004544",
"ProductNumber" : "CRMITEM-AS54888-00182744",
"AmountValue" : 100,
"TypeCode" : "ORA_TXN_ACC",
"SubTypeCode" : "ORA_ACC_PROD",
"QueuedProcessingFlag":"Y"
}

Example Response

{
  "LoyTransactionId": 300100180883498,
  "TransactionNumber": "TXN0000011855",
  "TransactionDate": "2019-09-12T08:53:07.323+00:00",
  "ProgramNumber": "PRG0000001001",
  "ProgramName": "Vinay",
  "TypeCode": "ORA_TXN_ACC",
  "TypeMeaning": null,
  "SubTypeCode": "ORA_ACC_PROD",
  "SubTypeMeaning": null,
  "ProdId": 999994000663204,
  "StatusCode": "ORA_TXN_STAT_QUEUED",
  "StatusMeaning": null,
  "ActivityDay": null,
  "ActivityHour": null,
  "AdjustedListPrice": null,
  "AmountValue": 100,
  "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-12T08:53:07+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-12T08:53:10.837+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": null,
  "ProcessingComment": null,
  "ProcessingLog": null,
  "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-12T08:53:07.323+00:00",
  "SubStatusCode": null,
  "SubStatus": null,
  "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-12T08:53:07.323+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": true,
  "PartnerCompanyNumber": null,
  "CorpRefMemberId": null,
  "CorpRefName": null,
  "VoucherNumber": null,
  "links": [
    {
      "rel": "self",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100180883498",
      "name": "loyTransactions",
      "kind": "item",
      "properties": {
        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    },
.
.
.
    {
      "rel": "child",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyTransactions/300100180883498/child/Vouchers",
      "name": "Vouchers",
      "kind": "collection"
    }
  ]
}

Example of Enrolling a Member and Processing Rewards Asynchronously

Another example of an asynchronous transaction is to enroll the member to a program in real-time but process the rewards, enrollment, and referral rewards, if any, asynchronously. Here, while enrolling a new member, this example provides the referred by member number, and sets the RealTimeBonusFlag to N. Setting the flag makes the enrollment bonus transaction and the referral bonus transaction that will be created as part of this enrollment process to be set to the Queued status. These queued transactions will be processed by the Loyalty Batch Engine. The response to this member enrollment request won't have any information regarding the enrollment or the referral bonus transactions, so you have to query the newly enrolled member's child transactions as shown in the examples that follow.

Example URL

The following is an example of the resource URL.

POST

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

Example Request Body

The following is an example of the request body.

{
	"ContactFirstName": "Vinay3",
	"ContactLastName": "C3",
	"LoyProgramName": "Vinay",
	"ReferredByNumber": "MEM0000004544", "RealTimeBonusFlag": "N"
}

You can get the details of the referral bonus transaction using a GET request of the existing member's child transactions, that is, using this request (notice that the StatusCode and its meaning is Queued):

Example URL

The following is an example of the resource URL.

GET

https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000004544/child/MemberTransactions?onlyData=true

Example Response

{
  "items": [
    {
      "LoyTransactionId": 300100180927684,
      "TransactionNumber": "TXN0000012866",
      "TransactionDate": "2019-09-13T09:40:55.699+00:00",
      "ProgramNumber": "PRG0000001001",
      "ProgramName": "Vinay",
      "TypeCode": "ORA_TXN_ACC",
      "TypeMeaning": "Accrual",
      "SubTypeCode": "ORA_ACC_REF_BNS",
      "SubTypeMeaning": "Referral Bonus",
      "ProdId": null,
      "StatusCode": "ORA_TXN_STAT_QUEUED", "StatusMeaning": "Queued",
      "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-13T09:40:55.211+00:00",
      "CurcyCode": null,
      "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-13T09:40:55.524+00:00",
      "LastUpdateLogin": "9240350B30C6216AE05392BDF20A9ACE",
      "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": null,
      "ProcessingComment": null,
      "ProcessingLog": null,
      "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-13T09:40:55.699+00:00",
      "SubStatusCode": null,
      "SubStatus": null,
      "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-13T09:40:55.699+00:00",
      "PaymentTypeMeaning": null,
      "InvOrgId": null,
      "BackupInvOrgId": null,
      "LineItemNumber": null,
      "PnrNumber": null,
      "Description": null,
      "CurcyConvRateType": null,
      "CorpCurrencyCode": null,
      "MemberNumber": "MEM0000004544",
      "PointTypeName": "Regular",
      "TransferPoints": null,
      "ExternalProductName": null,
      "ExternalProductType": null,
      "ExternalProductTyeMeaning": null,
      "ExternalProductLine": null,
      "ExternalProductLineMeaning": null,
      "TotalDays": null,
      "PrConId": 300100180883117,
      "LoyAttrdefnBId": 300100180112446,
      "BackupProductNumber": null,
      "ProductNumber": 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": null,
      "PartnerCompanyNumber": null,
      "CorpRefMemberId": null,
      "CorpRefName": null,
      "VoucherNumber": null
    }
  ]
  ...
  ...
}

Similarly, you can get the details of enrollment bonus transaction using a GET call of the newly enrolled member's child transactions using the following request (notice that the StatusCode and its meaning is Queued):

Example URL

The following is an example of the resource URL.

GET

https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions

Example Response

{
  "items": [
    {
      "LoyTransactionId": 300100180927683,
      "TransactionNumber": "TXN0000012865",
      "TransactionDate": "2019-09-13T09:40:55.679+00:00",
      "ProgramNumber": "PRG0000001001",
      "ProgramName": "Vinay",
      "TypeCode": "ORA_TXN_ACC",
      "TypeMeaning": "Accrual",
      "SubTypeCode": "ORA_ACC_ENR_BNS",
      "SubTypeMeaning": "Enrollment Bonus",
      "ProdId": null,
      "StatusCode": "ORA_TXN_STAT_QUEUED", "StatusMeaning": "Queued",
      "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-13T09:40:55.167+00:00",
      "CurcyCode": null,
      "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-13T09:40:55.523+00:00",
      "LastUpdateLogin": "9240350B30C6216AE05392BDF20A9ACE",
      "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": null,
      "ProcessingComment": null,
      "ProcessingLog": null,
      "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-13T09:40:55.657+00:00",
      "SubStatusCode": null,
      "SubStatus": null,
      "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-13T09:40:55.679+00:00",
      "PaymentTypeMeaning": null,
      "InvOrgId": null,
      "BackupInvOrgId": null,
      "LineItemNumber": null,
      "PnrNumber": null,
      "Description": null,
      "CurcyConvRateType": null,
      "CorpCurrencyCode": null,
      "MemberNumber": "MEM0000005549",
      "PointTypeName": "Regular",
      "TransferPoints": null,
      "ExternalProductName": null,
      "ExternalProductType": null,
      "ExternalProductTyeMeaning": null,
      "ExternalProductLine": null,
      "ExternalProductLineMeaning": null,
      "TotalDays": null,
      "PrConId": 300100180927677,
      "LoyAttrdefnBId": 300100180112446,
      "BackupProductNumber": null,
      "ProductNumber": 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": null,
      "PartnerCompanyNumber": null,
      "CorpRefMemberId": null,
      "CorpRefName": null,
      "VoucherNumber": null,
      "links": [
        {
          "rel": "self",
          "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions/300100180927683",
          "name": "MemberTransactions",
          "kind": "item",
          "properties": {
            "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A657870000000017704000000017372001B6F7261636C652E6A626F2E646F6D61696E2E4E756C6C56616C75655899C1C58DAABEEB02000149000A6D53514C54797065496478700000000C78"
          }
        },
.
.
.
        {
          "rel": "lov",
          "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions/300100180927683/lov/TransactionDisputeTypeLookupPVO1",
          "name": "TransactionDisputeTypeLookupPVO1",
          "kind": "collection"
        }
      ]
    }
  ],
  "count": 1,
  "hasMore": false,
  "limit": 25,
  "offset": 0,
  "links": [
    {
      "rel": "self",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions",
      "name": "MemberTransactions",
      "kind": "collection"
    },
    {
      "rel": "action",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions/action/processTransaction",
      "name": "processTransaction",
      "kind": "other"
    },
    {
      "rel": "action",
      "href": "https://example.com:port/crmRestApi/resources/11.13.18.05/loyMembers/MEM0000005549/child/MemberTransactions/action/cancelTransaction",
      "name": "cancelTransaction",
      "kind": "other"
    }
  ]
}