• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Deprecated batch change inventory

Deprecated
Effective June 16th, 2021

Deprecated version of BatchChangeInventory after the endpoint URL is updated to conform to the standard convention.

Permissions
INVENTORY_WRITE
Guide
Reconcile Inventory Quantities

Deprecation date
2021-06-16
Retirement date
2023-11-15
Name Description
idempotency_key
string

Required

A client-supplied, universally unique identifier (UUID) for the request.

See Idempotency in the API Development 101 section for more information.

Min Length 1 Max Length 128
changes
InventoryChange [ ]

The set of physical counts and inventory adjustments to be made. Changes are applied based on the client-supplied timestamp and may be sent out of order.

Max Length 100
ignore_unchanged_counts
boolean

Indicates whether the current physical count should be ignored if the quantity is unchanged since the last physical count. Default: true.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

counts
InventoryCount [ ]

The current counts for all objects referenced in the request.

changes
InventoryChange [ ]

Beta

Changes created for the request.

Examples

You are viewing an old version of the API
POST /v2/inventory/batch-change
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/inventory/batch-change \
  -X POST \
  -H 'Square-Version: 2022-11-16' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe",
    "changes": [
      {
        "type": "PHYSICAL_COUNT",
        "physical_count": {
          "reference_id": "1536bfbf-efed-48bf-b17d-a197141b2a92",
          "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI",
          "state": "IN_STOCK",
          "location_id": "C6W5YS5QM06F5",
          "quantity": "53",
          "team_member_id": "LRK57NSQ5X7PUD05",
          "occurred_at": "2016-11-16T22:25:24.878Z"
        }
      }
    ],
    "ignore_unchanged_counts": true
  }'
Response JSON
{
  "errors": [],
  "counts": [
    {
      "catalog_object_id": "W62UWFY35CWMYGVWK6TWJDNI",
      "catalog_object_type": "ITEM_VARIATION",
      "state": "IN_STOCK",
      "location_id": "C6W5YS5QM06F5",
      "quantity": "53",
      "calculated_at": "2016-11-16T22:28:01.223Z"
    }
  ]
}