Setup Test Environment
The goal
Integrator gets access to a sandbox to develop test and break things freely.
It also allows crating fully functional shops that sell products imported via the integration. These shops then create orders are sent to the integration at various stages.
Most importantly it provides tools to inspect every message between Katalys and the integration and also a way to retry these messages thus providing a real time feedback loop when developing the integration.
Setup a Katalys sandbox account
Create an account on Katalys sandbox environment
Click on Sign-Up
Complete the signup (Note: Signup with Google is reserved for Katalys mails)
Navigate to Katalys Shops
Click on the Open button in the Katalys Shop banner
Create an organization
After the organization is created we suggest bookmarking the current page
Navigate to: Settings → Apps and Integrations → Stores
Click add Store
Click Custom integration
Side note
Here you can inspect how the user experience flow for existing integrations, part of rolling out a new integration is also about writing instructions for merchants to set it up
Fill in the form
Notice: endpoint for accepting Katalys directives
This has to point to a server running your code
It’s OK to put in something temporary, can be changed later
In case your plugin will run on your local development machine, we suggest using a service like https://ngrok.com/ that can make your local server accessible from the outside world
Click create integration.
You might see an error message. This is expected if the endpoint is not running.
Inspect integration’s tabs
API keys
crucial information to talk to our GraphQL API
Logs
every message sent to your endpoint and received from your code will log here. So you can easily debug request and response payloads.
Settings
Here you change the URL location of your plugin and other basic info
Click on Logs tab
There you’ll see a Health check button, by clicking it a request with authentication headers will be sent to the url you specified while setting up the Integration
If the url is reachable and responding, you’ll see a request and response appear in the log
Notice: This way you trigger a request any time you need it and inspect the result. This tool is intended to help you develop and debug the connection.
Done. You now have an environment in which you can manually fire a request to a URL of your choosing. Next step is to setup a server that will receive the request, authenticate it and reply properly.
Integration’s source code
Work with Katalys to setup a Git repository
Setup a project that will start a server and expose a URL endpoint
Example: http://some-development.server.net/katalys/directives_endpoint
In case you want to run the development server from localhost, you can use a tool like https://ngrok.com/ to make it publicly accessible
Put that URL into your sandbox (see above)
That URL endpoint will receive post messages
containing authentication headers
containing JSON payload in body
Ensure authentication headers are properly verified - Authentication
Parse the JSON payload which contains an array of objects called directives
Process each directive individually and store it’s result and return a JSON object.