Shopify integration with external OTA API

Solved
VuHVo
Tourist
4 0 0

I'm a web developer working for a shopify merchant as freelancer. My client is trying to make our store an online travel agency (OTA) and requested that I integrate hotel inventory data from third-party api (a bed bank api).
Since i'm currently working fulltime as a .NET Core developer, I'd to use .Net Core app to source the hotel listings from bed bank. My understanding is that I can utilize Product Admin API (graphQL) to programmatically import inventory data into our store product db. But I cannot integrate Booking operations API (checking availability) into our storefront.

My question is, How can I integrate Booking operations API, or Availability checking API  into our Shopify storefront? Do I make requests from inside the Liquid Theme code? or should I use Shopify Custom/Embedded apps?
Ideally, I would like to save all inventory (static) data into my own .NET db (could be a sql server connected to my .net app), then, our storefront can somehow communicate with my .net app in order to search-filter the hotel listings, and then also communicate with my .net app to check availability, make booking, and even make payment for any hotel listing

Much appreciation if anyone can give me just a drafted architectural design for this requirement?

THANKS 

Accepted Solution (1)

Accepted Solutions
HunkyBill
Shopify Expert
4612 54 531

This is an accepted solution.

Any Shopify App you install in your store can run an App Proxy. If you want to play with a Shopify store, and hook it up to external APIs, booking APIs, whatever, so that the front-end, what Shopify customers would see and interact with, you use an App. And the App Proxy can be convenient, as it allows Ajax calls to the App, something you cannot securely do otherwise.

You can also embed processing now in sections and drop those sections into themes, and work that way, but someone else will have to chime in on whether or not that actually works and is a reasonable substitute to the older App Proxy pattern

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com

View solution in original post

Replies 6 (6)
HunkyBill
Shopify Expert
4612 54 531

An App can provide a proxy. A secure way for you to send front-end requests to your App. Since you want to query your own DB for info, use that pattern. You can then respond with JSON (or Liquid) and hence populate the front-end with reasonably accurate info.

In other words, you can build out your booking operations that way. Note that connecting bookings to actual cash register checkout stuff is going to be a challenge. For example, I could book a room for a week, but not actually pay... what would you do?

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
VuHVo
Tourist
4 0 0

Thank you so much for replying! I really appreciated your support!

What did you mean by "An App can provide a proxy. A secure way for you to send front-end requests to your App."?

I'm not quite which can provide a proxy? did u mean, a typical Shopify custom Apps or my own .NET app?

if u meant a Shopify app, does that mean I'd have to build another 'middle' Shopify app in order to send frontend requests to my .NET app? 

I'm still confused as to whether or not I can actually send frontend requests to my .NET app, directly from Shopify Theme Code (aka those *.liquid files)? u know, to populate my store's frontend data with 3rd-party data.

Additionally, can I hack into the Shopify's existing payment pipeline in order to use the booking API provided by the 3rd party supplier?

Thanks for your time!

HunkyBill
Shopify Expert
4612 54 531

This is an accepted solution.

Any Shopify App you install in your store can run an App Proxy. If you want to play with a Shopify store, and hook it up to external APIs, booking APIs, whatever, so that the front-end, what Shopify customers would see and interact with, you use an App. And the App Proxy can be convenient, as it allows Ajax calls to the App, something you cannot securely do otherwise.

You can also embed processing now in sections and drop those sections into themes, and work that way, but someone else will have to chime in on whether or not that actually works and is a reasonable substitute to the older App Proxy pattern

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com

View solution in original post

VuHVo
Tourist
4 0 0

Thank you for your suggestion Sir!

I'll take your feedback and start looking into the App Proxy pattern. 

For this kind of design, what type of Shopify Apps should I consider (Custom app, embedded app, standalone app) for the aforementioned App Proxy pattern?

If I was to write this Shopify App with React/Nodejs, is it correct that there should be no need for my .Net core app anymore? as the Shopify app can directly connect to my db (sql) server?

Best regards,

HunkyBill
Shopify Expert
4612 54 531

For a single store, you will want a custom App. You do not need one that gets reviewed by Shopify and installed in more than one store. If you do, just select a normal App, remembering that it will be unlisted, but installed in more than one store.

Embedded or not makes no difference. That is just how it looks and acts within the construct of a logged-in merchant, so do not worry about that. I have no idea what your existing App in dot net does, but you are correct, you can hook up your Shopify App to your DB and use it as you wish in your App. You can point N Apps at a single database you know. I often build Apps that have a direct embedded install in Shopify, doing all the oAuth and merchant API key work, but the guts of the complicated business logic take place in a separate App where we hide all the connections to external APIs and processing. This pattern is fine. Shopify only ever read/writes a Shop table, while the business App works with everything else. Think of drop shipping Apps and bookings, and other complex stuff. No need to encase all that in a monolithic Shopify App, when you can indeed keep that aspect of things dead simple.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
VuHVo
Tourist
4 0 0

Thanks! your design pattern sounds great! I'll try it out!

Basically here's what I'm gonna do

OneCentriciy Hotel Inventory Sourcing System.png