Skip to content

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.

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 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.change_billing_anchor_date(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
bodyModelRequired within parentExpand Change Billing Anchor Date — request body — body

Referenced models: Change Billing Anchor Date — request body — body

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Change Billing Anchor Date — response body

Referenced models: Change Billing Anchor Date — response body

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

Change Billing Anchor Date — request body — body
FieldTypePresenceDescription and constraints
$objectRootDefines input parameters in a request to the
[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.
effective_dateJSONOptional
effective_date (anyOf 1)stringAlternativeThe `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)nullAlternative
monthly_billing_anchor_dateJSONOptional
monthly_billing_anchor_date (anyOf 1)integerAlternativeThe anchor day for the billing cycle.
Maximum: 31
Minimum: 1
monthly_billing_anchor_date (anyOf 2)nullAlternative
Change Billing Anchor Date — response body
FieldTypePresenceDescription and constraints
$objectRootDefines output parameters in a request to the
[ChangeBillingAnchorDate](api-endpoint:Subscriptions-ChangeBillingAnchorDate) endpoint.
actionsarrayOptionalA list of a single billing anchor date change for the subscription.
actions[]ModelEach itemExpand Swap Plan — response body — actions item
errorsarrayOptionalErrors encountered during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
subscriptionModelOptionalExpand 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
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

Create Subscription — request body — body source
FieldTypePresenceDescription and constraints
$objectRootThe origination details of the subscription.
nameJSONOptional
name (anyOf 1)stringAlternativeThe 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)nullAlternative

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

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.