Close
logo

Updating inventory

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

Manually updating inventory levels

It's possible to update the inventory levels using the Onport API and the set-levels.json endpoint. This will set the inventory levels against a given warehouse, optionally setting an adjustment reason. The ajustment reason ID can be either created using the adjustment-reasons.json endpoint. Or, through the Onport admin panel under Setup > in-house shipping.

curl --request PUT \
--url https://api.jetti.io/api/variants/:variantId/set-level.json \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"quantity": 10,
"adjustmentReasonId": 1,
"notes": "notes for the adjustment"
}'

In the above call, you'll need to know the Onport variant ID. In some situations, this may be not know or inefficient to retrieve. For example, you'll need to first lookup the ID based on an external SKU, then make the corresponding call. As an alternative, you can instead use the following endpoint, to set the inventory levels against a given SKU, providing the external ID for that item. For example, this would be the Shopify variant ID if the channel was linked to a Shopify store.

curl --request PUT \
--url https://api.jetti.io/api/channels/:channelId/set-variant-level.json \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"quantity": 10,
"externalId": 1,
"notes": "notes for the adjustment"
}'
๐Ÿš€ Getting Started โ€” Previous
Connecting
Next โ€” ๐Ÿ“ฆ Shipping
Custom fulfillment flows