SubscriptionItems
Create, update, delete, and query the available subscription items in Stripe.
Table Specific Information
Select
Server-Side Query Support
The driver 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 driver.
- Id, SubscriptionId and AccountId support the following operator: =.
To query the SubscriptionItems table, the SubscriptionId column is required:
SELECT * FROM SubscriptionItems WHERE SubscriptionId = 'sub_A9WZGVTbvgBJ4t'
Insert
SubscriptionId and PlanId columns are required to create a new subscription item:
INSERT INTO SubscriptionItems (SubscriptionId, PlanId, ProrationDate, Quantity) VALUES ('sub_1OMqdl2eZvKYlo2CIci8bOT8', 'price_1OPjac2eZvKYlo2Cm8XeR5YQ', '2014-12-12', 10)
Update
To update a subscription item, specify its Id:
UPDATE SubscriptionItems SET PlanId = 'price_1OPjac2eZvKYlo2Cm8XeR5YQ', ProrationDate = '2014-12-12', Quantity = 12 WHERE Id = 'si_PDakKMQHunYX0k'
Delete
To delete a subscription item, specify its Id:
DELETE FROM SubscriptionItems WHERE Id = 'sit_A9WZGVTbvgBJ4t'
Columns
Name | Type | ReadOnly | References | Description |
Id [KEY] | String | True |
The Id of the subscription item. | |
SubscriptionId | String | False |
The Id of the subscription. | |
PlanId | String | False |
Plans.Id |
The Id of the plan. |
PlanActive | Boolean | True |
Whether the plan can be used for new purchases. | |
PlanAggregateUsage | String | True |
Specifies a usage aggregation strategy for plans of usage_type=metered. | |
PlanAmount | Integer | True |
The unit amount in cents to be charged, represented as a whole integer if possible. | |
PlanAmountDecimal | String | True |
The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places. | |
PlanBillingScheme | String | True |
Describes how to compute the price per period. | |
PlanCreated | Datetime | True |
Time at which the object was created. Measured in seconds since the Unix epoch. | |
PlanCurrency | String | True |
Three-letter ISO currency code, in lowercase. Must be a supported currency. | |
PlanInterval | String | True |
The frequency at which a subscription is billed. One of day, week, month or year. | |
PlanIntervalCount | Integer | True |
The number of intervals (specified in the interval attribute) between subscription billings. | |
PlanLivemode | Boolean | True |
Has the value true if the object exists in live mode or the value false if the object exists in test mode. | |
PlanMetadata | String | True |
Set of key-value pairs that you can attach to an object. | |
PlanMeter | String | True |
The meter tracking the usage of a metered price. | |
PlanNickname | String | True |
A brief description of the plan, hidden from customers. | |
PlanObject | String | True |
String representing the object's type. Objects of the same type share the same value. | |
PlanProduct | String | True |
The product whose pricing this plan determines. | |
PlanTiersMode | String | True |
Defines if the tiering price should be graduated or volume based. | |
PlanTransformUsage | String | True |
Apply a transformation to the reported usage or set quantity before computing the amount billed. | |
PlanTrialPeriodDays | Integer | True |
Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. | |
PlanUsageType | String | True |
Configures how the quantity per period should be determined. | |
Quantity | Double | False |
The quantity of the plan to which the customer should be subscribed. | |
Created | Datetime | True |
Creation date. | |
MetadataAggregate | String | False |
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. | |
PriceId | String | False |
Prices.Id |
Unique identifier for the price. |
PriceActive | Boolean | True |
Whether the price can be used for new purchases. | |
PriceBillingScheme | String | True |
Describes how to compute the price per period. | |
PriceCreated | Datetime | True |
The creation date. | |
PriceCurrency | String | True |
Currency in which subscription will be charged. | |
PriceCustomUnitAmount | String | True |
Price custom unit amount. | |
PriceLivemode | Boolean | True |
Has the value true if the object exists in live mode or the value false if the object exists in test mode. | |
PriceLookupKey | String | True |
A lookup key used to retrieve prices dynamically from a static string. | |
PriceMetadata | String | True |
Set of key-value pairs that you can attach to an object. | |
PriceNickname | String | True |
A brief description of the plan, hidden from customers. | |
PriceObject | String | True |
String representing the object's type. Objects of the same type share the same value. | |
PriceProduct | String | True |
The Id of the product this price is associated with. | |
PriceRecurringAggregateUsage | String | True |
Price recurring aggregate usage. | |
PriceRecurringInterval | String | True |
Price recurring interval. | |
PriceRecurringIntervalCount | Integer | True |
Price recurring interval count. | |
PriceRecurringMeter | String | True |
Price recurring meter. | |
PriceRecurringTrialPeriodDays | Integer | True |
Price recurring trial period days. | |
PriceRecurringUsageType | String | True |
Price recurring usage type. | |
PriceTaxBehaviour | String | True |
Price tax behaviour. | |
PriceTiersMode | String | True |
Price tiers mode. | |
PriceTransformQuantity | String | True |
Price transform quantity. | |
PriceType | String | True |
Price type. | |
PriceUnitAmount | Integer | True |
Price unit amount. | |
PriceUnitAmountDecimal | String | True |
Price unit amount decimal. | |
Object | String | True |
String representing the object's type. Objects of the same type share the same value. | |
BillingThresholdsUsageGte | Integer | False |
Usage threshold that triggers the subscription to create an invoice | |
TaxRatesAggregate | String | False |
The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. | |
Discounts | String | False |
The coupons to redeem into discounts for the subscription item. |
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 |
IsProrate | Boolean |
Flag indicating whether to prorate switching plans during a billing cycle. |
ProrationDate | Date |
If set, the proration will be calculated as though the subscription was updated at the given time. |
PaymentBehavior | String |
Payment Behavior. Valid for INSERT, DELETE and UPDATE. The allowed values are allow_incomplete, default_incomplete, error_if_incomplete, pending_if_incomplete. |
ProrationBehavior | String |
Determines how to handle prorations when the billing cycle changes. Valid for INSERT, DELETE and UPDATE. The allowed values are always_invoice, create_prorations, none. |
AccountId | String |
The Id of the connected account to get subscription items for |