JDBC Driver for Square

Build 25.0.9434

InventoryChanges

Query historical physical counts and adjustments on inventory items.

Table Specific Information

Select

The driver uses the Square API to process search criteria that refer to the Type, CatalogObjectId, State and LocationId column, while other filters are processed client side within the driver.

Select all the inventory changes:

SELECT * FROM InventoryChanges

Select all the inventory changes from a specific location ID:

SELECT * FROM InventoryChanges WHERE LocationId = 'Sandbox_Location_Id'

Select all the inventory changes with a specific type:

SELECT * FROM InventoryChanges WHERE Type = 'ADJUSTMENT'

Select all the inventory changes in a specific state:

SELECT * FROM InventoryChanges WHERE State = 'IN_STOCK'

Select all the inventory changes for a specific catalog object:

SELECT * FROM InventoryChanges WHERE CatalogObjectId = '5QJP4XMEN5TQ4W4UY7YL'

Insert

To create an inventory change, you will need to specify the Type, CatalogObjectId, Quantity column.
Insert an inventory change of type 'PHYSICAL_COUNT' :

INSERT INTO InventoryChanges (Type, CatalogObjectId, State, Quantity) VALUES ('PHYSICAL_COUNT', '5QJP4XMEN5TQ4W4UY7YL', 'IN_STOCK', 16)

Insert an inventory change of type 'ADJUSTMENT' :

INSERT INTO InventoryChanges (Type, CatalogObjectId, FromState, ToState, Quantity) VALUES ('ADJUSTMENT', '5QJP4XMEN5TQ4W4UY7YL', 'IN_STOCK', 'SOLD', 5)

Columns

Name Type ReadOnly Description
Id [KEY] String False

A unique Id generated by Square for the inventory change record.

ReferenceId String False

An optional Id provided by the application to tie the inventory change to an external system.

Type String False

Indicates how the inventory change was applied.

The allowed values are PHYSICAL_COUNT, ADJUSTMENT.

CatalogObjectId String False

Id of the catalog object being tracked.

CatalogObjectType String False

The CatalogObjectType of the CatalogObject being tracked. Tracking is only supported for the ITEM_VARIATION type.

State String False

The current InventoryState for the related quantity of items.

LocationId String False

The Square Id of the location where the related quantity of items are being tracked.

Quantity String False

The number of items affected by the physical count as a decimal string.

EmployeeId String False

The Square Id of the Employee responsible for the physical count.

OccurredAt Datetime False

A client-generated timestamp in RFC 3339 format that indicates when the physical count took place. For write actions, the occurred_at timestamp cannot be older than 24 hours or in the future relative to the time of the request.

CreatedAt Datetime False

A read-only timestamp in RFC 3339 format that indicates when Square received the physical count.

FromState String False

Inventory state of the related quantity of items before the adjustment.

ToState String False

Inventory state of the related quantity of items before the adjustment.

TotalPriceMoneyAmount Integer False

The amount of the total price paid for goods associated with the adjustment. Present if and only if to_state is SOLD. Always non-negative.

TotalPriceMoneyCurrency String False

The currency of the total price paid for goods associated with the adjustment. Present if and only if to_state is SOLD. Always non-negative.

TransactionId String False

The read-only Square Id of the [Transaction][#type-transaction] that caused the adjustment. Only relevant for payment-related state transitions.

RefundId String False

The read-only Square Id of the Transaction that caused the adjustment. Only relevant for payment-related state transitions.

PurchaseOrderId String False

The read-only Square Id of the Refund that caused the adjustment. Only relevant for refund-related state transitions.

GoodsReceiptId String False

The read-only Square Id of the Square goods receipt that caused the adjustment. Only relevant for state transitions from the Square for Retail app.

FromLocationId String False

The Square Id of the location where the related quantity of items were tracked before the transfer.

ToLocationId String False

The Square Id of the location where the related quantity of items were tracked before the transfer.

TeamMemberId String False

The Square-generated Id of the team member responsible for the physical count.

SourceProduct String True

The product type of the application.

The allowed values are SQUARE_POS, EXTERNAL_API, BILLING, APPOINTMENTS, INVOICES, ONLINE_STORE, PAYROLL, DASHBOARD, ITEM_LIBRARY_IMPORT, OTHER.

SourceApplicationId String True

The Square-assigned Id of the application. This field is used only if the product type is EXTERNAL_API.

SourceName String True

The display name of the application.

AdjustmentGroupId String True

A unique Id generated by Square for the adjustment group.

AdjustmentGroupRootAdjustmentId String True

The inventory adjustment Id for the composed variation.

AdjustmentGroupFromState String True

Representative from_state for adjustments within the group.

The allowed values are CUSTOM, IN_STOCK, SOLD, RETURNED_BY_CUSTOMER, RESERVED_FOR_SALE, SOLD_ONLINE, ORDERED_FROM_VENDOR, RECEIVED_FROM_VENDOR, IN_TRANSIT_TO, NONE, WASTE, UNLINKED_RETURN, COMPOSED, DECOMPOSED, SUPPORTED_BY_NEWER_VERSION, IN_TRANSIT.

AdjustmentGroupToState String True

Representative to_state for adjustments within group.

The allowed values are CUSTOM, IN_STOCK, SOLD, RETURNED_BY_CUSTOMER, RESERVED_FOR_SALE, SOLD_ONLINE, ORDERED_FROM_VENDOR, RECEIVED_FROM_VENDOR, IN_TRANSIT_TO, NONE, WASTE, UNLINKED_RETURN, COMPOSED, DECOMPOSED, SUPPORTED_BY_NEWER_VERSION, IN_TRANSIT.

MeasurementUnitMeasurementUnitCustomUnitName String True

The name of the custom unit.

MeasurementUnitMeasurementUnitCustomUnitAbbreviation String True

The abbreviation of the custom unit.

MeasurementUnitMeasurementUnitAreaUnit String True

Represents a standard area unit.

The allowed values are IMPERIAL_ACRE, IMPERIAL_SQUARE_INCH, IMPERIAL_SQUARE_FOOT, IMPERIAL_SQUARE_YARD, IMPERIAL_SQUARE_MILE, METRIC_SQUARE_CENTIMETER, METRIC_SQUARE_METER, METRIC_SQUARE_KILOMETER.

MeasurementUnitMeasurementUnitLengthUnit String True

Represents a standard length unit.

The allowed values are IMPERIAL_INCH, IMPERIAL_FOOT, IMPERIAL_YARD, IMPERIAL_MILE, METRIC_MILLIMETER, METRIC_CENTIMETER, METRIC_METER, METRIC_KILOMETER.

MeasurementUnitMeasurementUnitVolumeUnit String True

Represents a standard volume unit.

The allowed values are GENERIC_FLUID_OUNCE, GENERIC_SHOT, GENERIC_CUP, GENERIC_PINT, GENERIC_QUART, GENERIC_GALLON, IMPERIAL_CUBIC_INCH, IMPERIAL_CUBIC_FOOT, IMPERIAL_CUBIC_YARD, METRIC_MILLILITER, METRIC_LITER.

MeasurementUnitMeasurementUnitWeightUnit String True

Represents a standard weight unit.

The allowed values are IMPERIAL_WEIGHT_OUNCE, IMPERIAL_POUND, IMPERIAL_STONE, METRIC_MILLIGRAM, METRIC_GRAM, METRIC_KILOGRAM.

MeasurementUnitMeasurementUnitGenericUnit String True

Reserved for API integrations that lack the ability to specify a real measurement unit.

The allowed values are UNIT.

MeasurementUnitMeasurementUnitTimeUnit String True

Represents a standard time unit.

The allowed values are GENERIC_MILLISECOND, GENERIC_SECOND, GENERIC_MINUTE, GENERIC_HOUR, GENERIC_DAY.

MeasurementUnitMeasurementUnitType String True

Represents the type of the measurement unit.

The allowed values are TYPE_CUSTOM, TYPE_AREA, TYPE_LENGTH, TYPE_VOLUME, TYPE_WEIGHT, TYPE_GENERIC.

MeasurementUnitPrecision Integer True

An integer between 0 and 5 that represents the maximum number of positions allowed after the decimal in quantities measured with this unit.

MeasurementUnitId String True

The Id of the CatalogMeasurementUnit object representing the catalog measurement unit associated with the inventory change.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434