Represents a customer subscription to a subscription plan.
For an overview of the Subscription type, see
Subscription object.
Subscription
| Name | Type | Tags | Description | Getter | Setter |
|---|---|---|---|---|---|
id |
?string |
Optional | The Square-assigned ID of the subscription. | getId(): ?string | setId(?string id): void |
locationId |
?string |
Optional | The ID of the location associated with the subscription. | getLocationId(): ?string | setLocationId(?string locationId): void |
planId |
?string |
Optional | The ID of the associated subscription plan. | getPlanId(): ?string | setPlanId(?string planId): void |
customerId |
?string |
Optional | The ID of the associated customer profile. | getCustomerId(): ?string | setCustomerId(?string customerId): void |
startDate |
?string |
Optional | The start date of the subscription, in YYYY-MM-DD format (for example, 2013-01-15). |
getStartDate(): ?string | setStartDate(?string startDate): void |
canceledDate |
?string |
Optional | The subscription cancellation date, in YYYY-MM-DD format (for example, 2013-01-15). On this date, the subscription status changes to CANCELED and the subscription billing stops.If you don't set this field, the subscription plan dictates if and when subscription ends. You cannot update this field, you can only clear it. |
getCanceledDate(): ?string | setCanceledDate(?string canceledDate): void |
status |
?string (SubscriptionStatus) |
Optional | Possible subscription status values. | getStatus(): ?string | setStatus(?string status): void |
taxPercentage |
?string |
Optional | The tax amount applied when billing the subscription. The percentage is expressed in decimal form, using a '.' as the decimalseparator and without a '%' sign. For example, a value of 7.5corresponds to 7.5%. |
getTaxPercentage(): ?string | setTaxPercentage(?string taxPercentage): void |
invoiceIds |
?(string[]) |
Optional | The IDs of the invoices created for the subscription, listed in order when the invoices were created (oldest invoices appear first). |
getInvoiceIds(): ?array | setInvoiceIds(?array invoiceIds): void |
priceOverrideMoney |
?Money |
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. |
getPriceOverrideMoney(): ?Money | setPriceOverrideMoney(?Money priceOverrideMoney): void |
version |
?int |
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. |
getVersion(): ?int | setVersion(?int version): void |
createdAt |
?string |
Optional | The timestamp when the subscription was created, in RFC 3339 format. | getCreatedAt(): ?string | setCreatedAt(?string createdAt): void |
cardId |
?string |
Optional | The ID of the customer card that is charged for the subscription. |
getCardId(): ?string | setCardId(?string cardId): void |
paidUntilDate |
?string |
Optional | The date up to which the customer is invoiced for the subscription, in YYYY-MM-DD format (for example, 2013-01-15). After the invoice is paid 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 customer gets an invoice (or charged the card) on May 1. For the monthly billing scenario, this date is then set to May 31. |
getPaidUntilDate(): ?string | setPaidUntilDate(?string paidUntilDate): void |
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). |
getTimezone(): ?string | setTimezone(?string timezone): void |
{
"id": "id0",
"location_id": "location_id4",
"plan_id": "plan_id8",
"customer_id": "customer_id8",
"start_date": "start_date6"
}