Policy Issuance

When a customer applies for a policy on the Final Review page, a request for policy issuance and update of payment details is sent to Policy Management in SAP S/4HANA.

Integration Package

Integration Flow (iFlow): Issue Policy and Update Payment Details from SAP Commerce FSA in Policy Management in SAP S4HANA
Value Mappings SAP Commerce to S4HANA Value Mapping

Overview

When a customer applies for a policy on the Final Review page, a request for policy issuance and update of payment details is sent to Policy Management in SAP S/4HANA. In success case, the customer is redirected to the Order Confirmation page.

Since the payment information has been securely captured on the previous checkout step (Payment Details) through the integration with SAP digital payments add-on, in this call the system just has to send the minimum information about the payment details. That is, the payment token and the name of the payment provider that issued it.

If all goes well, the policy number is received in the call response from SAP Policy Management. The policy number is not displayed on the UI, however, as the policy replication has not taken place yet. A policy is therefore not available in Financial Services Accelerator at this point in time. The policy replication is tirggered in the next call.

In case of an error, a message is displayed to customers to inform them that the error has occurred, so that they have to start the checkout process again.

Integration Object

The integration object OutboundOrder is defined in the projectdata-order-outbound.impex file in sappqmintegrationfacades extension.

INSERT_UPDATE IntegrationObject; code[unique = true];
; OutboundOrder

INSERT_UPDATE IntegrationObjectItem; integrationObject(code)[unique = true]; code[unique = true]; type(code)
; OutboundOrder             ; Order                         ; Order                    ;
; OutboundOrder             ; InsuranceQuote                ; InsuranceQuote           ;
; OutboundOrder             ; CreditCardPaymentInfo         ; CreditCardPaymentInfo    ;
; OutboundOrder             ; Address                       ; Address                  ;
; OutboundOrder             ; User                          ; User                     ;
; OutboundOrder             ; CreditCardType                ; CreditCardType           ;

INSERT_UPDATE IntegrationObjectItemAttribute; integrationObjectItem(integrationObject(code), code)[unique = true]; attributeName[unique = true]; attributeDescriptor(enclosingType(code), qualifier); returnIntegrationObjectItem(integrationObject(code), code); unique[default = false]; autoCreate[default = false]
; OutboundOrder:Order                 ; paymentInfo      ; Order:paymentInfo                    ; OutboundOrder:CreditCardPaymentInfo ;
; OutboundOrder:Order                 ; quoteInformation ; Order:insuranceQuote                 ; OutboundOrder:InsuranceQuote        ;

; OutboundOrder:InsuranceQuote        ; quoteId          ; InsuranceQuote:quoteId               ;                                     ; true

; OutboundOrder:CreditCardPaymentInfo ; premiumPayer     ; CreditCardPaymentInfo:billingAddress ; OutboundOrder:Address               ;

; OutboundOrder:Address               ; firstName        ; Address:firstname                    ;                                     ;
; OutboundOrder:Address               ; lastName         ; Address:lastname                     ;                                     ;

; OutboundOrder:CreditCardPaymentInfo ; paymentToken     ; CreditCardPaymentInfo:subscriptionId ;                                     ; true
; OutboundOrder:CreditCardPaymentInfo ; paymentProvider  ; CreditCardPaymentInfo:type           ; OutboundOrder:CreditCardType        ;
; OutboundOrder:CreditCardType        ; type             ; CreditCardType:code                  ;                                     ; true

; OutboundOrder:Order                 ; user             ; Order:user                           ; OutboundOrder:User                  ;
; OutboundOrder:User                  ; customerId       ; User:externalId                      ;                                     ; true

You can view and modify the integration object in the Integration UI Tool perspective of Backoffice, under Modelling node.

Example Payload and Response

Based on the integration object, the PQMIntegrationSubmitOrderStrategy calls the OutboundServiceFacade to prepare the payload. The following code snippets show the example payload requests, one for each payment method:

Payload Request with Credit Card Payment Method

{
  "quoteInformation": {
    "quoteId": "9166"
  },
  "mainProduct": "AUTO_INSURANCE_GOLD",
  "user": {
    "customerId": "FSBP001000"
  },
  "selectedQuoteVariant": "AUTO_INSURANCE_GOLD",
  "paymentInfo": {
    "paymentToken": "3O5SUDPXRT4BQJZK7LHTRPPY",
    "premiumPayer": {
      "lastName": "Julie",
      "firstName": "Armstrong"
    },
    "paymentProvider": {
      "type": "DPMC"
    }
  }
}

Payload Request with Invoice Payment Method

{
  "quoteInformation": {
    "quoteId": "9166"
  },
  "mainProduct": "AUTO_INSURANCE_GOLD",
  "user": {
    "customerId": "FSBP001000"
  },
  "selectedQuoteVariant": "AUTO_INSURANCE_GOLD",
  "paymentInfo": {
    "paymentProvider": {
      "type": "INVOICE"
    }
  }
}

If the request is successful, SAP Policy Management sends the policy number in the response, for example:

Response

{
  "quoteInformation": {
    "policyNumber": "00002210000347507"
  }
}

On the other hand, the PQMIntegrationSubmitOrderStrategy handles possible errors.

You can monitor the outbound requests in the Integration UI Tool perspective of Backoffice, under the Start of the navigation pathMonitoring Next navigation step OutboundEnd of the navigation path node.

To view a specific payload, select it from the list and double-click within the Request Payload field. This action opens a context-menu. Download the payload data and open it with a JSON Viewer of your choice.