<- Subscriptions API

Subscriptions API

Create subscription

POST

 /v2/subscriptions

Enrolls a customer in a subscription.

If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square sends an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional start_date. Each individual subscription is associated with a particular location.

For more information, see Create a subscription.

Permissions:PAYMENTS_WRITE, SUBSCRIPTIONS_WRITE, CUSTOMERS_READ, INVOICES_WRITE, ITEMS_READ, ORDERS_WRITE
Try in API Explorer
Link to section

Request body

Example code

Link to section

idempotency_key

string

A unique string that identifies this CreateSubscription request. If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent.

For more information, see Idempotency keys.

Link to section

location_id

string

Required

The ID of the location the subscription is associated with.

Link to section

plan_variation_id

string

Link to section

customer_id

string

Required

The ID of the customer subscribing to the subscription plan variation.

Link to section

start_date

string

The YYYY-MM-DD-formatted date to start the subscription. If it is unspecified, the subscription starts immediately.

Link to section

canceled_date

string

The YYYY-MM-DD-formatted date when the newly created subscription is scheduled for cancellation.

This date overrides the cancellation date set in the plan variation configuration. If the cancellation date is earlier than the end date of a subscription cycle, the subscription stops at the canceled date and the subscriber is sent a prorated invoice at the beginning of the canceled cycle.

When the subscription plan of the newly created subscription has a fixed number of cycles and the canceled_date occurs before the subscription plan expires, the specified canceled_date sets the date when the subscription stops through the end of the last cycle.

Link to section

tax_percentage

string

The tax to add 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%.

Link to section

price_override_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.

Link to section

card_id

string

The ID of the subscriber's card to charge. If it is not specified, the subscriber receives an invoice via email with a link to pay for their subscription.

Link to section

timezone

string

The timezone that is used in date calculations for the subscription. If unset, defaults to the location timezone. If a timezone is not configured for the location, defaults to "America/New_York". Format: the IANA Timezone Database identifier for the location timezone. For a list of time zones, see List of tz database time zones.

Link to section

source

Beta

The origination details of the subscription.

Link to section

monthly_billing_anchor_date

integer(32-bit)

Beta

The day-of-the-month to change the billing date to.

Link to section

phases

array of phases for this subscription

Link to section

Response fields

Link to section

errors

Errors encountered during the request.

Link to section

subscription

Error descriptions