StoreHippo allows partners to create apps that can be made available to StoreHippo customers through StoreHippo App Store. You need to sign up as StoreHippo partner in order to create the app. Go to the Partners registration page to register as a partner with StoreHippo if you are not yet a StoreHippo partner.
Once you have signed up as a partner, you need to follow these steps to create an app:
The Overview tab contains fields which you need to fill to provide basic information about the app.
Following are the fields in the Overview tab:
Enter the name of the app.
Upload the logo for the app.
Enter the category to which the app belongs.
Enter the URL to which the user will be redirected while installing the app. The owner of the app should redirect the user to the Authorization Url specified in the OAuth Authentication Flow.
Enter the demo URL that illustrates the functionality of the app.
Enter the URLs where the control will shift after the user has installed the app. This is the URL to which the user would be redirected after the installation flow is completed. You will get the authorization code in the query params using which you could get Auth Token. The token will allow you to call StoreHippo APIs from your server.
If your app needs to open your portal inside the StoreHippo Admin Panel, then checkbox needs to be checked.
The app info tab contains the general description of the app.
Enter the summary for the app.
Enter a long description of the apps.
Provide the screenshots for the app to be shown on the app page.
Upload the banner that will be shown in the app grid in the app store.
Provide the support page if any exists.
Insert the selling points for your app.
Let us create a sample app that will add a product when it is installed. Specify the details of the app in the Overview and App info Tab according to you.
Client Id and Client Secret
When you add an app in the Partners panel, the client id and the client secret is assigned to the app which can be seen when editing the app.
Client ID:
Client Secret:
App URL
Let us suppose we have given the App URL as https://www.myapp.com/startInstall
When the User installs the app he will be redirected to the App URL with the store name as a query parameter.
So the user would be redirected to https://www.myapp.com/startInstall?store=teststore
Now, when the user is redirected to the above URL, we will get the store name from the query params which is "
https://{store}.storehippo.com/admin/authorization?client_id={client_id}&scope={scopes}&redirect_uri={redirect_uri}&state={nonce}
With these substitutions made:
{nonce}:
A randomly selected value provided by your application, which is unique for each authorization request.So our URL becomes,
https://teststore.storehippo.com/admin/oauth/authorization?client_id=dummyclientidgenerated&scope=write_products&redirect_uri=https://www.myapp.com/handlecallback&state=dummystatevar
The user installs the app, and is redirected back to our redirect url with the Auth Code i.e.
https://www.myapp.com/handlecallback?code=testauthcode&state=
dummystatevar
Now we will get the code from the query and call the token API of StoreHippo for the Access Token (This is a server to server call)
It will be a POST request to the URL
https://{store}.storehippo.com/admin/oauth/token
With {store} substituted for the name of the user’s store and with the following parameters provided in the body of the request:
If everything goes right and the request is successful, you’ll receive a 200
response containing a JSON body like this:
{
"access_token":"f85632530bf277ec9ac6f649fc327f17",
"refresh_token":"b6sh37412b7fg4c9ac6f649fc375gd5"
}
USING CURL
curl
https://teststore.storehippo.com/admin/oauth/token -d 'grant_type=authorization_code&code={your_code}&client_id={your_client_id}&client_secret={your_client_secret}' -X POST
access_token
is an API access token that can be used to access the store's data as long as the client is installed.
Clients should store the token somewhere to make authenticated requests for a store's data.
Now that the client has obtained an API access token, it can make authenticated requests to the REST API. The access token is a bearer token so these requests are accompanied with a header Authorization: Bearer {access_token}
{access_token}
If you use NodeJS in your backend, then you can use
POST https://teststore.storehippo.com/api/1/entity/ms.products
Data: {"name":"My Product",sku:"my-product-sku",price:10}