Link and Dismiss Terminal Actions

Applies to: Terminal API

Learn how to link multiple actions for screen workflows and dismiss actions that are running on the Square Terminal.

Link to section

Link Terminal actions for custom screen workflows

With Terminal actions, you can configure a screen workflow that allows the Square Terminal to run two or more actions in sequence. Use the await_next_action parameter and set it to true in a CreateTerminalAction request.

This parameter instructs the Square Terminal to present a modal window with a "Please wait" message after a buyer completes an action. This window allows the Square Terminal to transition to the next action request and display the screen.

If the Square Terminal doesn't receive a follow-up CreateTerminalAction request, it dismisses the "Please wait" message and returns to the idle screen after a period of time. You can define this time period with the optional await_next_action_duration parameter, which has a default value of 5 minutes.

Link to section

Dismiss the waiting screen

If you need to dismiss the "Please wait..." screen without waiting for the duration deadline of the action request to elapse, you can call the DismissTerminalAction endpoint and reference the relevant action ID. This results in a 200 response and dismisses the waiting screen if the Square Terminal is presenting it. If the buyer has already dismissed the waiting screen, the Square Terminal ignores the DismissTerminalAction action request.

Link to section

Outcomes from dismissing a Terminal action

When you call the DismissTerminalAction endpoint, one of the following outcomes occur:

  • If the currently running action is IN-PROGRESS for screen action types that take buyer information, the Square Terminal cancels the action and returns to the idle screen.
  • If the currently running action for the QR code screen is IN-PROGRESS, the Square Terminal completes the action and returns to the idle screen.
  • If the currently running action is PENDING, the Square Terminal cancels the action.
  • If the currently running action has completed its operation (has the COMPLETED status) and the Square Terminal shows the “Please wait...” screen (with await_next_action parameter = true), the Square Terminal dismisses the waiting screen and returns to the idle screen.
Link to section

When to dismiss or cancel a Terminal action

The DismissTerminalAction endpoint functions similarly to the CancelTerminalAction endpoint, with some differences. Square recommends the following use cases for each endpoint:

Link to section

Example: Implement a buyer acknowledgement screen flow

The seller wants to have the Square Terminal prompt a buyer to confirm information that's presented on the screen and to collect a signature as acknowledgment. You can use the Terminal actions endpoint to perform the following process:

  1. Send a CONFIRMATION screen action request with the await_next_action parameter set to true.

    Create terminal action

    After the buyer confirms a decision, you receive the action response. The Square Terminal displays a COMPLETED status.

  2. Send a subsequent SIGNATURE screen action and wait for the buyer to submit the signature.

    Create terminal action

    The following animation illustrates the screen flow:

    An animation of linked actions displaying the confirmation and signature screens on the Square Terminal. A buyer is confirming agreement and signing for the pickup order.

  3. If the buyer chooses to close the signature screen instead of signing it, send a DismissTerminalAction action request and include the action_id of the CONFIRMATION action response in the DismissTerminalAction request.

    Dismiss terminal action