Create, update, delete, and query the available Subscriptions in Stripe.
Table Specific Information
Server-Side Query Support
The connector will use the Stripe API to filter the results by the following columns and operators while the rest of the filter is executed client side within the connector.
- Id, CustomerId, CreatedAt, PlanId, Status support the following operators:<,>>=, <, <=, =.
The provider supports all columns to be used as criteria in the Where clause of Select statement, as long as SupportEnhancedSQL is set to True. If SupportEnhancedSQL property is set to False, you still can retreive:
-a Subscription by specifying its Id:
SELECT * FROM Subscriptions WHERE Id='mySubscriptionId'
-Subscriptions created after a specific date (Created may be used with the >, >=, <, <=, or = conditions and may be used twice to specify a range):
SELECT * FROM Subscriptions WHERE CreatedAt > '2016-01-03'
-Subscriptions that belong to a Customer:
SELECT * FROM Subscriptions WHERE CustomerId='cus_12345678'
-Subscriptions that belong to a Plan:
SELECT * FROM Subscriptions WHERE PlanId='myPlanId'
-Subscriptions with a specific Status:
SELECT * FROM Subscriptions WHERE Status='active'
CustomerId and PlanId columns are required to create a new subscription .
INSERT INTO Subscriptions(CustomerId,PlanId,ApplicationFeePercent,Quantity,TaxPercent,TrialEnd) VALUES ('cus_A8PXYRQoPlrgpR','123-z72a0xda9',1,100,10,'2017-12-12')
To apply a discount to a new subscription, set the CouponId field:
INSERT INTO Subscriptions(CustomerId,PlanId,ApplicationFeePercent,Quantity,TaxPercent,TrialEnd,CouponId) VALUES ('cus_A8PXYRQoPlrgpR','123-z72a0xda9',1,100,10,'2017-12-12','cup_123456')
To update a subscription, specify Id column.
UPDATE Subscriptions SET ApplicationFeePercent=0,Quantity=500,TaxPercent=10,IsProrate=true WHERE Id='sub_A9WZGVTbvgBJ4t'
To apply a discount to an existing subscription, set the CouponId field:
UPDATE Subscriptions SET CouponId='cup_123456' WHERE Id='sub_A9WZGVTbvgBJ4t'
To delete a subscription specify the Id of the subscription.
DELETE FROM Subscriptions WHERE Id = 'sub_A9WZGVTbvgBJ4t'
The Id of the subscription.
The Id of the customer who owns the subscription.
The Id of the plan.
A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application of the Stripe account owner each billing period.
If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
The creation date.
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
Start of the current period that the subscription has been invoiced for.
The id of the discount.
If the subscription has ended (either because it was canceled or because the customer was switched to a subscription to a new plan), the date the subscription ended.
The quantity of the plan to which the customer should be subscribed. For example, if your plan is $10/user/month, and your customer has 5 users, you could pass 5 as the quantity to have the customer charged $50 (5 x $10) monthly.
Date the most recent update to this subscription started.
The status of the subscription
The allowed values are active, past_due, unpaid, canceled, incomplete, incomplete_expired, trialing, all, ended.
If provided, each invoice created by this subscription will apply the tax rate, increasing the amount billed to the customer.
If the subscription has a trial, the end of that trial.
If the subscription has a trial, the beginning of that trial.
The set of key/value pairs that you can attach to a subscription object.
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.
Flag indicating whether to prorate switching plans during a billing cycle.
If set, the proration will be calculated as though the subscription was updated at the given time. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.
The number of trial period days before the customer is charged for the first time. If set, trial_period_days overrides the default trial period days of the plan the customer is being subscribed to.
The Id of the connected account to get subscriptions for.