Configuring an API webhook


 

Currently, SOS Inventory supports one webhook in our API, which was added to support our integration with Zapier. 

 

The currently-supported webhook will return information on item quantity when the item quantity may have been updated, such as a shipment or receipt of the item.

 

In order to subscribe to the hook, you must first have a working API connection with SOS Inventory (see https://developer.sosinventory.com) and be able to provide a valid Bearer token with these requests. You must also have a server setup to receive the hook data at a specific URI. This could be something like https://yourserver.com/item_data.

 

To subscribe, send a POST request:

 

POST https://api.sosinventory.com/api/v2/hook
{
 eventType: “item.quantity_updated”,
 postUri: “your server URI”,
 additionalData: “”,
 enabled: true
}

 

The additionalData field can optionally be populated with a locationId--and if provided, the webhook will return only the quantities for that location.

 

The data returned by the item.quantity_updated hook is POSTed back to the provided URI in the format below:

 

{
 id = 123,
 name = "Item Name",
 fullname = "Category:Item Name",
 description = "Item Description",
  sku = "34548",
 onhand = 100,
 available = 95
}

 

You can add multiple hooks with different location parameters for the additionalData field.

 

To see configured webhooks, you can call:

GET https://api.sosinventory.com/api/v2/hook

 

To pull the information for a single webhook, you can call:

GET https://api.sosinventory.com/api/v2/hook/{webhookId}

 

To delete an existing webhook, you can call:

DELETE https://api.sosinventory.com/api/v2/hook/{webhookId}

 

Was this information helpful?
-