Inventory API: Code Cookbook

Reconcile computed inventory quantities

Use Inventory API to reconcile the inventory count calculated by Square with the results of a physical count (or the inventory reported by a trusted system).

Before you start
Permalink Get a link to this section

Step 1: Construct the request
Permalink Get a link to this section

Create a BatchChangeInventoryRequest containing one or more InventoryPhysicalCount objects. Each request assigns an explicit count to the indicated state.

InventoryPhysicalCount physicalCount1 = new InventoryPhysicalCount()

InventoryPhysicalCount physicalCount2 = new InventoryPhysicalCount()

InventoryChange physicalCountChange1 = new InventoryChange().physicalCount(physicalCount1);
InventoryChange physicalCountChange2 = new InventoryChange().physicalCount(physicalCount2);

BatchChangeInventoryRequest physicalCountRequest = new BatchChangeInventoryRequest()

Step 2: Send the request
Permalink Get a link to this section

Send the BatchChangeInventoryRequest to the server. See the BatchChangeInventoryResponse endpoint in the Connect Technical Reference for details on all the available response fields.

BatchChangeInventoryResponse physicalCountResponse =