Skip to content

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.

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 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.subscriptions.retrieve_subscription(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.subscription_idstringRequired within parent
queryobjectOptionalAdditional keys: not allowed
query.includestringOptional

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Retrieve Subscription — response body

Referenced models: Retrieve Subscription — response body

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

Retrieve Subscription — response body
FieldTypePresenceDescription and constraints
$objectRootDefines output parameters in a response from the
[RetrieveSubscription](api-endpoint:Subscriptions-RetrieveSubscription) endpoint.
errorsarrayOptionalErrors encountered during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
subscriptionModelOptionalExpand 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
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

Swap Plan — response body — subscription
FieldTypePresenceDescription and constraints
$objectRootRepresents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions).
actionsJSONOptional
actions (anyOf 1)arrayAlternativeThe 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)[]ModelEach itemExpand Swap Plan — response body — actions item
actions (anyOf 2)nullAlternative
canceled_dateJSONOptional
canceled_date (anyOf 1)stringAlternativeThe `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)nullAlternative
card_idJSONOptional
card_id (anyOf 1)stringAlternativeThe ID of the [subscriber's](entity:Customer) [card](entity:Card)
used to charge for the subscription.
card_id (anyOf 2)nullAlternative
charged_through_datestringOptionalThe `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_dateJSONOptional
completed_date (anyOf 1)stringAlternativeThe `YYYY-MM-DD`-formatted date when the subscription enters a terminal state.
completed_date (anyOf 2)nullAlternative
created_atstringOptionalThe timestamp when the subscription was created, in RFC 3339 format.
Read only: true
customer_idstringOptionalThe ID of the subscribing [customer](entity:Customer) profile.
Read only: true
idstringOptionalThe Square-assigned ID of the subscription.
Maximum length: 255
Read only: true
invoice_idsarrayOptionalThe 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[]stringEach item
location_idstringOptionalThe ID of the location associated with the subscription.
Read only: true
monthly_billing_anchor_dateJSONOptional
monthly_billing_anchor_date (anyOf 1)integerAlternativeThe day of the month on which the subscription will issue invoices and publish orders.
Read only: true
monthly_billing_anchor_date (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
phasesarrayOptionalarray of phases for this subscription
Read only: true
phases[]ModelEach itemExpand Swap Plan — response body — subscription phases item
plan_variation_idstringOptionalThe ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation).
Read only: true
price_override_moneyJSONOptional
price_override_money (anyOf 1)ModelAlternativeExpand 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)nullAlternative
sourceJSONOptional
source (anyOf 1)ModelAlternativeExpand Create Subscription — request body — body source
The origination details of the subscription.
source (anyOf 2)nullAlternative
start_datestringOptionalThe `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription.
Read only: true
statusstringOptionalSupported 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_percentageJSONOptional
tax_percentage (anyOf 1)stringAlternativeThe 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)nullAlternative
timezonestringOptionalTimezone 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
versionJSONOptional
version (anyOf 1)integerAlternativeThe 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)stringAlternativePattern: ^-?[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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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.
amountJSONOptional
amount (anyOf 1)JSONAlternative
amount (anyOf 1) (anyOf 1)integerAlternativeThe 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)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
amount (anyOf 2)nullAlternative
currencyJSONOptional
currency (anyOf 1)ModelAlternativeExpand 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)nullAlternative

Referenced models: Create Location — response body — location currency

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

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.