Safe Haskell | None |
---|---|
Language | Haskell2010 |
StripeAPI.Types.Plan
Description
Contains the types generated from the schema Plan
Synopsis
- data Plan = Plan {
- planActive :: Bool
- planAggregateUsage :: Maybe PlanAggregateUsage'
- planAmount :: Maybe Int
- planAmountDecimal :: Maybe Text
- planBillingScheme :: PlanBillingScheme'
- planCreated :: Int
- planCurrency :: Text
- planId :: Text
- planInterval :: PlanInterval'
- planIntervalCount :: Int
- planLivemode :: Bool
- planMetadata :: Maybe Object
- planNickname :: Maybe Text
- planProduct :: Maybe PlanProduct'Variants
- planTiers :: Maybe [PlanTier]
- planTiersMode :: Maybe PlanTiersMode'
- planTransformUsage :: Maybe PlanTransformUsage'
- planTrialPeriodDays :: Maybe Int
- planUsageType :: PlanUsageType'
- mkPlan :: Bool -> PlanBillingScheme' -> Int -> Text -> Text -> PlanInterval' -> Int -> Bool -> PlanUsageType' -> Plan
- data PlanAggregateUsage'
- data PlanBillingScheme'
- data PlanInterval'
- data PlanProduct'Variants
- data PlanTiersMode'
- data PlanTransformUsage' = PlanTransformUsage' {}
- mkPlanTransformUsage' :: PlanTransformUsage'
- data PlanTransformUsage'Round'
- data PlanUsageType'
Documentation
Defines the object schema located at components.schemas.plan
in the specification.
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
Related guides: Set up a subscription and more about products and prices.
Constructors
Plan | |
Fields
|
Arguments
:: Bool | |
-> PlanBillingScheme' | |
-> Int | |
-> Text | |
-> Text | |
-> PlanInterval' | |
-> Int | |
-> Bool | |
-> PlanUsageType' | |
-> Plan |
Create a new Plan
with all required fields.
data PlanAggregateUsage' Source #
Defines the enum schema located at components.schemas.plan.properties.aggregate_usage
in the specification.
Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.
Constructors
PlanAggregateUsage'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanAggregateUsage'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanAggregateUsage'EnumLastDuringPeriod | Represents the JSON value |
PlanAggregateUsage'EnumLastEver | Represents the JSON value |
PlanAggregateUsage'EnumMax | Represents the JSON value |
PlanAggregateUsage'EnumSum | Represents the JSON value |
Instances
Eq PlanAggregateUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanAggregateUsage' -> PlanAggregateUsage' -> Bool # (/=) :: PlanAggregateUsage' -> PlanAggregateUsage' -> Bool # | |
Show PlanAggregateUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanAggregateUsage' -> ShowS # show :: PlanAggregateUsage' -> String # showList :: [PlanAggregateUsage'] -> ShowS # | |
ToJSON PlanAggregateUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanAggregateUsage' -> Value # toEncoding :: PlanAggregateUsage' -> Encoding # toJSONList :: [PlanAggregateUsage'] -> Value # toEncodingList :: [PlanAggregateUsage'] -> Encoding # | |
FromJSON PlanAggregateUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanAggregateUsage' # parseJSONList :: Value -> Parser [PlanAggregateUsage'] # |
data PlanBillingScheme' Source #
Defines the enum schema located at components.schemas.plan.properties.billing_scheme
in the specification.
Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
Constructors
PlanBillingScheme'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanBillingScheme'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanBillingScheme'EnumPerUnit | Represents the JSON value |
PlanBillingScheme'EnumTiered | Represents the JSON value |
Instances
Eq PlanBillingScheme' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanBillingScheme' -> PlanBillingScheme' -> Bool # (/=) :: PlanBillingScheme' -> PlanBillingScheme' -> Bool # | |
Show PlanBillingScheme' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanBillingScheme' -> ShowS # show :: PlanBillingScheme' -> String # showList :: [PlanBillingScheme'] -> ShowS # | |
ToJSON PlanBillingScheme' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanBillingScheme' -> Value # toEncoding :: PlanBillingScheme' -> Encoding # toJSONList :: [PlanBillingScheme'] -> Value # toEncodingList :: [PlanBillingScheme'] -> Encoding # | |
FromJSON PlanBillingScheme' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanBillingScheme' # parseJSONList :: Value -> Parser [PlanBillingScheme'] # |
data PlanInterval' Source #
Defines the enum schema located at components.schemas.plan.properties.interval
in the specification.
The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`.
Constructors
PlanInterval'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanInterval'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanInterval'EnumDay | Represents the JSON value |
PlanInterval'EnumMonth | Represents the JSON value |
PlanInterval'EnumWeek | Represents the JSON value |
PlanInterval'EnumYear | Represents the JSON value |
Instances
Eq PlanInterval' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanInterval' -> PlanInterval' -> Bool # (/=) :: PlanInterval' -> PlanInterval' -> Bool # | |
Show PlanInterval' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanInterval' -> ShowS # show :: PlanInterval' -> String # showList :: [PlanInterval'] -> ShowS # | |
ToJSON PlanInterval' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanInterval' -> Value # toEncoding :: PlanInterval' -> Encoding # toJSONList :: [PlanInterval'] -> Value # toEncodingList :: [PlanInterval'] -> Encoding # | |
FromJSON PlanInterval' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanInterval' # parseJSONList :: Value -> Parser [PlanInterval'] # |
data PlanProduct'Variants Source #
Defines the oneOf schema located at components.schemas.plan.properties.product.anyOf
in the specification.
The product whose pricing this plan determines.
Constructors
PlanProduct'Text Text | |
PlanProduct'Product Product | |
PlanProduct'DeletedProduct DeletedProduct |
Instances
Eq PlanProduct'Variants Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanProduct'Variants -> PlanProduct'Variants -> Bool # (/=) :: PlanProduct'Variants -> PlanProduct'Variants -> Bool # | |
Show PlanProduct'Variants Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanProduct'Variants -> ShowS # show :: PlanProduct'Variants -> String # showList :: [PlanProduct'Variants] -> ShowS # | |
ToJSON PlanProduct'Variants Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanProduct'Variants -> Value # toEncoding :: PlanProduct'Variants -> Encoding # toJSONList :: [PlanProduct'Variants] -> Value # toEncodingList :: [PlanProduct'Variants] -> Encoding # | |
FromJSON PlanProduct'Variants Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanProduct'Variants # parseJSONList :: Value -> Parser [PlanProduct'Variants] # |
data PlanTiersMode' Source #
Defines the enum schema located at components.schemas.plan.properties.tiers_mode
in the specification.
Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
Constructors
PlanTiersMode'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanTiersMode'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanTiersMode'EnumGraduated | Represents the JSON value |
PlanTiersMode'EnumVolume | Represents the JSON value |
Instances
Eq PlanTiersMode' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanTiersMode' -> PlanTiersMode' -> Bool # (/=) :: PlanTiersMode' -> PlanTiersMode' -> Bool # | |
Show PlanTiersMode' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanTiersMode' -> ShowS # show :: PlanTiersMode' -> String # showList :: [PlanTiersMode'] -> ShowS # | |
ToJSON PlanTiersMode' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanTiersMode' -> Value # toEncoding :: PlanTiersMode' -> Encoding # toJSONList :: [PlanTiersMode'] -> Value # toEncodingList :: [PlanTiersMode'] -> Encoding # | |
FromJSON PlanTiersMode' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanTiersMode' # parseJSONList :: Value -> Parser [PlanTiersMode'] # |
data PlanTransformUsage' Source #
Defines the object schema located at components.schemas.plan.properties.transform_usage.anyOf
in the specification.
Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \`tiers\`.
Constructors
PlanTransformUsage' | |
Fields
|
Instances
Eq PlanTransformUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanTransformUsage' -> PlanTransformUsage' -> Bool # (/=) :: PlanTransformUsage' -> PlanTransformUsage' -> Bool # | |
Show PlanTransformUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanTransformUsage' -> ShowS # show :: PlanTransformUsage' -> String # showList :: [PlanTransformUsage'] -> ShowS # | |
ToJSON PlanTransformUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanTransformUsage' -> Value # toEncoding :: PlanTransformUsage' -> Encoding # toJSONList :: [PlanTransformUsage'] -> Value # toEncodingList :: [PlanTransformUsage'] -> Encoding # | |
FromJSON PlanTransformUsage' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanTransformUsage' # parseJSONList :: Value -> Parser [PlanTransformUsage'] # |
mkPlanTransformUsage' :: PlanTransformUsage' Source #
Create a new PlanTransformUsage'
with all required fields.
data PlanTransformUsage'Round' Source #
Defines the enum schema located at components.schemas.plan.properties.transform_usage.anyOf.properties.round
in the specification.
After division, either round the result `up` or `down`.
Constructors
PlanTransformUsage'Round'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanTransformUsage'Round'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanTransformUsage'Round'EnumDown | Represents the JSON value |
PlanTransformUsage'Round'EnumUp | Represents the JSON value |
Instances
Eq PlanTransformUsage'Round' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanTransformUsage'Round' -> PlanTransformUsage'Round' -> Bool # (/=) :: PlanTransformUsage'Round' -> PlanTransformUsage'Round' -> Bool # | |
Show PlanTransformUsage'Round' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanTransformUsage'Round' -> ShowS # show :: PlanTransformUsage'Round' -> String # showList :: [PlanTransformUsage'Round'] -> ShowS # | |
ToJSON PlanTransformUsage'Round' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanTransformUsage'Round' -> Value # toEncoding :: PlanTransformUsage'Round' -> Encoding # toJSONList :: [PlanTransformUsage'Round'] -> Value # | |
FromJSON PlanTransformUsage'Round' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanTransformUsage'Round' # parseJSONList :: Value -> Parser [PlanTransformUsage'Round'] # |
data PlanUsageType' Source #
Defines the enum schema located at components.schemas.plan.properties.usage_type
in the specification.
Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.
Constructors
PlanUsageType'Other Value | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. |
PlanUsageType'Typed Text | This constructor can be used to send values to the server which are not present in the specification yet. |
PlanUsageType'EnumLicensed | Represents the JSON value |
PlanUsageType'EnumMetered | Represents the JSON value |
Instances
Eq PlanUsageType' Source # | |
Defined in StripeAPI.Types.Plan Methods (==) :: PlanUsageType' -> PlanUsageType' -> Bool # (/=) :: PlanUsageType' -> PlanUsageType' -> Bool # | |
Show PlanUsageType' Source # | |
Defined in StripeAPI.Types.Plan Methods showsPrec :: Int -> PlanUsageType' -> ShowS # show :: PlanUsageType' -> String # showList :: [PlanUsageType'] -> ShowS # | |
ToJSON PlanUsageType' Source # | |
Defined in StripeAPI.Types.Plan Methods toJSON :: PlanUsageType' -> Value # toEncoding :: PlanUsageType' -> Encoding # toJSONList :: [PlanUsageType'] -> Value # toEncodingList :: [PlanUsageType'] -> Encoding # | |
FromJSON PlanUsageType' Source # | |
Defined in StripeAPI.Types.Plan Methods parseJSON :: Value -> Parser PlanUsageType' # parseJSONList :: Value -> Parser [PlanUsageType'] # |