@bates-solutions/clover API Reference - v1.3.0
    Preparing search index...

    Class InventoryService

    Inventory service wrapping Clover's Platform inventory API: items (/v3/merchants/{mId}/items) and their stock (/v3/merchants/{mId}/item_stocks).

    Requires a merchantId on the client.

    const [item] = await clover.inventory.findItemsByCode({
    codes: ['012345678905'],
    expand: ['itemStock'],
    });
    console.log(item?.name, item?.itemStock?.quantity);
    Index
    • Find items by product code (UPC / EAN barcode) or SKU, without listing the whole inventory. Pages through every match and returns each item once, even if it matches several codes.

      Codes are passed to Clover as exact-match filters and are not normalized: a UPC-A 012345678905 won't find the same barcode stored as EAN-13 0012345678905. Pass both forms if the inventory may hold either.

      Makes one request per code (more for codes with over 1000 matches).

      Parameters

      Returns Promise<Item[]>

      const items = await clover.inventory.findItemsByCode({
      codes: ['012345678905'],
      skus: ['PICKLE-DILL-500'],
      expand: ['itemStock'],
      });
    • Set an item's stock level. quantity replaces the current count; to add a delivery, read the stock first and send the new total.

      Resolves to the stock Clover returns, or to the stock you sent when Clover's response has no body.

      Parameters

      Returns Promise<ItemStock>

      When quantity is not a finite number

      const { quantity = 0 } = await clover.inventory.getItemStock('ITEM_1');
      await clover.inventory.updateItemStock('ITEM_1', { quantity: quantity + 24 });