Skip to content

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.

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 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.terminal.create_terminal_action(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Create Terminal Action — request body — body

Referenced models: Create Terminal Action — 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 Create Terminal Action — response body

Referenced models: Create Terminal Action — response body

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

Create Terminal Action — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
actionModelRequired within parentExpand Create Terminal Action — request body — body action
The Action to create.
idempotency_keystringRequired within parentA 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
FieldTypePresenceDescription and constraints
$objectRoot
actionModelOptionalExpand Get Terminal Action — response body — action
The created `TerminalAction`
errorsarrayOptionalInformation on errors encountered during the request.
errors[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents an action processed by the Square Terminal.
app_idstringOptionalThe ID of the application that created the action.
Read only: true
await_next_actionJSONOptional
await_next_action (anyOf 1)booleanAlternativeIndicates 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)nullAlternative
await_next_action_durationJSONOptional
await_next_action_duration (anyOf 1)stringAlternativeThe 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)nullAlternative
cancel_reasonstringOptionalThe 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_optionsJSONOptional
confirmation_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
created_atstringOptionalThe time when the `TerminalAction` was created as an RFC 3339 timestamp.
Read only: true
data_collection_optionsJSONOptional
data_collection_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
deadline_durationJSONOptional
deadline_duration (anyOf 1)stringAlternativeThe 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)nullAlternative
device_idJSONOptional
device_id (anyOf 1)stringAlternativeThe unique Id of the device intended for this `TerminalAction`.
The Id can be retrieved from /v2/devices api.
device_id (anyOf 2)nullAlternative
device_metadataModelOptionalExpand 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
idstringOptionalA unique ID for this `TerminalAction`.
Maximum length: 255
Minimum length: 10
Read only: true
location_idstringOptionalThe location id the action is attached to, if a link can be made.
Maximum length: 64
Read only: true
qr_code_optionsJSONOptional
qr_code_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
receipt_optionsJSONOptional
receipt_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
save_card_optionsJSONOptional
save_card_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
select_optionsJSONOptional
select_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
signature_optionsJSONOptional
signature_options (anyOf 1)ModelAlternativeExpand 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)nullAlternative
statusstringOptionalThe status of the `TerminalAction`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`
Read only: true
typeJSONOptional
type (anyOf 1)stringAlternativeDescribes 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)nullAlternative
updated_atstringOptionalThe 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
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

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"}

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.