Tuesday, April 6, 2021

#839 - Integrating Oracle Hospitality Cloud and 3rd party CRM (SFDC) via OIC and OHIP

This is a typical Opera Integration use case - extract guest details from reservations/profiles and put them into a CRM for sales and marketing purposes. 






Simple scenario here - create contacts in SFDC for new Opera reservations. Here I query the Profile and Reservations objects in Opera via OHIP and then leverage the OIC SFDC adapter to create the relevant Contacts in SFDC. This will be a scheduled job that runs on a regular basis, ensuring my guest profiles etc are in sync with the relevant contact data in SFDC. 

Starting point, as usual, is Postman and the starter collection delivered by OHIP.


 


Above - my profile, including address and email details. Note the profile id - 17461. This will be used when creating the Reservation.








Note the Reservation id - 18652. I use this to add a service request to the reservation -




 




Now to retrieve reservation and profile details for the SFDC Contact creation - think of this as a scheduled job that picks up new reservations since the last run. OHIP provides the following api, which will return a list of reservations based on a start date.



 



I can use the reservation id returned in order to retrieve the full reservation details -













As you can see, the response payload includes the profile id. This value is then used to get the Profile information - 









So let's implement in OIC - I will not go into detail here, in respect of the OHIP apis - that has been covered exhaustively already in the previous Oracle Hospitality posts.

Implementing the SFDC Contact Sync in OIC

I create an OIC Scheduled Orchestration, adding a schedule parameter, dateLastRun. This parameter is used as input to the OHIP api call to retrieve the latest reservations.

Step 1 -Implement the retrieval of the reservation list.











As you can see, I have 2 reservations, including my own with id 18652.

Step 2 - Retrieve Reservation Details / RetrieveProfile






































Now they was an extra step I needed to do here, not covered in the previous posts.

Get Guest Profile - expects the following request parameters - fetchInstructions * 3


 




I only need to specify this once in the adapter configuration - 





















Then, in the mapper - 


















Now to creating the contact in SFDC. I have added a condition here - only save to CRM if guest has opted in for Email contact/Marketing etc.











































I do the required mappings - For this simple example I only map customer name and email address.

I have 2 reservations for 2 different guests - the first guest has opted out of email contact, the second - for myself - is ok with emails.

Here is the final test result - 


















Note the SFDC Contact id returned - 0035I00000J9SP3QAN
I check for the Contact in SFDC -













Couple of caveats here - 

1. no error handling has been implemented.
2. I should really check if Contact exists in SFDC, before creation.
3. I need to add a final step to update the dateLastRun parameter to the current date.

Finally, what about the No Minibar service request? I had added this to the reservation, but it was not retrieved per default. This can be retrieved via the fetchInstruction=indicators parameter.







 

This tells me I have 1 Service Request - I can then use the getServiceRequest api to retrieve it.










No comments: