Skip to content

Square: Deprecated Batch Change Inventory

Square inventory.deprecatedBatchChangeInventory: arguments, response, policy and SDK examples.

← Inventory operations · Get started

Operation square.deprecatedbatchchangeinventory

Provider route: POST /v2/inventory/batch-change. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["inventory"]["deprecatedBatchChangeInventory"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.inventory.deprecatedBatchChangeInventory(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_square import SquareIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.inventory.deprecated_batch_change_inventory(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Batch Change Inventory — request body — body

Referenced models: Batch Change Inventory — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Batch Change Inventory — response body

Referenced models: Batch Change Inventory — response body

22 more schemas are linked from the tables above, on the schema pages.

Batch Change Inventory — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
changesJSONOptional
changes (anyOf 1)arrayAlternativeThe 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.
changes (anyOf 1)[]ModelEach itemExpand Batch Change Inventory — request body — body changes array item
changes (anyOf 2)nullAlternative
idempotency_keystringRequired within parentA client-supplied, universally unique identifier (UUID) for the
request.

See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) in the
[API Development 101](https://developer.squareup.com/docs/buildbasics) section for more
information.
Maximum length: 128
Minimum length: 1
ignore_unchanged_countsJSONOptional
ignore_unchanged_counts (anyOf 1)booleanAlternativeIndicates whether the current physical count should be ignored if
the quantity is unchanged since the last physical count. Default: `true`.
ignore_unchanged_counts (anyOf 2)nullAlternative

Referenced models: Batch Change Inventory — request body — body changes array item

Batch Change Inventory — response body
FieldTypePresenceDescription and constraints
$objectRoot
changesarrayOptionalChanges created for the request.
changes[]ModelEach itemExpand Batch Change Inventory — response body — changes item
countsarrayOptionalThe current counts for all objects referenced in the request.
counts[]ModelEach itemExpand Batch Change Inventory — response body — counts item
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item, Batch Change Inventory — response body — changes item, Batch Change Inventory — response body — counts item

Batch Change Inventory — request body — body changes array item
FieldTypePresenceDescription and constraints
$objectRootRepresents a single physical count, inventory, adjustment, or transfer
that is part of the history of inventory changes for a particular
[CatalogObject](entity:CatalogObject) instance.
adjustmentJSONOptional
adjustment (anyOf 1)ModelAlternativeExpand Update Inventory Adjustment — request body — body adjustment
Contains details about the inventory adjustment when `type` is
`ADJUSTMENT`, and is unset for all other change types.
adjustment (anyOf 2)nullAlternative
measurement_unitModelOptionalExpand Upsert Catalog Object — request body — body object measurement unit data measurement unit, precision
The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.
Read only: true
measurement_unit_idstringOptionalThe ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.
Read only: true
physical_countJSONOptional
physical_count (anyOf 1)ModelAlternativeExpand Batch Change Inventory — request body — body changes array item physical count adjustment id, catalog object id, catalog object type, created at, employee id, id, location id, occurred at, quantity, reference id, source, state, team member id
Contains details about the physical count when `type` is
`PHYSICAL_COUNT`, and is unset for all other change types.
physical_count (anyOf 2)nullAlternative
typeJSONOptional
type (anyOf 1)stringAlternativeIndicates how the inventory change was applied to a tracked product quantity.
Indicates how the inventory change is applied. See
[InventoryChangeType](entity:InventoryChangeType) for all possible values.
See [InventoryChangeType](#type-inventorychangetype) for possible values
One of: PHYSICAL_COUNT, ADJUSTMENT
type (anyOf 2)nullAlternative

Referenced models: Upsert Catalog Object — request body — body object measurement unit data measurement unit, precision, Update Inventory Adjustment — request body — body adjustment, Batch Change Inventory — request body — body changes array item physical count adjustment id, catalog object id, catalog object type, created at, employee id, id, location id, occurred at, quantity, reference id, source, state, team member id

Get Shift — response body — errors item
FieldTypePresenceDescription and constraints
$objectRootRepresents an error encountered during a request to the Connect API.

See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information.
categorystringRequired within parentIndicates which high-level category of error has occurred during a
request to the Connect API.
The high-level category for the error.
See [ErrorCategory](#type-errorcategory) for possible values
Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR
codeModelRequired within parentExpand Get Shift — response body — errors item code
The specific code of the error.
See [ErrorCode](#type-errorcode) for possible values
detailstringOptionalA human-readable description of the error for debugging purposes.
fieldstringOptionalThe name of the field provided in the original request (if any) that
the error pertains to.

Referenced models: Get Shift — response body — errors item code

Batch Change Inventory — response body — changes item
FieldTypePresenceDescription and constraints
$objectRootRepresents a single physical count, inventory, adjustment, or transfer
that is part of the history of inventory changes for a particular
[CatalogObject](entity:CatalogObject) instance.
adjustmentJSONOptional
adjustment (anyOf 1)ModelAlternativeExpand Update Inventory Adjustment — response body — adjustment
Contains details about the inventory adjustment when `type` is
`ADJUSTMENT`, and is unset for all other change types.
adjustment (anyOf 2)nullAlternative
measurement_unitModelOptionalExpand Batch Change Inventory — response body — changes item measurement unit
The [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.
Read only: true
measurement_unit_idstringOptionalThe ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change.
Read only: true
physical_countJSONOptional
physical_count (anyOf 1)ModelAlternativeExpand Retrieve Inventory Physical Count — response body — count
Contains details about the physical count when `type` is
`PHYSICAL_COUNT`, and is unset for all other change types.
physical_count (anyOf 2)nullAlternative
typeJSONOptional
type (anyOf 1)stringAlternativeIndicates how the inventory change was applied to a tracked product quantity.
Indicates how the inventory change is applied. See
[InventoryChangeType](entity:InventoryChangeType) for all possible values.
See [InventoryChangeType](#type-inventorychangetype) for possible values
Known values: PHYSICAL_COUNT, ADJUSTMENT
type (anyOf 2)nullAlternative

Referenced models: Batch Change Inventory — response body — changes item measurement unit, Update Inventory Adjustment — response body — adjustment, Retrieve Inventory Physical Count — response body — count

Delete Inventory Adjustment Reason — request body — body reason id
FieldTypePresenceDescription and constraints
$objectRootIdentifies a standard or custom inventory adjustment reason.
custom_reason_idJSONOptional
custom_reason_id (anyOf 1)stringAlternativeThe Square-generated ID of the custom adjustment reason. This field
is only set when `type` is `CUSTOM`.
Maximum length: 100
custom_reason_id (anyOf 2)nullAlternative
typeModelRequired within parentExpand Delete Inventory Adjustment Reason — request body — body reason id type
The adjustment reason type.
See [Type](#type-type) for possible values

Referenced models: Delete Inventory Adjustment Reason — request body — body reason id type

SDK function policy ID: square.deprecatedbatchchangeinventory. Catalog operation: DeprecatedBatchChangeInventory. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Required provider scopes: ["INVENTORY_WRITE"]

Pinned headers: {"Square-Version": "2026-11-18"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.