Square: Create Terminal Action
Square terminal.createTerminalAction: arguments, response, policy and SDK examples.
← Terminal operations · Get started
Operation square.createterminalaction
Provider route: POST /v2/terminals/actions. 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["terminal"]["createTerminalAction"]>[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.terminal.createTerminalAction(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.terminal.create_terminal_action(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Create Terminal Action — request body — body |
Referenced models: Create Terminal Action — request body — body
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 Create Terminal Action — response body |
Referenced models: Create Terminal Action — response body
Schemas
Section titled “Schemas”15 more schemas are linked from the tables above, on the schema pages.
Create Terminal Action — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
action | Model | Required within parent | Expand Create Terminal Action — request body — body action The Action to create. |
idempotency_key | string | Required within parent | A unique string that identifies this `CreateAction` request. Keys can be any valid string but must be unique for every `CreateAction` request. See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information. Maximum length: 64 Minimum length: 1 |
Referenced models: Create Terminal Action — request body — body action
Create Terminal Action — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
action | Model | Optional | Expand Get Terminal Action — response body — action The created `TerminalAction` |
errors | array | Optional | Information on errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item, Get Terminal Action — response body — action
Create Terminal Action — request body — body action
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an action processed by the Square Terminal. |
app_id | string | Optional | The ID of the application that created the action. Read only: true |
await_next_action | JSON | Optional | |
await_next_action (anyOf 1) | boolean | Alternative | Indicates the action will be linked to another action and requires a waiting dialog to be displayed instead of returning to the idle screen on completion of the action. Only supported on SIGNATURE, CONFIRMATION, DATA_COLLECTION, and SELECT types. |
await_next_action (anyOf 2) | null | Alternative | |
await_next_action_duration | JSON | Optional | |
await_next_action_duration (anyOf 1) | string | Alternative | The timeout duration of the waiting dialog as an RFC 3339 duration, after which the waiting dialog will no longer be displayed and the Terminal will return to the idle screen. Default: 5 minutes from when the waiting dialog is displayed Maximum: 5 minutes |
await_next_action_duration (anyOf 2) | null | Alternative | |
cancel_reason | string | Optional | The reason why `TerminalAction` is canceled. Present if the status is `CANCELED`. See [ActionCancelReason](#type-actioncancelreason) for possible values One of: BUYER_CANCELED, SELLER_CANCELED, TIMED_OUT Read only: true |
confirmation_options | JSON | Optional | |
confirmation_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action confirmation options agree button text, body, decision, disagree button text, title Describes configuration for the confirmation action. Requires `CONFIRMATION` type. |
confirmation_options (anyOf 2) | null | Alternative | |
created_at | string | Optional | The time when the `TerminalAction` was created as an RFC 3339 timestamp. Read only: true |
data_collection_options | JSON | Optional | |
data_collection_options (anyOf 1) | Model | Alternative | Expand CreateTerminalAction — request body — body / action / data_collection_options / input_type: EMAIL, PHONE NUMBER Describes configuration for the data collection action. Requires `DATA_COLLECTION` type. |
data_collection_options (anyOf 2) | null | Alternative | |
deadline_duration | JSON | Optional | |
deadline_duration (anyOf 1) | string | Alternative | The duration as an RFC 3339 duration, after which the action will be automatically canceled. TerminalActions that are `PENDING` will be automatically `CANCELED` and have a cancellation reason of `TIMED_OUT` Default: 5 minutes from creation Maximum: 5 minutes |
deadline_duration (anyOf 2) | null | Alternative | |
device_id | JSON | Optional | |
device_id (anyOf 1) | string | Alternative | The unique Id of the device intended for this `TerminalAction`. The Id can be retrieved from /v2/devices api. |
device_id (anyOf 2) | null | Alternative | |
device_metadata | Model | Optional | Expand Get Terminal Action — response body — action device metadata Details about the Terminal that received the action request (such as battery level, operating system version, and network connection settings). Only available for `PING` action type. Read only: true |
id | string | Optional | A unique ID for this `TerminalAction`. Maximum length: 255 Minimum length: 10 Read only: true |
location_id | string | Optional | The location id the action is attached to, if a link can be made. Maximum length: 64 Read only: true |
qr_code_options | JSON | Optional | |
qr_code_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action qr code options barcode contents, body, title Describes configuration for the QR code action. Requires `QR_CODE` type. |
qr_code_options (anyOf 2) | null | Alternative | |
receipt_options | JSON | Optional | |
receipt_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action receipt options Describes receipt action fields Describes configuration for the receipt action. Requires `RECEIPT` type. |
receipt_options (anyOf 2) | null | Alternative | |
save_card_options | JSON | Optional | |
save_card_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action save card options Describes save-card action fields Describes configuration for the save-card action. Requires `SAVE_CARD` type. |
save_card_options (anyOf 2) | null | Alternative | |
select_options | JSON | Optional | |
select_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action select options body, options, selected option, title Describes configuration for the select action. Requires `SELECT` type. |
select_options (anyOf 2) | null | Alternative | |
signature_options | JSON | Optional | |
signature_options (anyOf 1) | Model | Alternative | Expand Get Terminal Action — response body — action signature options body, signature, title Describes configuration for the signature capture action. Requires `SIGNATURE` type. |
signature_options (anyOf 2) | null | Alternative | |
status | string | Optional | The status of the `TerminalAction`. Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` Read only: true |
type | JSON | Optional | |
type (anyOf 1) | string | Alternative | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. Represents the type of the action. See [ActionType](#type-actiontype) for possible values One of: QR_CODE, PING, SAVE_CARD, SIGNATURE, CONFIRMATION, RECEIPT, DATA_COLLECTION, SELECT |
type (anyOf 2) | null | Alternative | |
updated_at | string | Optional | The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. Read only: true |
Referenced models: Get Terminal Action — response body — action confirmation options agree button text, body, decision, disagree button text, title, CreateTerminalAction — request body — body / action / data_collection_options / input_type: EMAIL, PHONE NUMBER, Get Terminal Action — response body — action device metadata, Get Terminal Action — response body — action qr code options barcode contents, body, title, Get Terminal Action — response body — action receipt options Describes receipt action fields, Get Terminal Action — response body — action save card options Describes save-card action fields, Get Terminal Action — response body — action select options body, options, selected option, title, Get Terminal Action — response body — action signature options body, signature, title
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
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.createterminalaction. Catalog operation: CreateTerminalAction. 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: ["PAYMENTS_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}