How build a Jumpseller App.
You are free for choosing whatever language or web framework you want to develop your Jumpseller App, as well as where you want to host it. Jumpseller Apps use the Jumpseller OAuth2 endpoint for authentication and the Jumpseller API to interact with the online store.
Before starting, you need to register the App that you are going to develop on the Administration area for users to be able to authenticate on the App and for the App to be able to access the API.
On the Administration section of your online store you are able to register a new App on the Apps section. You can find the section on the left side main menu.
Author - name of the company or the person that is developing the app.
Name - name of your new App. Example: My New App.
Callback URL - absolute callback URL of your web App. Read section The Root route for more information.
Application URL - absolute (root) URL of your web App. Read section The Callback route for more information.
Image URL - absolute URL for your app's cover image. Supported formats: JPEG or PNG. Dimensions: 600x150 pixels.
Description - description of your App. Text Limit: 145 characters.
Fill up the form with your app's informations and click on the SAVE button. You will be redirected to the Developers tab where you can manage all your apps.
As you can note, all your apps have a TESTING tag. It means they are available JUST ON YOUR STORE, i.e., no other Merchant can install it yet.
Now your App is ready for installation. Go to your Developers tab and click the I WANT TO TEST button within your App's card to install your new App in your store.
After installing and testing your app, when you want to make it public, i.e., available for all Merchants, please contact us with the URL of the App, the Name of the Author (company / person responsible for supporting the App) and the Email of the Author.
Scopes are required settings to specify which part of the Merchant's store data your App would like to access. If your App wants to request products data, for instance, you must have the read_products scope, otherwise you are not going to be able to get these data by the Jumpseller API. The scopes are also important as part of the permission process by the Merchant who's installing your App, i.e., if the user sees that your App requests the product reading scope and he does not want to share it with no one, he can deny the authorization for your App and give up installing and using it. So, request just the necessary scopes for your App.
Check how to Request Authorization setting the scopes.
The first step was to register your new App in the store administration area but for now is just an eggshell because the web App does not exist yet. Keep reading this article to understand the basic concepts that will allow you to build your first Jumpseller App.
The first important concept to understand is about OAuth 2. When you registered your new App in Jumpseller Admin on the previous part for this article, in fact you were creating a new OAuth 2 application. That means your App needs to run throughout the Authorization Flow of OAuth 2.
Go to the OAuth 2 page to better understand how it works.
There you can see listed the new App you've created. Click on the name or description of your App and you will be redirected to the edit page.
On the edit page you can see all informations you have inserted when you registered your App as well as two new fields: CLIENT ID and CLIENT SECRET.
Copy and save your App's id and secret anywhere. You are going to need it later for the OAuth 2 flow.
DO NOT share your app's client id and client secret with anyone.
When developing your Jumpseller App, you are free to decide what kind of application you are going to build and which routes it will have.
But to work with Jumpseller is very important to have two of them: The root route and the callback route.
Let's get to know them better!
Every Jumpseller App requires some input from the Merchant, i.e., before the user is being able to use it. The page rendered by this route will require the inputs needed for the initial App setup.
Our Olark App is a good example of it. In order to have the Olark's online chat in your store, you should signup in theirs website, copy and past your Olark ID on the App form and save it.
So your root route is responsible for presenting this kind of required settings input page for the Merchant.
Make sure your App uses an SSL certificate. Non-HTTPs URLs cannot be loaded.
As you already know, the Jumpseller Apps use the Authorization Flow of OAuth 2. A redirect from the Jumpseller OAuth 2 service to your callback route is part of this flow.
The callback route is where you are going to be able to get your access token from the OAuth 2 service and use it to read and write to the online store API.
Visit the OAuth 2 page to better understand about the callback route and visit the API page for learning how to use the OAuth 2's access token when you want to access the online store API.
As mentioned before, you are free to choose which programming languages or web framework you want to use to build your App.
For now, let's just create a really simple basic example to help you reinforce what was learned so far.
If you use Ruby, this Sinatra's App Skeleton is available for you to use.
This example uses the port 8000 but you can change it if you want.
You have your web server up and running in your local machine. Now it is time for testing it!
As you remember, when you registered your App in the Jumpseller Admin, you had to inform a callback and an application URL.
Save it, go to the Installed tab, find your App and click on it.
You'll realize that you still can't see anything. That is because Jumpseller Admin can't access the web server in your local machine, at least not yet, while you use the localhost.
A simple solution for making your local web application publicly available is tunneling it. There are lots of solutions for tunneling, but we will use ngrok in this tutorial.
Brew works only for Mac but there are lots of options to install ngrok according your OS: downloading it, brew, npm, apt-get, etc.
As you can see above, ngrok creates for you a public URL and manages the tunneling for your local web server, i.e., every request this public URL receives, ngrok handles the request to make it reach your local web server.
Access this public URL on your browser and you will see the same as in http://localhost:8000, the Hello, World! message.
Save it and try to access your App again clicking on it within the Installed tab on the Apps section. The Hello, World! message is visible, i.e., the Jumpseller App was able to load your local web application inside its iframe.
Congratulations! Your Jumpseller App is installed and loading your web application. Once your have it done, you can deploy it for any production hosting and change the Application URL (and Callback URL) to your production URL.
You can now improve your Jumpseller App with the Jumpseller API but for this you need to understand the authorization flow of OAuth 2 and how to get your access token for API requests.