Can we write custom API scripts in Shopify end ?

Highlighted
New Member
3 0 0

I would like to push shophify data into a 3rd party service. So I need to write custom API scripts in Shophify end. The API is of version 2 API, I need to generate the access and refresh tokens to invoke the API calls to push data to a 3rd party service.

Can anyone from the shophify team check if this is possible within shophify or not ? If you have web-hooks to create an API call, it is possible to use access and refresh token generated upon that and pass the json data into body. 

Please someone let me know If this is possible within shophify or not?

0 Likes
Highlighted
Shopify Partner
667 47 134

Assuming you are talking about the Shopify e-com platform, this (other than some server-side Liquid) is primarily a client-side platform. So any handling of API credentials, access tokens, etc. will likely be very visible to the client web browser. 

I would recommend creating a private app, installing that private app (https://help.shopify.com/en/manual/apps/private-apps) in your Shopify shop, and having a middleware service you manage then handle things communicating with your third-party API endpoints. That way you hide things from the Shopify client's end.

You can listen for webhooks that Shopify sends to your middleware service (https://shopify.dev/docs/admin-api/rest/reference/events/webhook), allow Shopify to pass through to your middleware service during the e-com client web browser session (https://shopify.dev/tutorials/display-data-on-an-online-store-with-an-application-proxy-app-extensio...), poll Shopify for information based on your third party API endpoint requirements, etc.    

Hope this helps introduce the general concepts at least!

Highlighted
New Member
3 0 0
Hi Greg,

Thanks for the reply.

I created a private application in Shophify. You have referred to the
web-hooks to create API calls.

Can you confirm, If that web-hooks can be used to create API calls with
dynamic access tokens. Which will be generated every 1 hour within the
application ?

Am afraid that i have read that web-hooks can only create a single API call
and they are stateless.

Please confirm, If we can write OAuth based API call in Shophify apps.

Awaiting for your response.
0 Likes
Highlighted
Shopify Partner
667 47 134

These two areas are totally different.

 

  1. A webhook is something that's registered against a Shopify shop. That when triggered, sends event data to a resource outside of Shopify. It's indeed stateless, and up to your receiver as to what to do with the event data. For example, say you add a webhook for when a new order is created. When that happens, Shopify will fire off the "notification" of the new order that's been added. It's up to the receiver to parse the "notification's" contents and handle things. You are the receiver.
  2. A private app is something that's installed on a Shopify shop. Which has API credentials, allowing the app to interface with the Shopify shop. This is where the private app has to be installed, requires the OAuth authorization granting the private app access to the Shopify shop, etc. For example, let's say you have a private app that queries the Shopify shop for the 10 most recently-placed orders. Your private app is creating the API request, and once you send it off then you wait for the API response with the data. You are the initiator. 
0 Likes
Highlighted
New Member
3 0 0
Thanks again Greg,

That was a good explanation

I got that now i.e. From private app, we can communicate to the shopify
app. So that we can pull data from shopify app in Private app using
custom API calls.

So once we create an API call with Oauth of shopify API, it will get/pull
the data.

Now, can we push that data to external services like salesforce, zoho
creator or quick base ? Which has OAuth based Authentication API to push
data into their database.
0 Likes
Highlighted
Shopify Partner
667 47 134

So, a Shopify private app will allow you to push/pull data with Shopify. As for those other platforms you mention (e.g. - Salesforce, Zoho, etc.) they presumably each have their own API methodology and logic. You'd need to review what they available and how it works.

If you are looking for a more straightforward integration that's relatively common then perhaps there is an existing Shopify app available for it. If not then you will need to seek out a third-party development company, look to hire in-house development talent, etc.

Good luck!

0 Likes
Highlighted
Shopify Partner
78 2 3

Hi

If you are looking at connecting between platforms there are a few services that already let you connect them and transfer data.

Zapier: https://zapier.com/ 

Onesass: https://www.onesaas.com/

If you only need basic data then something like this may be sufficient.

Otherwise if you have more complex data transfer requirements we customise our Shopify integrations for clients and map and connect data to different platforms.

Regards

Tom

Over 16 years experience in operating ecommerce businesses.
DM me on here or via message at Channelup
0 Likes