Square: Get Device
Square devices.getDevice: arguments, response, policy and SDK examples.
← Devices operations · Get started
Operation square.getdevice
Provider route: GET /v2/devices/{device_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["devices"]["getDevice"]>[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.devices.getDevice(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.devices.get_device(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.device_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 Get Device — response body |
Referenced models: Get Device — response body
Schemas
Section titled “Schemas”6 more schemas are linked from the tables above, on the schema pages.
Get Device — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
device | Model | Optional | Expand Get Device — response body — device The requested `Device`. |
errors | array | Optional | Information about errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Device — response body — device, Get Shift — response body — errors item
Get Device — response body — device
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
attributes | Model | Required within parent | Expand Get Device — response body — device attributes A collection of DeviceAttributes representing the device. |
components | JSON | Optional | |
components (anyOf 1) | array | Alternative | A list of components applicable to the device. |
components (anyOf 1)[] | Model | Each item | Expand Get Device — response body — device components A list of components applicable to the device item |
components (anyOf 2) | null | Alternative | |
id | string | Optional | A synthetic identifier for the device. The identifier includes a standardized prefix and is otherwise an opaque id generated from key device fields. Read only: true |
status | Model | Optional | Expand Get Device — response body — device status The current status of the device. Read only: true |
Referenced models: Get Device — response body — device components A list of components applicable to the device item, Get Device — response body — device attributes, Get Device — response body — device status
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
Get Device — response body — device components A list of components applicable to the device item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The wrapper object for the component entries of a given component type. |
application_details | JSON | Optional | |
application_details (anyOf 1) | Model | Alternative | Expand Get Device — response body — device components A list of components applicable to the device item application details application type, device code id, session location, version Structured data for an `Application`, set for Components of type `APPLICATION`. |
application_details (anyOf 2) | null | Alternative | |
battery_details | JSON | Optional | |
battery_details (anyOf 1) | Model | Alternative | Expand Get Device — response body — device components A list of components applicable to the device item battery details external power, visible percent Structured data for a `Battery`, set for Components of type `BATTERY`. |
battery_details (anyOf 2) | null | Alternative | |
card_reader_details | JSON | Optional | |
card_reader_details (anyOf 1) | Model | Alternative | Expand Get Device — response body — device components A list of components applicable to the device item card reader details version Structured data for a `CardReader`, set for Components of type `CARD_READER`. |
card_reader_details (anyOf 2) | null | Alternative | |
ethernet_details | JSON | Optional | |
ethernet_details (anyOf 1) | Model | Alternative | Expand Get Device — response body — device components A list of components applicable to the device item ethernet details active, ip address v4, mac address Structured data for an `Ethernet` interface, set for Components of type `ETHERNET`. |
ethernet_details (anyOf 2) | null | Alternative | |
type | string | Required within parent | An enum for ComponentType. The type of this component. Each component type has expected properties expressed in a structured format within its corresponding `*_details` field. See [ComponentType](#type-componenttype) for possible values Known values: APPLICATION, CARD_READER, BATTERY, WIFI, ETHERNET, PRINTER |
wifi_details | JSON | Optional | |
wifi_details (anyOf 1) | Model | Alternative | Expand Get Device — response body — device components A list of components applicable to the device item wifi details active, ip address v4, mac address, secure connection, signal strength, ssid Structured data for a `WiFi` interface, set for Components of type `WIFI`. |
wifi_details (anyOf 2) | null | Alternative |
Referenced models: Get Device — response body — device components A list of components applicable to the device item card reader details version, Get Device — response body — device components A list of components applicable to the device item ethernet details active, ip address v4, mac address, Get Device — response body — device components A list of components applicable to the device item application details application type, device code id, session location, version, Get Device — response body — device components A list of components applicable to the device item battery details external power, visible percent, Get Device — response body — device components A list of components applicable to the device item wifi details active, ip address v4, mac address, secure connection, signal strength, ssid
Get Device — response body — device attributes
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
manufacturer | string | Required within parent | The maker of the device. |
manufacturers_id | JSON | Optional | |
manufacturers_id (anyOf 1) | string | Alternative | The manufacturer-supplied identifier for the device (where available). In many cases, this identifier will be a serial number. |
manufacturers_id (anyOf 2) | null | Alternative | |
merchant_token | JSON | Optional | |
merchant_token (anyOf 1) | string | Alternative | The merchant_token identifying the merchant controlling the device. |
merchant_token (anyOf 2) | null | Alternative | |
model | JSON | Optional | |
model (anyOf 1) | string | Alternative | The specific model of the device. |
model (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | A seller-specified name for the device. |
name (anyOf 2) | null | Alternative | |
type | string | Required within parent | An enum identifier of the device type. The device type. See [DeviceType](#type-devicetype) for possible values Known values: TERMINAL, HANDHELD |
updated_at | string | Optional | The RFC 3339-formatted value of the most recent update to the device information. (Could represent any field update on the device.) Read only: true |
version | string | Optional | The current version of software installed on the device. |
Get Device — response body — device status
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
category | JSON | Optional | |
category (anyOf 1) | string | Alternative | Category of the device status. See [Category](#type-category) for possible values Known values: AVAILABLE, NEEDS_ATTENTION, OFFLINE |
category (anyOf 2) | null | Alternative |
Get Device — response body — device components A list of components applicable to the device item card reader details version
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
version | string | Optional | The version of the card reader. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.getdevice. Catalog operation: GetDevice. 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: ["DEVICES_READ"]
Pinned headers: {"Square-Version": "2026-11-18"}