API

Custom channels - Inventory webhook

Sync inventory in real time up to a custom sales channel

Last updated July 9th, 2020

When connecting a custom channel, inventory can be synced in real time. As Jetti is the stock master, inventory updates are sent from Jetti up to your custom channel when an inventory related event occurs. For example, a new order or the available levels in an inventory feed changes.

Step 1

Setup the webhook location

Step 2

Setting up the webhook payload and response

The outbound JSON payload will contain details on the variant, the channel variant and the available inventory levels. The avaiable quantity is the amount currently available to be sold. Although this may change depending on your account setup, by default it will be the amount you have in your warehouse (or your inventory minus), with any allocated/unshipped quantities removed.

{
  "variant": {
    "id": 10,
    "inventoryPolicy": "track"
  },
  "channelVariant": {
    "id": 9,
    "companyId": 11,
    "variantId": 10,
    "channelId": 21,
    "externalId": "123",
    "externalGroupId": null,
    "externalSku": null,
    "source": "shopify",
    "hash": null,
    "parentHash": null,
    "status": "pending",
    "errorMessage": null,
    "inventoryUpdate": null,
    "priceUpdate": null,
    "publishUpdate": null,
    "costPriceUpdate": null,
    "createdAt": "2019-12-16T21:45:12.828Z",
    "updatedAt": "2019-12-16T21:45:12.828Z",
    "channel": {
      "shipstationUrl": "http://localhost:5000/api/channels/21/shipstation.xml",
      "freeShippingThreshold": null,
      "hideWhenNoCostPrice": null,
      "id": 21,
      "includeBackorderQuantity": true,
      "inventorySync": "all",
      "parentChannel": "custom",
      "unpublishNoInventory": false,
      "warehouseId": 11,
      "warehouseSync": "default"
    }
  },
  "inventory": {
    "available": 5
  }
}

The response from the webhook should be received within 5 seconds, although preferably 1 second. Outbound updates can also be sent concurrently, so we advise a queue/messaging system to cater for peaks in throughput and ensure minimal response times.

Back to API