Square: Change Billing Anchor Date
Square subscriptions.changeBillingAnchorDate: arguments, response, policy and SDK examples.
← Subscriptions operations · Get started
Operation square.changebillinganchordate
Provider route: POST /v2/subscriptions/{subscription_id}/billing-anchor. 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"]["changeBillingAnchorDate"]>[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.changeBillingAnchorDate(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.change_billing_anchor_date(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 | |
body | Model | Required within parent | Expand Change Billing Anchor Date — request body — body |
Referenced models: Change Billing Anchor Date — 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 Change Billing Anchor Date — response body |
Referenced models: Change Billing Anchor Date — response body
Schemas
Section titled “Schemas”5 more schemas are linked from the tables above, on the schema pages.
Change Billing Anchor Date — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines input parameters in a request to the [ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint. |
effective_date | JSON | Optional | |
effective_date (anyOf 1) | string | Alternative | The `YYYY-MM-DD`-formatted date when the scheduled `BILLING_ANCHOR_CHANGE` action takes place on the subscription. When this date is unspecified or falls within the current billing cycle, the billing anchor date is changed immediately. |
effective_date (anyOf 2) | null | Alternative | |
monthly_billing_anchor_date | JSON | Optional | |
monthly_billing_anchor_date (anyOf 1) | integer | Alternative | The anchor day for the billing cycle. Maximum: 31 Minimum: 1 |
monthly_billing_anchor_date (anyOf 2) | null | Alternative |
Change Billing Anchor Date — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Defines output parameters in a request to the [ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint. |
actions | array | Optional | A list of a single billing anchor date change for the subscription. |
actions[] | Model | Each item | Expand Swap Plan — response body — actions item |
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 specified subscription for updating billing anchor date. |
Referenced models: Get Shift — response body — errors item, Swap Plan — response body — subscription, Swap Plan — response body — actions item
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
Create Subscription — request body — body source
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The origination details of the subscription. |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The name used to identify the place (physical or digital) that a subscription originates. If unset, the name defaults to the name of the application that created the subscription. Maximum length: 255 |
name (anyOf 2) | null | Alternative |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.changebillinganchordate. Catalog operation: ChangeBillingAnchorDate. 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: ["ITEMS_READ", "SUBSCRIPTIONS_READ", "SUBSCRIPTIONS_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}