Square: Retrieve Cash Drawer Shift
Square cashDrawers.retrieveCashDrawerShift: arguments, response, policy and SDK examples.
← Cash drawers operations · Get started
Operation square.retrievecashdrawershift
Provider route: GET /v2/cash-drawers/shifts/{shift_id}. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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["cashDrawers"]["retrieveCashDrawerShift"]>[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.cashDrawers.retrieveCashDrawerShift(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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.cash_drawers.retrieve_cash_drawer_shift(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.shift_id | string | Required within parent | |
query | object | Required within parent | Additional keys: not allowed |
query.location_id | string | Required within parent |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieve Cash Drawer Shift — response body |
Referenced models: Retrieve Cash Drawer Shift — response body
Schemas
Section titled “Schemas”2 more schemas are linked from the tables above, on the schema pages.
Retrieve Cash Drawer Shift — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
cash_drawer_shift | Model | Optional | Expand Retrieve Cash Drawer Shift — response body — cash drawer shift The cash drawer shift queried for. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Retrieve Cash Drawer Shift — response body — cash drawer shift, Get Shift — response body — errors item
Retrieve Cash Drawer Shift — response body — cash drawer shift
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | This model gives the details of a cash drawer shift. The cash_payment_money, cash_refund_money, cash_paid_in_money, and cash_paid_out_money fields are all computed by summing their respective event types. |
cash_paid_in_money | JSON | Optional | |
cash_paid_in_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money added to the cash drawer for reasons other than cash payments. It is computed by summing the events of type PAID_IN. The amount is always greater than or equal to zero. |
cash_paid_in_money (anyOf 2) | null | Alternative | |
cash_paid_out_money | JSON | Optional | |
cash_paid_out_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money removed from the cash drawer for reasons other than cash refunds. It is computed by summing the events of type PAID_OUT. The amount is always greater than or equal to zero. |
cash_paid_out_money (anyOf 2) | null | Alternative | |
cash_payment_money | JSON | Optional | |
cash_payment_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money added to the cash drawer from cash payments. This is computed by summing all events with the types CASH_TENDER_PAYMENT and CASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or equal to zero. |
cash_payment_money (anyOf 2) | null | Alternative | |
cash_refunds_money | JSON | Optional | |
cash_refunds_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money removed from the cash drawer from cash refunds. It is computed by summing the events of type CASH_TENDER_REFUND. The amount is always greater than or equal to zero. |
cash_refunds_money (anyOf 2) | null | Alternative | |
closed_at | JSON | Optional | |
closed_at (anyOf 1) | string | Alternative | The time when the shift was closed, in ISO 8601 format. |
closed_at (anyOf 2) | null | Alternative | |
closed_cash_money | JSON | Optional | |
closed_cash_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money found in the cash drawer at the end of the shift by an auditing employee. The amount should be positive. |
closed_cash_money (anyOf 2) | null | Alternative | |
closing_team_member_id | string | Optional | The ID of the team member that closed the cash drawer shift by auditing the cash drawer contents. Read only: true |
created_at | string | Optional | The shift start time in RFC 3339 format. Read only: true |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | The free-form text description of a cash drawer by an employee. |
description (anyOf 2) | null | Alternative | |
device | JSON | Optional | |
device (anyOf 1) | Model | Alternative | Expand Retrieve Cash Drawer Shift — response body — cash drawer shift device id, name The device running Square Point of Sale that was connected to the cash drawer. |
device (anyOf 2) | null | Alternative | |
ended_at | JSON | Optional | |
ended_at (anyOf 1) | string | Alternative | The time when the shift ended, in ISO 8601 format. |
ended_at (anyOf 2) | null | Alternative | |
ending_team_member_id | string | Optional | The ID of the team member that ended the cash drawer shift. Read only: true |
expected_cash_money | JSON | Optional | |
expected_cash_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money that should be in the cash drawer at the end of the shift, based on the shift's other money amounts. This can be negative if employees have not correctly recorded all the events on the cash drawer. cash_paid_out_money is a summation of amounts from cash_payment_money (zero or positive), cash_refunds_money (zero or negative), cash_paid_in_money (zero or positive), and cash_paid_out_money (zero or negative) event types. |
expected_cash_money (anyOf 2) | null | Alternative | |
id | string | Optional | The shift unique ID. |
location_id | string | Optional | The ID of the location the cash drawer shift belongs to. Read only: true |
opened_at | JSON | Optional | |
opened_at (anyOf 1) | string | Alternative | The time when the shift began, in ISO 8601 format. |
opened_at (anyOf 2) | null | Alternative | |
opened_cash_money | JSON | Optional | |
opened_cash_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money The amount of money in the cash drawer at the start of the shift. The amount must be greater than or equal to zero. |
opened_cash_money (anyOf 2) | null | Alternative | |
opening_team_member_id | string | Optional | The ID of the team member that started the cash drawer shift. Read only: true |
state | JSON | Optional | |
state (anyOf 1) | string | Alternative | The current state of a cash drawer shift. The shift current state. See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values Known values: OPEN, ENDED, CLOSED |
state (anyOf 2) | null | Alternative | |
team_member_ids | array | Optional | The IDs of all team members that were logged into Square Point of Sale at any point while the cash drawer shift was open. Read only: true |
team_member_ids[] | string | Each item | |
updated_at | string | Optional | The shift updated at time in RFC 3339 format. Read only: true |
Referenced models: Retrieve Cash Drawer Shift — response body — cash drawer shift device id, name, Pay Order — response body — order total money
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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. |
category | string | Required within parent | Indicates 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 |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The 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
Retrieve Cash Drawer Shift — response body — cash drawer shift device id, name
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
id | string | Optional | The device Square-issued ID |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The device merchant-specified name. |
name (anyOf 2) | null | Alternative |
Create Location — response body — location currency
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). Known values: UNKNOWN_CURRENCY, AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LTL, LVL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SLE, SOS, SRD, SSP, STD, SVC, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, USN, USS, UYI, UYU, UZS, VEF, VND, VUV, WST, XAF, XAG, XAU, XBA, XBB, XBC, XBD, XCD, XDR, XOF, XPD, XPF, XPT, XTS, XXX, YER, ZAR, ZMK, ZMW, BTC, XUS |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.retrievecashdrawershift. Catalog operation: RetrieveCashDrawerShift. 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: ["CASH_DRAWER_READ"]
Pinned headers: {"Square-Version": "2026-11-18"}