Close
logo

Inventory webhook

Git RepositoryEdit on Github
Last update: 2 years ago by luigi mangaReading time: 2 min

When connecting a custom channel, inventory can be synced in real time. As Onport is the stock master, inventory updates are sent from Onport 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.

You can set up the webhook endpoint under the Order processing tab in the custom channel setup. This should be a http:// or https:// endpoint.

The outbound JSON payload will contain details on the variant, the channel variant and the available inventory levels. The available 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 feed), with any allocated/unshipped quantities removed. he webhook sends a payload of data via a POST request.

{
"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://api.jetti.io/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.

๐Ÿ’ป Custom channel โ€” Previous
Importing Products
Next โ€” ๐Ÿ’ป Custom channel
Post to Channel