Skip to content

Square: Cancel Terminal Checkout

Square terminal.cancelTerminalCheckout: arguments, response, policy and SDK examples.

← Terminal operations · Get started

Operation square.cancelterminalcheckout

Provider route: POST /v2/terminals/checkouts/{checkout_id}/cancel. 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"]["cancelTerminalCheckout"]>[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.cancelTerminalCheckout(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.cancel_terminal_checkout(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.checkout_idstringRequired within parent

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel Terminal Checkout — response body

Referenced models: Cancel Terminal Checkout — response body

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

Cancel Terminal Checkout — response body
FieldTypePresenceDescription and constraints
$objectRoot
checkoutModelOptionalExpand Get Terminal Checkout — response body — checkout
The canceled `TerminalCheckout`.
errorsarrayOptionalInformation about errors encountered during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item

Referenced models: Get Shift — response body — errors item, Get Terminal Checkout — response body — checkout

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

Get Terminal Checkout — response body — checkout
FieldTypePresenceDescription and constraints
$objectRootRepresents a checkout processed by the Square Terminal.
amount_moneyModelRequired within parentExpand Pay Order — response body — order total money
The amount of money (including the tax amount) that the Square Terminal device should try to collect.
app_fee_moneyJSONOptional
app_fee_money (anyOf 1)ModelAlternativeExpand Pay Order — response body — order total money
The amount the developer is taking as a fee for facilitating the payment on behalf
of the seller.

The amount cannot be more than 90% of the total amount of the payment.

The amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts).

The fee currency code must match the currency associated with the seller that is accepting the payment. The application must be from a developer account in the same country and using the same currency code as the seller.

For more information about the application fee scenario, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees).

To set this field, PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).
app_fee_money (anyOf 2)nullAlternative
app_idstringOptionalThe ID of the application that created the checkout.
Read only: true
cancel_reasonstringOptionalThe reason why `TerminalCheckout` is canceled. Present if the status is `CANCELED`.
See [ActionCancelReason](#type-actioncancelreason) for possible values
Known values: BUYER_CANCELED, SELLER_CANCELED, TIMED_OUT
Read only: true
created_atstringOptionalThe time when the `TerminalCheckout` was created, as an RFC 3339 timestamp.
Read only: true
customer_idJSONOptional
customer_id (anyOf 1)stringAlternativeAn optional ID of the customer associated with the checkout.
customer_id (anyOf 2)nullAlternative
deadline_durationJSONOptional
deadline_duration (anyOf 1)stringAlternativeAn RFC 3339 duration, after which the checkout is automatically canceled.
A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason
of `TIMED_OUT`.

Default: 5 minutes from creation

Maximum: 5 minutes
deadline_duration (anyOf 2)nullAlternative
device_optionsModelRequired within parentExpand Get Terminal Checkout — response body — checkout device options
Options to control the display and behavior of the Square Terminal device.
idstringOptionalA unique ID for this `TerminalCheckout`.
Maximum length: 255
Minimum length: 10
Read only: true
location_idstringOptionalThe location of the device where the `TerminalCheckout` was directed.
Maximum length: 64
Read only: true
noteJSONOptional
note (anyOf 1)stringAlternativeAn optional note to associate with the checkout, as well as with any payments used to complete the checkout.
Note: maximum 500 characters
Maximum length: 500
note (anyOf 2)nullAlternative
order_idJSONOptional
order_id (anyOf 1)stringAlternativeThe reference to the Square order ID for the checkout request.
order_id (anyOf 2)nullAlternative
payment_idsarrayOptionalA list of IDs for payments created by this `TerminalCheckout`.
Read only: true
payment_ids[]stringEach item
payment_optionsJSONOptional
payment_options (anyOf 1)ModelAlternativeExpand Get Terminal Checkout — response body — checkout payment options accept partial authorization, autocomplete, delay action, delay duration
Payment-specific options for the checkout request.
payment_options (anyOf 2)nullAlternative
payment_typeJSONOptional
payment_type (anyOf 1)stringAlternativeThe type of payment the terminal should attempt to capture from. Defaults to `CARD_PRESENT`.
See [CheckoutOptionsPaymentType](#type-checkoutoptionspaymenttype) for possible values
Known values: CARD_PRESENT, MANUAL_CARD_ENTRY, FELICA_ID, FELICA_QUICPAY, FELICA_TRANSPORTATION_GROUP, FELICA_ALL, PAYPAY, QR_CODE
payment_type (anyOf 2)nullAlternative
reference_idJSONOptional
reference_id (anyOf 1)stringAlternativeAn optional user-defined reference ID that can be used to associate
this `TerminalCheckout` to another entity in an external system. For example, an order
ID generated by a third-party shopping cart. The ID is also associated with any payments
used to complete the checkout.
Maximum length: 40
reference_id (anyOf 2)nullAlternative
statement_description_identifierJSONOptional
statement_description_identifier (anyOf 1)stringAlternativeOptional additional payment information to include on the customer's card statement as
part of the statement description. This can be, for example, an invoice number, ticket number,
or short description that uniquely identifies the purchase.
Maximum length: 20
statement_description_identifier (anyOf 2)nullAlternative
statusstringOptionalThe status of the `TerminalCheckout`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`
Read only: true
team_member_idJSONOptional
team_member_id (anyOf 1)stringAlternativeAn optional ID of the team member associated with creating the checkout.
team_member_id (anyOf 2)nullAlternative
tip_moneyJSONOptional
tip_money (anyOf 1)ModelAlternativeExpand Pay Order — response body — order total money
The amount designated as a tip, in addition to `amount_money`. This may only be set for a
checkout that has tipping disabled (`tip_settings.allow_tipping` is `false`).
tip_money (anyOf 2)nullAlternative
updated_atstringOptionalThe time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp.
Read only: true

Referenced models: Get Terminal Checkout — response body — checkout device options, Pay Order — response body — order total money, Get Terminal Checkout — response body — checkout payment options accept partial authorization, autocomplete, delay action, delay duration

Create Location — response body — location currency
FieldTypePresenceDescription and constraints
$stringRootIndicates 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

SDK function policy ID: square.cancelterminalcheckout. Catalog operation: CancelTerminalCheckout. 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.