Updating Inventory

An important part of commerce is inventory, and tracking it.

Inventory in Jungle is currently tracked by SKU per location.

Setting inventory

You can set inventory in stock using a SKU, using the inventorySetBySku mutation.

mutation {
  inventorySetBySku(input: { locationId: "JungleLocationId", sku: "ABCDEFG", quantity: 2 }) {
    inventory {
      quantityOnHand
      quantityAvailableToPromise
    }
  }
}

🤖 The sku can be anything, but is unique to each "thing" being tracked and is best that it matches what you scan on products in pick & packing.

The response will return the quantityOnHand provided.

If the response is not OK.

The update inventory operation should be resent at a later date.

Allocating inventory

It is important to reserve inventory after purchase and during allocation as not to oversell products not yet fulfilled.

In this Jungle we call this inventory allocations.

mutation {
  inventoryAllocate(input: { sku: "Big-Shirt", locationId: "JungleLocationId", quantity: 2 }) {
    allocationKey # this is needed to clear a specific allocation, and can be provided.
    quantityOnHand
    quantityAllocated
    quantityAvailableToPromise
  }
}

This allocated inventory will reduce the ATP number, yet keep the on hand number the same.

Generally, at later date, when a shipment is created, or products collected, these allocations will be transformed into inventory releases. Reducing the on hand stock.

If needed, allocations can be completely cleared for a SKU at a location. A reason is required.

mutation {
  inventoryAllocationsClear(
    input: {
      sku: "HAT"
      locationId: "JungleLocationId"
      reason: "Resetting on the hand stock at the location, due to stock take"
    }
  ) {
    quantityOnHand
    quantityAllocated
  }
}

❗️This may impact your ATP (due to order allocations not yet being fulfilled), and should be used with caution.

Notifications

You can be notified when inventory is altered via webhooks.

See webhook usage.

Fill 1

Can't find what you're looking for?

Contact Us