How to get started with API and web hooks

Hello, I just started evaluating Tryton. My use case involves integrating its product stock levels with a custom ecommerce website. Basically, when a purchase is made on the website, I want to have it appear on Tryton, or at the very least, update the stock levels on Tryton. To do this, I need to understand how the API works in Tryton. Is this function already available on the JSON-RPC and where can I find an example of how to use it?

On the flip side, if the stock changes on Tryton, I want to send a request to the ecommerce website to update the stock there as well. I’ll need to use web hooks for that. Are those supported, and how do I use them?

Hi Khali and welcolme to our forum.

There are so much possibilities on tryton for ecommerce:

  • We’ve released a vuestorefront integration on latest release
  • It is possible to use flask-tryton to develop a custom webshop that reads/updates the data directly from the Tryton database.
  • There is also a Woocommerce connector that uses the tryton cron jobs to upload and download data from woocommerce using its API.

Have you already decided which ecommerce backend to use? If you share it with us we can share more ideas.

1 Like

Hi, thanks for the information. I came across the vue storefront feature a moment ago. It’s impressive. But I already have my store based on Saleor. It has its own database, graphql API and a react-based storefront and also a react-based admin dashboard. Saleor provides web hooks as well.

I’m now trying to link up Saleor’s stock levels with Tryton so that both can update each other when purchases are made on saleor or new stock arrives on tryton. I can’t seem to find much information on Tryton’s API unfortunately.