Create an outgoing request with the API

K inventory now lets you automatically send data to your external tools, thanks to its automation module and universal API. Set up outbound requests, or webhooks, to share key information from K inventory with your other applications, without having to write a single line of code.

What is a webhook?

An outbound request is sent by K inventory to an external URL when certain events occur in your account. For example, you can set up a webhook to notify your accounting software every time a new sale is recorded in K inventory.

How do I configure an outgoing request?

1. Go to Outgoing requests

    • In the K inventory main menu, click on the “PARAMETERS” TAB..
    • In the “Automation” sectionsection, click on “Outgoing requests.

 

api k inventory menu

 

2. Create a new outgoing request

    • Click on the “TO CREATE AN OUTGOING QUERY.
    • Give your query a clear, descriptive name (e.g. “Webhook new sale”).

 

Create an outgoing query in K inventory

 

3. Configure your request

    • Select connection : Choose the connection you have previously configured with the tool to which you wish to send data.
    • Trigger action : Select the event in K inventory that will trigger the webhook to be sent (e.g. “New sale”, “Stock update”, etc.).

 

trigger action for K inventory PLC

 

 

    • Request URL: Specify the complete URL to be called by K inventory when sending the webhook.
    • Method: Choose the appropriate HTTP method (GET, POST, PATCH, DELETE) depending on the action you wish to perform on the external tool.
      • GET Retrieve information from the server.
      • POST Create a new resource on the server.
      • PATCH Partially update an existing resource on the server
      • DELETE Delete a resource on the server.

 

Method api K inventory

 

    • Additional headers (optional): If necessary, add headers specific to your request in addition to those already defined in the connection.
    • Conditions (optional): Define filters to send the webhook only when certain conditions are met (for example, only for sales of a certain amount).
    • Query body : Select the K inventory data you wish to include in the webhook using the available variables. The variables available vary according to the trigger action selected.

 

Key points to remember

  • Webhooks automate communication between K inventory and your other tools.
  • Carefully choose the trigger action and conditions to control when the webhook is sent
  • Ensure that the URL and HTTP method are correctly configured for the target tool
  • Use variables to customize webhook content with relevant K inventory data
  • Check the history to make sure your webhooks are working properly