Square: Update Payment Link
Square checkout.updatePaymentLink: arguments, response, policy and SDK examples.
← Checkout operations · Get started
Operation square.updatepaymentlink
Provider route: PUT /v2/online-checkout/payment-links/{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["checkout"]["updatePaymentLink"]>[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.checkout.updatePaymentLink(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.checkout.update_payment_link(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.id | string | Required within parent | |
body | Model | Required within parent | Expand Update Payment Link — request body — body |
Referenced models: Update Payment Link — 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 Update Payment Link — response body |
Referenced models: Update Payment Link — response body
Schemas
Section titled “Schemas”16 more schemas are linked from the tables above, on the schema pages.
Update Payment Link — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
errors | array | Optional | Any errors that occurred when updating the payment link. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
payment_link | Model | Optional | Expand Create Payment Link — response body — payment link The updated payment link. |
Referenced models: Get Shift — response body — errors item, Create Payment Link — response body — payment link
Update Payment Link — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
payment_link | Model | Required within parent | Expand Update Payment Link — request body — body payment link The `payment_link` object describing the updates to apply. For more information, see [Update a payment link](https://developer.squareup.com/docs/checkout-api/manage-checkout#update-a-payment-link). |
Referenced models: Update Payment Link — request body — body payment link
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
Create Payment Link — response body — payment link
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
checkout_options | JSON | Optional | |
checkout_options (anyOf 1) | Model | Alternative | Expand Create Payment Link — response body — payment link checkout options accepted payment methods, allow tipping, app fee money, ask for shipping address, custom fields, enable coupon, enable loyalty, merchant support email, phone collection, redirect url, shipping fee, subscription plan id The checkout options configured for the payment link. For more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). |
checkout_options (anyOf 2) | null | Alternative | |
created_at | string | Optional | The timestamp when the payment link was created, in RFC 3339 format. Read only: true |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | The optional description of the `payment_link` object. It is primarily for use by your application and is not used anywhere. Maximum length: 4096 |
description (anyOf 2) | null | Alternative | |
id | string | Optional | The Square-assigned ID of the payment link. Read only: true |
long_url | string | Optional | The long URL of the payment link. Maximum length: 255 Read only: true |
order_id | string | Optional | The ID of the order associated with the payment link. Maximum length: 192 Read only: true |
payment_note | JSON | Optional | |
payment_note (anyOf 1) | string | Alternative | A note for the payment. After processing the payment, Square adds this note to the resulting `Payment` as well as the post payment confirmation email. Maximum length: 500 |
payment_note (anyOf 2) | null | Alternative | |
pre_populated_data | JSON | Optional | |
pre_populated_data (anyOf 1) | Model | Alternative | Expand Create Payment Link — response body — payment link pre populated data buyer address, buyer email, buyer phone number Describes buyer data to prepopulate on the checkout page. |
pre_populated_data (anyOf 2) | null | Alternative | |
updated_at | string | Optional | The timestamp when the payment link was last updated, in RFC 3339 format. Read only: true |
url | string | Optional | The shortened URL of the payment link. Maximum length: 255 Read only: true |
version | JSON | Required within parent | |
version (anyOf 1) | integer | Alternative | The Square-assigned version number, which is incremented each time an update is committed to the payment link. Maximum: 65535 |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Create Payment Link — response body — payment link checkout options accepted payment methods, allow tipping, app fee money, ask for shipping address, custom fields, enable coupon, enable loyalty, merchant support email, phone collection, redirect url, shipping fee, subscription plan id, Create Payment Link — response body — payment link pre populated data buyer address, buyer email, buyer phone number
Update Payment Link — request body — body payment link
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
checkout_options | JSON | Optional | |
checkout_options (anyOf 1) | Model | Alternative | Expand Create Payment Link — request body — body checkout options The checkout options configured for the payment link. For more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). |
checkout_options (anyOf 2) | null | Alternative | |
created_at | string | Optional | The timestamp when the payment link was created, in RFC 3339 format. Read only: true |
description | JSON | Optional | |
description (anyOf 1) | string | Alternative | The optional description of the `payment_link` object. It is primarily for use by your application and is not used anywhere. Maximum length: 4096 |
description (anyOf 2) | null | Alternative | |
id | string | Optional | The Square-assigned ID of the payment link. Read only: true |
long_url | string | Optional | The long URL of the payment link. Maximum length: 255 Read only: true |
order_id | string | Optional | The ID of the order associated with the payment link. Maximum length: 192 Read only: true |
payment_note | JSON | Optional | |
payment_note (anyOf 1) | string | Alternative | A note for the payment. After processing the payment, Square adds this note to the resulting `Payment` as well as the post payment confirmation email. Maximum length: 500 |
payment_note (anyOf 2) | null | Alternative | |
pre_populated_data | JSON | Optional | |
pre_populated_data (anyOf 1) | Model | Alternative | Expand Create Payment Link — request body — body pre populated data Describes buyer data to prepopulate on the checkout page. |
pre_populated_data (anyOf 2) | null | Alternative | |
updated_at | string | Optional | The timestamp when the payment link was last updated, in RFC 3339 format. Read only: true |
url | string | Optional | The shortened URL of the payment link. Maximum length: 255 Read only: true |
version | integer | Required within parent | The Square-assigned version number, which is incremented each time an update is committed to the payment link. Maximum: 65535 |
Referenced models: Create Payment Link — request body — body checkout options, Create Payment Link — request body — body pre populated data
Create Payment Link — response body — payment link pre populated data buyer address, buyer email, buyer phone number
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Describes buyer data to prepopulate in the payment form. For more information, see [Optional Checkout Configurations](https://developer.squareup.com/docs/checkout-api/optional-checkout-configurations). |
buyer_address | JSON | Optional | |
buyer_address (anyOf 1) | Model | Alternative | Expand Get Payment — response body — payment billing address The buyer address to prepopulate in the payment form. |
buyer_address (anyOf 2) | null | Alternative | |
buyer_email | JSON | Optional | |
buyer_email (anyOf 1) | string | Alternative | The buyer email to prepopulate in the payment form. Maximum length: 256 |
buyer_email (anyOf 2) | null | Alternative | |
buyer_phone_number | JSON | Optional | |
buyer_phone_number (anyOf 1) | string | Alternative | The buyer phone number to prepopulate in the payment form. Maximum length: 17 |
buyer_phone_number (anyOf 2) | null | Alternative |
Referenced models: Get Payment — response body — payment billing address
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.updatepaymentlink. Catalog operation: UpdatePaymentLink. 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: ["ORDERS_READ", "ORDERS_WRITE", "PAYMENTS_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}