Following is the list of steps needed to integrate Yo App with lemonstand.
You should first register on Yo app. If you are already registered then you can login using your credentials
You will see options page after login
When a registered user logged in then options page will be displayed.
Go to settings tab to generate API token
In the Yo backend there is a setting page. On settings page, you can update your password, create api token etc.
Go to API tab and create a token
There is an api tab in the settings page. From the api tab we can create api tokens.
Generated token will appear on a pop up
When we click on create button on api tab after giving token name then a token will create and will appear on the pop up. Please don’t forget to copy token, because it will not appear again although you may revoke a token any time
User apps are displayed on apps page
When a user registers, then a default App of user is created, user apps can be found on Apps tab. You can also create new apps from here.
Lemonstand webhook link
Lemonstand webhook link will look like this https://yopify.com/api/yo/v1/ls/orders/APPID
Here “APPID” is id of the app for which we want to use Yo App
Register lemonstand webhook
Go to Webhook tab of lemonstand backend and register a webhook on Order Paid/Order Placed event
Test user authentication using webhook before using webhook
You should test your authentication first before using webhook. To do this place ping url in the destination field, after that put your credentials in username and password fields and click on test webhook button .
If user is invalid then response will be unauthorized
If user is valid then put your webhook url in Destination field
Checking authetication using username/password or api token
For authentication, you can use username and password of your store or alternatively you can give a name to username field and api_token value for the password field, but in second case both fields must fill.
Copy script from options page of Yopify (https://yopify.com/api/yo/options)
After successful integration of webhook, to show events on your lemonstand store copy script from Yopify options page and paste it in the head of your html document
Paste script in layout-head partial of lemonstand theme
Paste Script in head of html document. It is usually in layout-head partial in lemonstand themes. In zest theme, it is normally in layout-head partial (/backend/cms/theme/zest/partials/partial-layout-head).
Save partial after pasting script
Save partial after pasting script in it.