<- Subscriptions API

Subscriptions API

Create subscription

POST

 /v2/subscriptions

Creates a subscription to a subscription plan by a customer.

If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square bills 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.

Permissions:CUSTOMERS_READ, PAYMENTS_WRITE, SUBSCRIPTIONS_WRITE, ITEMS_READ, ORDERS_WRITE, INVOICES_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_id

string

Required

The ID of the subscription plan created using the Catalog API. For more information, see Set Up and Manage a Subscription Plan and Subscriptions Walkthrough.

Link to section

customer_id

string

Required

The ID of the customer subscribing to the subscription plan.

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 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 to apply for the subscription. If specified, it overrides the price configured by the subscription plan.

Show attributes
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. For an example to create a customer profile for a subscriber and add a card on file, see Subscriptions Walkthrough.

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.

Show attributes
Link to section

Response fields

Link to section

errors

Errors encountered during the request.

Show attributes
Link to section

subscription

The newly created subscription.

For more information, see Subscription object.

Show attributes

Error descriptions