Square: Retrieve Subscription
Square subscriptions.retrieveSubscription: arguments, response, policy and SDK examples.
← Subscriptions operations · Get started
Operation square.retrievesubscription
Provider route: GET /v2/subscriptions/{subscription_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["subscriptions"]["retrieveSubscription"]>[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.subscriptions.retrieveSubscription(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.subscriptions.retrieve_subscription(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.subscription_id | string | Required within parent | |
query | object | Optional | Additional keys: not allowed |
query.include | string | Optional |
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 Retrieve Subscription — response body |
Referenced models: Retrieve Subscription — response body
Schemas
Section titled “Schemas”5 more schemas are linked from the tables above, on the schema pages.
Retrieve Subscription — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines output parameters in a response from the [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint. |
errors | array | Optional | Errors encountered during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
subscription | Model | Optional | Expand Swap Plan — response body — subscription The subscription retrieved. |
Referenced models: Get Shift — response body — errors item, Swap Plan — response body — subscription
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
Swap Plan — response body — subscription
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a subscription purchased by a customer. For more information, see [Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). |
actions | JSON | Optional | |
actions (anyOf 1) | array | Alternative | The list of scheduled actions on this subscription. It is set only in the response from [RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) with the query parameter of `include=actions` or from [SearchSubscriptions](api-endpoint:Subscriptions-SearchSubscriptions) with the input parameter of `include:["actions"]`. |
actions (anyOf 1)[] | Model | Each item | Expand Swap Plan — response body — actions item |
actions (anyOf 2) | null | Alternative | |
canceled_date | JSON | Optional | |
canceled_date (anyOf 1) | string | Alternative | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to cancel the subscription, when the subscription status changes to `CANCELED` and the subscription billing stops. If this field is not set, the subscription ends according its subscription plan. This field cannot be updated, other than being cleared. |
canceled_date (anyOf 2) | null | Alternative | |
card_id | JSON | Optional | |
card_id (anyOf 1) | string | Alternative | The ID of the [subscriber's](entity:Customer) [card](entity:Card) used to charge for the subscription. |
card_id (anyOf 2) | null | Alternative | |
charged_through_date | string | Optional | The `YYYY-MM-DD`-formatted date up to when the subscriber is invoiced for the subscription. After the invoice is sent for a given billing period, this date will be the last day of the billing period. For example, suppose for the month of May a subscriber gets an invoice (or charged the card) on May 1. For the monthly billing scenario, this date is then set to May 31. Read only: true |
completed_date | JSON | Optional | |
completed_date (anyOf 1) | string | Alternative | The `YYYY-MM-DD`-formatted date when the subscription enters a terminal state. |
completed_date (anyOf 2) | null | Alternative | |
created_at | string | Optional | The timestamp when the subscription was created, in RFC 3339 format. Read only: true |
customer_id | string | Optional | The ID of the subscribing [customer](entity:Customer) profile. Read only: true |
id | string | Optional | The Square-assigned ID of the subscription. Maximum length: 255 Read only: true |
invoice_ids | array | Optional | The IDs of the [invoices](entity:Invoice) created for the subscription, listed in order when the invoices were created (newest invoices appear first). Read only: true |
invoice_ids[] | string | Each item | |
location_id | string | Optional | The ID of the location associated with the subscription. Read only: true |
monthly_billing_anchor_date | JSON | Optional | |
monthly_billing_anchor_date (anyOf 1) | integer | Alternative | The day of the month on which the subscription will issue invoices and publish orders. Read only: true |
monthly_billing_anchor_date (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
phases | array | Optional | array of phases for this subscription Read only: true |
phases[] | Model | Each item | Expand Swap Plan — response body — subscription phases item |
plan_variation_id | string | Optional | The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). Read only: true |
price_override_money | JSON | Optional | |
price_override_money (anyOf 1) | Model | Alternative | Expand Pay Order — response body — order total money A custom price which overrides the cost of a subscription plan variation with `STATIC` pricing. This field does not affect itemized subscriptions with `RELATIVE` pricing. Instead, you should edit the Subscription's [order template](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions#phases-and-order-templates). |
price_override_money (anyOf 2) | null | Alternative | |
source | JSON | Optional | |
source (anyOf 1) | Model | Alternative | Expand Create Subscription — request body — body source The origination details of the subscription. |
source (anyOf 2) | null | Alternative | |
start_date | string | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. Read only: true |
status | string | Optional | Supported subscription statuses. The current status of the subscription. See [SubscriptionStatus](#type-subscriptionstatus) for possible values Known values: PENDING, ACTIVE, CANCELED, DEACTIVATED, PAUSED, COMPLETED Read only: true |
tax_percentage | JSON | Optional | |
tax_percentage (anyOf 1) | string | Alternative | The tax amount applied when billing the subscription. The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. For example, a value of `7.5` corresponds to 7.5%. |
tax_percentage (anyOf 2) | null | Alternative | |
timezone | string | Optional | Timezone that will be used in date calculations for the subscription. Defaults to the timezone of the location based on `location_id`. Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). Read only: true |
version | JSON | Optional | |
version (anyOf 1) | integer | Alternative | The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. Format: int64 |
version (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Pay Order — response body — order total money, Swap Plan — response body — subscription phases item, Swap Plan — response body — actions item, Create Subscription — request body — body source
Pay Order — response body — order total money
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an amount of money. `Money` fields can be signed or unsigned. Fields that do not explicitly define whether they are signed or unsigned are considered unsigned and can only hold positive amounts. For signed fields, the sign of the value indicates the purpose of the money transfer. See [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts) for more information. |
amount | JSON | Optional | |
amount (anyOf 1) | JSON | Alternative | |
amount (anyOf 1) (anyOf 1) | integer | Alternative | The amount of money, in the smallest denomination of the currency indicated by `currency`. For example, when `currency` is `USD`, `amount` is in cents. Monetary amounts can be positive or negative. See the specific field description to determine the meaning of the sign in a particular case. Format: int64 |
amount (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
amount (anyOf 2) | null | Alternative | |
currency | JSON | Optional | |
currency (anyOf 1) | Model | Alternative | Expand Create Location — response body — location currency The type of currency, in __ISO 4217 format__. For example, the currency code for US dollars is `USD`. See [Currency](entity:Currency) for possible values. See [Currency](#type-currency) for possible values |
currency (anyOf 2) | null | Alternative |
Referenced models: Create Location — response body — location currency
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.retrievesubscription. Catalog operation: RetrieveSubscription. 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: ["SUBSCRIPTIONS_READ"]
Pinned headers: {"Square-Version": "2026-11-18"}