Subscriptions
Create and manage subscriptions.
Table Specific Information
Select
The driver uses the Square API to process search criteria that refer to the Id column, while other filters are processed client side within the driver.
Retrieve all subscriptions.
SELECT * from Subscriptions
Retrieve a specific subscription.
SELECT * FROM Subscriptions where id = 'f29e36f4-9732-4d31-8d23-d1ca6b2273f5'
Insert
To create a subscription, you will need to specify the LocationId, CustomerId, PlanId columns and pseudo columns: Ordinal and OrderTemplateId.
INSERT INTO Subscriptions(LocationId, CustomerId,PlanId,Ordinal,OrderTemplateId) VALUES('92BYHNBR6W77E','37V9WES5A57VJV5S9PNC2PCPB0','AF3H4KOG4HK54EPPTE7YIAK7',0,'sQTMsDhjLSPgZRrWDEcalgb7zUaZY')
Update
Updates a subscription.
UPDATE Subscriptions SET Note = 'New Note' where id = '52eb5160-1eeb-45c3-bf81-b02beb1824d2'
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | String | True |
The Square-assigned ID of the subscription. |
LocationId | String | True |
The ID of the location associated with the subscription. |
CustomerId | String | True |
The ID of the subscribing customer profile. |
PlanId | String | True |
The ID of the subscribed-to subscription plan variation. |
SourceName | String | False |
An optional note to include when creating a payment. |
StartDate | Datetime | True |
The YYYY-MM-DD-formatted date to start the subscription. |
CanceledDate | Datetime | False |
The YYYY-MM-DD-formatted date to cancel the subscription, when the subscription status changes to CANCELED and the subscription billing stops. |
ChargedThroughDate | Datetime | True |
The YYYY-MM-DD-formatted date up to when the subscriber is invoiced for the subscription. |
Note | String | False |
An optional note to include when creating a payment. |
Status | String | True |
The current status of the subscription. |
TaxPercentage | String | False |
The tax amount applied when billing the subscription. |
InvoiceIds | String | True |
The IDs of the invoices created for the subscription, listed in order when the invoices were created. |
PriceOverrideMoneyAmount | Int64 | False |
The amount of money, in the smallest denomination of the currency indicated by currency, which overrides the cost of a subscription plan variation with STATIC pricing. |
PriceOverrideMoneyCurrency | String | False |
The type of currency, in ISO 4217 format used to indicate the type of currency for the amount which overrides the cost of a subscription plan variation with STATIC pricing. |
Version | Int64 | False |
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 | Datetime | True |
The timestamp when the subscription was created, in RFC 3339 format. |
CardId | String | False |
The ID of the subscriber's card used to charge for the subscription. |
Timezone | String | True |
Timezone that will be used in date calculations for the subscription. Defaults to the timezone of the location based on location_id. |
Phases | String | False |
An array of phases for this subscription |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
Name | Type | Description |
Ordinal | Int64 |
The index of phase in total subscription plan. |
OrderTemplateId | String |
The id of order to be used in billing. |