Plans
Create, update, delete, and query the available Plans in Stripe.
Table Specific Information
Select
Server-Side Query Support
The connector uses 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, Active, AccountId, and ProductId support the following operators: =.
- Created support the following operators: <,>>=,<,<=,=.
The provider supports the use of all columns as criteria in the WHERE clause of SELECT statements, as long as SupportEnhancedSQL is set to True. If SupportEnhancedSQL property is set to False, you still can retrieve:
Plan by specifying its Id:
SELECT * FROM Plans WHERE Id = 'gold'
Plans created after a specific date(Created may be used with the >, >=, <, <=, or = conditions and may be used twice to specify a range):
SELECT * FROM Plans WHERE Created > '2016-01-03'
Insert
ProductId or ProductName, Currency and Interval columns are required to create a new plan.
INSERT INTO Plans (Active, AggregateUsage, BillingScheme, Currency, Nickname, ProductName, ProductActive, ProductStatementDescriptor, ProductTaxCode, ProductUnitLabel, [Interval], IntervalCount, TrialPeriodDays, UsageType, Tiersmode, TiersAggregate, MetadataAggregate) values (true,'last_ever','tiered','aud','Test2','MYNEWPRODUCT6',true,'Example statement','txcd_30040003','TestLabel','week',3,15,'metered','volume','[{\"up_to\":\"inf\",\"flat_amount_decimal\":\"356\",\"unit_amount_decimal\":\"785\"}]','[{\"Test\":\"123\",\"Test1\":\"456\",\"Test2\":\"789\"}]'
Note:There are multiple ways to create a new plan. For more details, please refer to the API documentation.
Update
To update a plan, specify Id column.
UPDATE Plans set Active =false, MetadataAggregate = '[{\"order_id\":\"124\"}]', Nickname = 'updatednickname', TrialPeriodDays = 25, ProductId = 'prod_PDnk45sKPO58Cy' where Id = 'plan_PDnshHrzdDXeUE'
Delete
To delete a plan specify the Id of the plan.
DELETE FROM Plans WHERE Id = '123easdas5'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | String | False |
The Id of the plan. | |
Active | Boolean | False |
Whether the plan can be used for new purchases. | |
Amount | Integer | False |
The amount in cents to be charged on the interval specified. | |
AmountDecimal | Decimal | False |
The decimal value of amount in cents to be charged on the interval specified. | |
UnitAmount | Decimal | True |
The amount in cents to be charged on the interval specified. | |
AggregateUsage | String | False |
Specifies a usage aggregation strategy for plans of usage_type=metered. The allowed values are last_during_period, last_ever, max, sum. | |
BillingScheme | String | False |
Describes how to compute the price per period. Either per_unit or tiered. The allowed values are per_unit, tiered. | |
Created | Datetime | True |
The creation date. | |
Currency | String | False |
Currency in which subscription will be charged. | |
Nickname | String | False |
A brief description of the plan, hidden from customers. | |
ProductId | String | False |
The product whose pricing this plan determines. | |
ProductName | String | False |
The product whose pricing this plan determines. The product’s name, meant to be displayable to the customer. | |
ProductActive | Boolean | False |
The product whose pricing this plan determines. Whether the product is currently available for purchase. Defaults to true. | |
ProductMetadata | String | False |
The product whose pricing this plan determines. Set of key-value pairs that you can attach to an object. | |
ProductStatementDescriptor | String | False |
The product whose pricing this plan determines. An arbitrary string to be displayed on your customer’s credit card or bank statement. | |
ProductTaxCode | String | False |
The product whose pricing this plan determines. A tax code ID. | |
ProductUnitLabel | String | False |
The product whose pricing this plan determines. A label that represents units of this product. | |
LiveMode | Boolean | True |
Has the value true if the object exists in live mode or the value false if the object exists in test mode. | |
Interval | String | False |
One of day, week, month or year. The frequency with which a subscription should be billed. The allowed values are day, week, month, year. | |
IntervalCount | Integer | False |
The number of intervals (specified in the interval property) between each subscription billing. For example, interval=month and interval_count=3 bills every 3 months. | |
TrialPeriodDays | Integer | False |
Number of trial period days granted when subscribing a customer to this plan. Null if the plan has no trial period. | |
MetadataAggregate | String | False |
Number of trial period days granted when subscribing a customer to this plan. Null if the plan has no trial period. | |
TiersAggregate | String | False |
Each element represents a pricing tier. | |
TiersMode | String | False |
Defines if the tiering price should be graduated or volume based. | |
TransformUsageDivideBy | Integer | False |
Divide usage by this number. | |
TransformUsageRound | String | False |
After division, either round the result up or down. | |
UsageType | String | False |
Configures how the quantity per period should be determined. Can be either metered or licensed. |
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 |
AccountId | String |
The Id of the connected account to get plans for. |