Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 4.77 KB

subscription.md

File metadata and controls

58 lines (48 loc) · 4.77 KB

Subscription

Represents a subscription to a subscription plan by a subscriber.

For an overview of the Subscription type, see Subscription object.

Structure

Subscription

Fields

Name Type Tags Description
id string | undefined Optional The Square-assigned ID of the subscription.
Constraints: Maximum Length: 255
locationId string | undefined Optional The ID of the location associated with the subscription.
planId string | undefined Optional The ID of the subscribed-to subscription plan.
customerId string | undefined Optional The ID of the subscribing customer profile.
startDate string | undefined Optional The YYYY-MM-DD-formatted date (for example, 2013-01-15) to start the subscription.
canceledDate string | undefined Optional 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.
chargedThroughDate string | undefined 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.
status string | undefined Optional Supported subscription statuses.
taxPercentage string | undefined Optional 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%.
invoiceIds string[] | undefined Optional The IDs of the invoices created for the
subscription, listed in order when the invoices were created
(newest invoices appear first).
priceOverrideMoney Money | undefined Optional Represents 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
for more information.
version bigint | undefined Optional 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.
createdAt string | undefined Optional The timestamp when the subscription was created, in RFC 3339 format.
cardId string | undefined Optional The ID of the subscriber's card
used to charge for the subscription.
timezone string | undefined 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).
source SubscriptionSource | undefined Optional The origination details of the subscription.
actions SubscriptionAction[] | undefined Optional The list of scheduled actions on this subscription. It is set only in the response from
RetrieveSubscription with the query parameter
of include=actions or from
SearchSubscriptions with the input parameter
of include:["actions"].

Example (as JSON)

{
  "id": null,
  "location_id": null,
  "plan_id": null,
  "customer_id": null,
  "start_date": null,
  "canceled_date": null,
  "charged_through_date": null,
  "status": null,
  "tax_percentage": null,
  "invoice_ids": null,
  "price_override_money": null,
  "version": null,
  "created_at": null,
  "card_id": null,
  "timezone": null,
  "source": null,
  "actions": null
}